From 3b56f7f7ebe982367c32321182f8e9e5e79d1c4f Mon Sep 17 00:00:00 2001 From: John Soo Date: Thu, 10 Mar 2022 22:54:31 -0800 Subject: [PATCH] Test directory artifact paths. --- agent/artifact_uploader_test.go | 16 ++++++++++++++++ .../artifacts/nested/nested0/logfile.out | 1 + test/fixtures/artifacts/nested/output.log | 1 + 3 files changed, 18 insertions(+) create mode 100644 test/fixtures/artifacts/nested/nested0/logfile.out create mode 100644 test/fixtures/artifacts/nested/output.log diff --git a/agent/artifact_uploader_test.go b/agent/artifact_uploader_test.go index f0f88f7e83..a329f17c90 100644 --- a/agent/artifact_uploader_test.go +++ b/agent/artifact_uploader_test.go @@ -74,6 +74,22 @@ func TestCollect(t *testing.T) { FileSize: 2038453, Sha1Sum: "bd4caf2e01e59777744ac1d52deafa01c2cb9bfd", }, + { + Name: "output.log", + Path: []string{rootWithoutVolume[1:], "test", "fixtures", "artifacts", "nested", "output.log"}, + AbsolutePath: filepath.Join(root, "test", "fixtures", "artifacts", "nested", "output.log"), + GlobPath: filepath.Join(root, "test", "fixtures", "artifacts", "nested"), + FileSize: 14, + Sha1Sum: "1ec2e13e3871a980eaee0f11c6f47ad1d1f97b3e", + }, + { + Name: "logfile.out", + Path: []string{rootWithoutVolume[1:], "test", "fixtures", "artifacts", "nested", "nested0", "logfile.out"}, + AbsolutePath: filepath.Join(root, "test", "fixtures", "artifacts", "nested", "nested0", "logfile.out"), + GlobPath: filepath.Join(root, "test", "fixtures", "artifacts", "nested"), + FileSize: 19, + Sha1Sum: "e30f8100faed6430e6fd617da8ea17100ac97188", + }, } uploader := NewArtifactUploader(logger.Discard, nil, ArtifactUploaderConfig{ diff --git a/test/fixtures/artifacts/nested/nested0/logfile.out b/test/fixtures/artifacts/nested/nested0/logfile.out new file mode 100644 index 0000000000..0364518667 --- /dev/null +++ b/test/fixtures/artifacts/nested/nested0/logfile.out @@ -0,0 +1 @@ +logging out to file \ No newline at end of file diff --git a/test/fixtures/artifacts/nested/output.log b/test/fixtures/artifacts/nested/output.log new file mode 100644 index 0000000000..9d0445bbd1 --- /dev/null +++ b/test/fixtures/artifacts/nested/output.log @@ -0,0 +1 @@ +logging output \ No newline at end of file