Skip to content

Commit 5d53e89

Browse files
committed
Archive snippets outputs
1 parent cce9dd1 commit 5d53e89

File tree

77 files changed

+44
-3524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+44
-3524
lines changed

.evergreen-functions.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ variables:
4949
- READINESS_PROBE_VERSION
5050
- VERSION_UPGRADE_HOOK_VERSION
5151
- BUILD_SCENARIO
52+
- MDB_BASH_DEBUG
5253

5354
functions:
5455

@@ -795,18 +796,14 @@ functions:
795796
#
796797
# Code snippet test automation
797798
#
798-
799-
sample_commit_output:
800-
- command: github.generate_token
801-
params:
802-
expansion_name: GH_TOKEN
799+
archive_snippets_output:
803800
- command: subprocess.exec
804801
params:
805802
include_expansions_in_env:
806803
- GH_TOKEN
807-
- code_snippets_commit_output
804+
- MDB_BASH_DEBUG
808805
working_dir: src/github.com/mongodb/mongodb-kubernetes
809-
binary: scripts/code_snippets/sample_commit_output.sh
806+
binary: scripts/code_snippets/archive_snippets_output.sh
810807

811808
# it executes a script by convention: ./scripts/code_snippets/tests/${task_name}
812809
test_code_snippets:
@@ -819,6 +816,7 @@ functions:
819816
- code_snippets_teardown
820817
- code_snippets_reset
821818
- task_name
819+
- MDB_BASH_DEBUG
822820
script: |
823821
./scripts/code_snippets/tests/${task_name}
824822

.evergreen-snippets.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,33 +66,19 @@ functions:
6666
permissions: private
6767
visibility: signed
6868
content_type: text/plain
69-
- command: s3.put
70-
params:
71-
aws_key: ${enterprise_aws_access_key_id}
72-
aws_secret: ${enterprise_aws_secret_access_key}
73-
local_files_include_filter:
74-
- src/github.com/mongodb/mongodb-kubernetes/public/architectures/**/*.out
75-
- src/github.com/mongodb/mongodb-kubernetes/docs/**/*.out
76-
preserve_path: true
77-
remote_file: logs/${task_id}/${execution}/
78-
bucket: operator-e2e-artifacts
79-
permissions: private
80-
visibility: signed
81-
content_type: text/plain
8269

8370
upload_code_snippets_outputs:
8471
- command: s3.put
8572
params:
8673
aws_key: ${enterprise_aws_access_key_id}
8774
aws_secret: ${enterprise_aws_secret_access_key}
8875
local_files_include_filter:
89-
- snippets_outputs.tgz
90-
remote_file: logs/${task_id}/${execution}/
76+
- snippets_outputs*.tgz
77+
remote_file: snippets_outputs/${version_id}
9178
bucket: operator-e2e-artifacts
9279
permissions: private
9380
visibility: signed
9481
content_type: ${content_type|application/x-gzip}
95-
display_name: "Snippets Outputs"
9682

9783
tasks:
9884
# Code snippets tasks
@@ -103,31 +89,31 @@ tasks:
10389
tags: [ "code_snippets" ]
10490
commands:
10591
- func: test_code_snippets
106-
- func: sample_commit_output
92+
- func: archive_snippets_output
10793

10894
- name: test_gke_multi_cluster_no_mesh_snippets.sh
10995
tags: [ "code_snippets" ]
11096
commands:
11197
- func: test_code_snippets
112-
- func: sample_commit_output
98+
- func: archive_snippets_output
11399

114100
- name: test_kind_search_community_snippets.sh
115101
tags: [ "code_snippets", "patch-run" ]
116102
commands:
117103
- func: test_code_snippets
118-
- func: sample_commit_output
104+
- func: archive_snippets_output
119105

120106
- name: test_kind_search_enterprise_snippets.sh
121107
tags: [ "code_snippets", "patch-run" ]
122108
commands:
123109
- func: test_code_snippets
124-
- func: sample_commit_output
110+
- func: archive_snippets_output
125111

126112
- name: test_kind_search_external_mongod_snippets.sh
127113
tags: [ "code_snippets", "patch-run" ]
128114
commands:
129115
- func: test_code_snippets
130-
- func: sample_commit_output
116+
- func: archive_snippets_output
131117

132118
task_groups:
133119
- name: gke_code_snippets_task_group

.evergreen-tasks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,25 @@ tasks:
6666
tags: [ "code_snippets" ]
6767
commands:
6868
- func: test_code_snippets
69-
- func: sample_commit_output
69+
- func: archive_snippets_output
7070

7171
- name: task_gke_multi_cluster_no_mesh_snippets
7272
tags: [ "code_snippets" ]
7373
commands:
7474
- func: test_code_snippets
75-
- func: sample_commit_output
75+
- func: archive_snippets_output
7676

7777
- name: task_kind_search_community_snippets
7878
tags: [ "code_snippets", "patch-run" ]
7979
commands:
8080
- func: test_code_snippets
81-
- func: sample_commit_output
81+
- func: archive_snippets_output
8282

8383
- name: task_kind_search_enterprise_snippets
8484
tags: [ "code_snippets", "patch-run" ]
8585
commands:
8686
- func: test_code_snippets
87-
- func: sample_commit_output
87+
- func: archive_snippets_output
8888

8989
## Below are only e2e runs for .evergreen.yml ##
9090

.evergreen.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,9 @@ parameters:
193193
value: "false"
194194
description: set this to true if you would like to delete the resources created in the code snippet tests, but keep the clusters
195195

196-
- key: code_snippets_commit_output
197-
value: "false"
198-
description: set this to true if you would like the pipeline to automatically push a branch with updated snippets outputs
196+
- key: MDB_BASH_DEBUG
197+
value: "0"
198+
description: set this to 1 if you want shell scripts to enable set -x
199199

200200
# Triggered manually or by PCT.
201201
patch_aliases:
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
3+
set -eou pipefail
4+
test "${MDB_BASH_DEBUG:-0}" -eq 1 && set -x
5+
6+
source scripts/dev/set_env_context.sh
7+
8+
# task_name is available from evergreen expansions and its set to the snippets test name (see tasks in .evergreen-snippets.yml)
9+
test_name=${task_name:?}
10+
test_name=${test_name%.sh}
11+
patch_id=${version_id:?}
12+
13+
# to run it locally:
14+
# $ test_name=test_kind_search_enterprise_snippets.sh archive_snippets_output.sh
15+
16+
output_dir="scripts/code_snippets/tests/outputs/${test_name}"
17+
if [[ ! -d "${output_dir}" ]]; then
18+
echo "Output dir is missing: ${output_dir}"
19+
exit 1
20+
fi
21+
22+
file_name="snippets_outputs_${patch_id}_${test_name}.tgz"
23+
tar -cvzf "${file_name}" "${output_dir}"
24+
25+
echo "Collected snippets outputs from ${test_name} into ${file_name}"

scripts/code_snippets/sample_commit_output.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

scripts/code_snippets/tests/outputs/test_gke_multi_cluster_no_mesh_snippets/ra-01_0030_verify_access_to_clusters.out

Lines changed: 0 additions & 15 deletions
This file was deleted.

scripts/code_snippets/tests/outputs/test_gke_multi_cluster_no_mesh_snippets/ra-02_0200_kubectl_mongodb_configure_multi_cluster.out

Lines changed: 0 additions & 49 deletions
This file was deleted.

scripts/code_snippets/tests/outputs/test_gke_multi_cluster_no_mesh_snippets/ra-02_0205_helm_configure_repo.out

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)