From 74fe585deaac64089598a56ff79e22f4826e241c Mon Sep 17 00:00:00 2001 From: Leif Battermann Date: Thu, 28 Sep 2023 12:53:50 +0000 Subject: [PATCH 1/9] include BUILD_NAME in s3 upload path for test logs --- hack/bin/integration-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/bin/integration-test.sh b/hack/bin/integration-test.sh index 841a3172fd8..e1ff73d672a 100755 --- a/hack/bin/integration-test.sh +++ b/hack/bin/integration-test.sh @@ -27,8 +27,8 @@ cleanup() { copyToAwsS3(){ if (( UPLOAD_LOGS > 0 )); then for t in "${tests[@]}"; do - echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION.log" - aws s3 cp "logs-$t" "s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION.log" + echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$BUILD_NAME.log" + aws s3 cp "logs-$t" "s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$BUILD_NAME.log" done fi } From fa4841d2f2479609ffbea1f378817ec5c36f8e72 Mon Sep 17 00:00:00 2001 From: Leif Battermann Date: Thu, 28 Sep 2023 13:38:26 +0000 Subject: [PATCH 2/9] try BUILD_ID --- hack/bin/integration-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/bin/integration-test.sh b/hack/bin/integration-test.sh index e1ff73d672a..a2738bfce36 100755 --- a/hack/bin/integration-test.sh +++ b/hack/bin/integration-test.sh @@ -27,8 +27,8 @@ cleanup() { copyToAwsS3(){ if (( UPLOAD_LOGS > 0 )); then for t in "${tests[@]}"; do - echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$BUILD_NAME.log" - aws s3 cp "logs-$t" "s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$BUILD_NAME.log" + echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$BUILD_ID.log" + aws s3 cp "logs-$t" "s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$BUILD_ID.log" done fi } From 56d3b380b12863a281d9eab922b68df49d9301c4 Mon Sep 17 00:00:00 2001 From: Leif Battermann Date: Thu, 28 Sep 2023 13:44:42 +0000 Subject: [PATCH 3/9] use uuid --- hack/bin/integration-test.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hack/bin/integration-test.sh b/hack/bin/integration-test.sh index a2738bfce36..2d05b698454 100755 --- a/hack/bin/integration-test.sh +++ b/hack/bin/integration-test.sh @@ -25,10 +25,11 @@ cleanup() { # Copy to the concourse output (indetified by $OUTPUT_DIR) for propagation to # following steps. copyToAwsS3(){ + build_uuid = uuidgen if (( UPLOAD_LOGS > 0 )); then for t in "${tests[@]}"; do - echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$BUILD_ID.log" - aws s3 cp "logs-$t" "s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$BUILD_ID.log" + echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$build_uuid.log" + aws s3 cp "logs-$t" "s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$build_uuid.log" done fi } From 38f7c05bd51a1938ed902d3fbc8f930221d2d74c Mon Sep 17 00:00:00 2001 From: Leif Battermann Date: Thu, 28 Sep 2023 14:09:28 +0000 Subject: [PATCH 4/9] fixed syntax --- hack/bin/integration-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/bin/integration-test.sh b/hack/bin/integration-test.sh index 2d05b698454..482b3aabcc3 100755 --- a/hack/bin/integration-test.sh +++ b/hack/bin/integration-test.sh @@ -25,7 +25,7 @@ cleanup() { # Copy to the concourse output (indetified by $OUTPUT_DIR) for propagation to # following steps. copyToAwsS3(){ - build_uuid = uuidgen + build_uuid=$(uuidgen) if (( UPLOAD_LOGS > 0 )); then for t in "${tests[@]}"; do echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$build_uuid.log" From d3df65959e7796995b4067af03e29d6438706251 Mon Sep 17 00:00:00 2001 From: Leif Battermann Date: Fri, 29 Sep 2023 09:12:20 +0000 Subject: [PATCH 5/9] added libuuid pacakge --- nix/wire-server.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/wire-server.nix b/nix/wire-server.nix index 14b45676516..955656d64af 100644 --- a/nix/wire-server.nix +++ b/nix/wire-server.nix @@ -448,6 +448,7 @@ in devEnv = pkgs.buildEnv { name = "wire-server-dev-env"; paths = commonTools ++ [ + pkgs.libuuid pkgs.bash pkgs.dash (pkgs.haskell-language-server.override { supportedGhcVersions = [ "92" ]; }) From 29252aaa38a0893c37a46869c62b544547ef82f5 Mon Sep 17 00:00:00 2001 From: Leif Battermann Date: Fri, 29 Sep 2023 11:29:00 +0000 Subject: [PATCH 6/9] try using relative path --- hack/bin/integration-test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hack/bin/integration-test.sh b/hack/bin/integration-test.sh index 482b3aabcc3..569cf00532d 100755 --- a/hack/bin/integration-test.sh +++ b/hack/bin/integration-test.sh @@ -14,7 +14,7 @@ CHART=wire-server tests=(integration stern galley cargohold gundeck federator spar brig) cleanup() { - if (( CLEANUP_LOCAL_FILES > 0 )); then + if ((CLEANUP_LOCAL_FILES > 0)); then for t in "${tests[@]}"; do rm -f "stat-$t" rm -f "logs-$t" @@ -24,9 +24,9 @@ cleanup() { # Copy to the concourse output (indetified by $OUTPUT_DIR) for propagation to # following steps. -copyToAwsS3(){ - build_uuid=$(uuidgen) - if (( UPLOAD_LOGS > 0 )); then +copyToAwsS3() { + build_uuid=$(./.env/bin/uuidgen) + if ((UPLOAD_LOGS > 0)); then for t in "${tests[@]}"; do echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$build_uuid.log" aws s3 cp "logs-$t" "s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$build_uuid.log" @@ -90,7 +90,7 @@ if ((exit_code > 0)); then x=$(cat "stat-$t") if ((x > 0)); then echo "=== (relevant) logs for failed $t-integration ===" - "$DIR/integration-logs-relevant-bits.sh" < "logs-$t" + "$DIR/integration-logs-relevant-bits.sh" <"logs-$t" fi done summary From b0816656b580364a553621cb7ac5a9672bbd317c Mon Sep 17 00:00:00 2001 From: Leif Battermann Date: Fri, 29 Sep 2023 12:32:18 +0000 Subject: [PATCH 7/9] use timestamp instead of uuid --- hack/bin/integration-test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/bin/integration-test.sh b/hack/bin/integration-test.sh index 569cf00532d..3c857f32fe0 100755 --- a/hack/bin/integration-test.sh +++ b/hack/bin/integration-test.sh @@ -25,11 +25,11 @@ cleanup() { # Copy to the concourse output (indetified by $OUTPUT_DIR) for propagation to # following steps. copyToAwsS3() { - build_uuid=$(./.env/bin/uuidgen) + build_ts=$(date +%s) if ((UPLOAD_LOGS > 0)); then for t in "${tests[@]}"; do - echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$build_uuid.log" - aws s3 cp "logs-$t" "s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$build_uuid.log" + echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$build_ts.log" + aws s3 cp "logs-$t" "s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$build_ts.log" done fi } From a5d8a83651fba3c84156dcbae1c0c0d18aa0d930 Mon Sep 17 00:00:00 2001 From: Leif Battermann Date: Fri, 29 Sep 2023 13:31:36 +0000 Subject: [PATCH 8/9] replaced slash with dash, removed libuuid --- hack/bin/integration-test.sh | 4 ++-- nix/wire-server.nix | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hack/bin/integration-test.sh b/hack/bin/integration-test.sh index 3c857f32fe0..0667ebeac28 100755 --- a/hack/bin/integration-test.sh +++ b/hack/bin/integration-test.sh @@ -28,8 +28,8 @@ copyToAwsS3() { build_ts=$(date +%s) if ((UPLOAD_LOGS > 0)); then for t in "${tests[@]}"; do - echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$build_ts.log" - aws s3 cp "logs-$t" "s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION/$build_ts.log" + echo "Copy logs-$t to s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION-$build_ts.log" + aws s3 cp "logs-$t" "s3://wire-server-test-logs/test-logs-$VERSION/$t-$VERSION-$build_ts.log" done fi } diff --git a/nix/wire-server.nix b/nix/wire-server.nix index 955656d64af..14b45676516 100644 --- a/nix/wire-server.nix +++ b/nix/wire-server.nix @@ -448,7 +448,6 @@ in devEnv = pkgs.buildEnv { name = "wire-server-dev-env"; paths = commonTools ++ [ - pkgs.libuuid pkgs.bash pkgs.dash (pkgs.haskell-language-server.override { supportedGhcVersions = [ "92" ]; }) From 8a1f321d4209ad3aacded5fb9f6d8536a801e847 Mon Sep 17 00:00:00 2001 From: Leif Battermann Date: Fri, 29 Sep 2023 13:36:22 +0000 Subject: [PATCH 9/9] changelog --- changelog.d/5-internal/WPB-4910 | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/5-internal/WPB-4910 diff --git a/changelog.d/5-internal/WPB-4910 b/changelog.d/5-internal/WPB-4910 new file mode 100644 index 00000000000..4d2155b181c --- /dev/null +++ b/changelog.d/5-internal/WPB-4910 @@ -0,0 +1 @@ +Include timestamp in s3 upload path for test logs