Roman Zipp
3 years ago
committed by
Fabian Vowie
No known key found for this signature in database
GPG Key ID: C27317C33B27C410
2 changed files with
1 additions and
7 deletions
-
main_test.go
-
pipelines/pipeline.go
|
|
@ -2,7 +2,6 @@ package main |
|
|
|
|
|
|
|
import ( |
|
|
|
"encoding/json" |
|
|
|
"fmt" |
|
|
|
"net/http" |
|
|
|
"net/http/httptest" |
|
|
|
"testing" |
|
|
@ -29,9 +28,7 @@ func TestIndexRoute(t *testing.T) { |
|
|
|
func TestEndpointRoute(t *testing.T) { |
|
|
|
data := pipelines.Pipeline{} |
|
|
|
err := faker.FakeData(&data) |
|
|
|
if err != nil { |
|
|
|
fmt.Println(err) |
|
|
|
} |
|
|
|
assert.Nil(t, err) |
|
|
|
|
|
|
|
t.Run("Registered pipelines are valid routes", func(t *testing.T) { |
|
|
|
router := mux.NewRouter() |
|
|
|
|
|
@ -44,8 +44,6 @@ type Pipeline struct { |
|
|
|
} |
|
|
|
|
|
|
|
func (p Pipeline) Run(srcPath, bucketName string, storageProvider storage.IStorageProvider) (string, error) { |
|
|
|
fmt.Println("path: ", storageProvider.GetPath(bucketName, srcPath)) |
|
|
|
|
|
|
|
src, err := imaging.Open(storageProvider.GetPath(bucketName, srcPath)) |
|
|
|
if err != nil { |
|
|
|
return "", errors.New(fmt.Sprintf("error opening file for processing: %s", err)) |
|
|
@ -134,7 +132,6 @@ func LoadPipelines() []IPipeline { |
|
|
|
|
|
|
|
err := filepath.Walk(path+"/config", func(path string, info fs.FileInfo, err error) error { |
|
|
|
if err == nil && info.IsDir() == false { |
|
|
|
fmt.Println(path) |
|
|
|
data, _ := os.ReadFile(path) |
|
|
|
files = append(files, data) |
|
|
|
} |
|
|
|