Skip to content

Commit 946ef97

Browse files
committed
Archive snippets outputs
1 parent 917723b commit 946ef97

File tree

77 files changed

+45
-3521
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

+45
-3521
lines changed

.evergreen-functions.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ variables:
4646
- RELEASE_INITIAL_VERSION
4747
- RELEASE_INITIAL_COMMIT_SHA
4848
- RELEASE_OPERATOR_VERSION
49+
- MDB_BASH_DEBUG
4950

5051
functions:
5152

@@ -249,7 +250,7 @@ functions:
249250
working_dir: src/github.com/mongodb/mongodb-kubernetes
250251
add_to_path:
251252
- ${workdir}/bin
252-
command: scripts/dev/setup_chart_testing_cli.sh
253+
command: scripts/dev/setup_chart_testing_cli.sh
253254

254255
lint_repo:
255256
- command: subprocess.exec
@@ -788,17 +789,17 @@ functions:
788789
# Code snippet test automation
789790
#
790791

791-
sample_commit_output:
792+
archive_snippets_output:
792793
- command: github.generate_token
793794
params:
794795
expansion_name: GH_TOKEN
795796
- command: subprocess.exec
796797
params:
797798
include_expansions_in_env:
798799
- GH_TOKEN
799-
- code_snippets_commit_output
800+
- MDB_BASH_DEBUG
800801
working_dir: src/github.com/mongodb/mongodb-kubernetes
801-
binary: scripts/code_snippets/sample_commit_output.sh
802+
binary: scripts/code_snippets/archive_snippets_output.sh
802803

803804
# it executes a script by convention: ./scripts/code_snippets/tests/${task_name}
804805
test_code_snippets:
@@ -812,6 +813,7 @@ functions:
812813
- code_snippets_teardown
813814
- code_snippets_reset
814815
- task_name
816+
- MDB_BASH_DEBUG
815817
script: |
816818
./scripts/code_snippets/tests/${task_name}
817819

.evergreen-snippets.yml

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

8168
upload_code_snippets_outputs:
8269
- command: s3.put
8370
params:
8471
aws_key: ${enterprise_aws_access_key_id}
8572
aws_secret: ${enterprise_aws_secret_access_key}
8673
local_files_include_filter:
87-
- snippets_outputs.tgz
88-
remote_file: logs/${task_id}/${execution}/
74+
- snippets_outputs*.tgz
75+
remote_file: snippets_outputs/${version_id}
8976
bucket: operator-e2e-artifacts
9077
permissions: private
9178
visibility: signed
9279
content_type: ${content_type|application/x-gzip}
93-
display_name: "Snippets Outputs"
9480

9581
tasks:
9682
# Code snippets tasks
@@ -101,31 +87,31 @@ tasks:
10187
tags: [ "code_snippets" ]
10288
commands:
10389
- func: test_code_snippets
104-
- func: sample_commit_output
90+
- func: archive_snippets_output
10591

10692
- name: test_gke_multi_cluster_no_mesh_snippets.sh
10793
tags: [ "code_snippets" ]
10894
commands:
10995
- func: test_code_snippets
110-
- func: sample_commit_output
96+
- func: archive_snippets_output
11197

11298
- name: test_kind_search_community_snippets.sh
11399
tags: [ "code_snippets", "patch-run" ]
114100
commands:
115101
- func: test_code_snippets
116-
- func: sample_commit_output
102+
- func: archive_snippets_output
117103

118104
- name: test_kind_search_enterprise_snippets.sh
119105
tags: [ "code_snippets", "patch-run" ]
120106
commands:
121107
- func: test_code_snippets
122-
- func: sample_commit_output
108+
- func: archive_snippets_output
123109

124110
- name: test_kind_search_external_mongod_snippets.sh
125111
tags: [ "code_snippets", "patch-run" ]
126112
commands:
127113
- func: test_code_snippets
128-
- func: sample_commit_output
114+
- func: archive_snippets_output
129115

130116
task_groups:
131117
- name: gke_code_snippets_task_group

.evergreen-tasks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,25 +76,25 @@ tasks:
7676
tags: [ "code_snippets" ]
7777
commands:
7878
- func: test_code_snippets
79-
- func: sample_commit_output
79+
- func: archive_snippets_output
8080

8181
- name: task_gke_multi_cluster_no_mesh_snippets
8282
tags: [ "code_snippets" ]
8383
commands:
8484
- func: test_code_snippets
85-
- func: sample_commit_output
85+
- func: archive_snippets_output
8686

8787
- name: task_kind_search_community_snippets
8888
tags: [ "code_snippets", "patch-run" ]
8989
commands:
9090
- func: test_code_snippets
91-
- func: sample_commit_output
91+
- func: archive_snippets_output
9292

9393
- name: task_kind_search_enterprise_snippets
9494
tags: [ "code_snippets", "patch-run" ]
9595
commands:
9696
- func: test_code_snippets
97-
- func: sample_commit_output
97+
- func: archive_snippets_output
9898

9999
## Below are only e2e runs for .evergreen.yml ##
100100

.evergreen.yml

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

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

193193
# Each variant needs to be tagged with one or more tags referencing related build scenario:
194194
# - pr_patch: for patches created by GitHub PRs
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)