diff options
author | Nick White <git@njw.name> | 2021-07-13 12:08:20 +0100 |
---|---|---|
committer | Nick White <git@njw.name> | 2021-07-13 12:08:20 +0100 |
commit | 8c98574edd21759f1882d0ec4240f562039913fd (patch) | |
tree | aab37d5b9a1e39906a17a1d1e2cdd788d8f14444 /internal/pipeline | |
parent | 45b0c3ed61b1a7b7d18090f483c5d9ff9cddec7b (diff) |
Fix up tests a bit
Diffstat (limited to 'internal/pipeline')
-rw-r--r-- | internal/pipeline/pipeline_test.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/internal/pipeline/pipeline_test.go b/internal/pipeline/pipeline_test.go index 4a08d3b..73e8223 100644 --- a/internal/pipeline/pipeline_test.go +++ b/internal/pipeline/pipeline_test.go @@ -30,6 +30,7 @@ func (t *StrLog) Write(p []byte) (n int, err error) { type PipelineTester interface { Pipeliner + TestInit() error DeleteObjects(bucket string, keys []string) error TestQueueId() string } @@ -309,6 +310,10 @@ func Test_upAndQueue(t *testing.T) { if err != nil { t.Fatalf("Could not initialise %s connection: %v\nLog: %s", conn.name, err, slog.log) } + err = conn.c.TestInit() + if err != nil { + t.Fatalf("Failed in test initialisation for %s: %v\nLog: %s", conn.name, err, slog.log) + } slog.log = "" tempDir := filepath.Join(os.TempDir(), "pipelinetest") err = os.MkdirAll(tempDir, 0700) @@ -390,11 +395,7 @@ func Test_upAndQueue(t *testing.T) { t.Fatalf("Uploaded file differs from expected, expected: '%s', got '%s'\nLog: %s", c.contents, dled, slog.log) } - target, err := filepath.Rel(os.TempDir(), filepath.Join(tempDir, c.ul)) - if err != nil { - t.Fatalf("Error removing TempDir prefix: %v", err) - } - queueExpected := target + " test" + queueExpected := "pipelinetest/" + c.ul + " test" if msg.Body != queueExpected { _ = conn.c.DelFromQueue(queueurl, msg.Handle) t.Fatalf("Queue contents not as expected, expected: '%s', got '%s'\nLog: %s", queueExpected, msg.Body, slog.log) |