Skip to content

Commit c136650

Browse files
committed
Refactored search snippets and incorporated changes from docs
1 parent 29f5bab commit c136650

File tree

114 files changed

+907
-1787
lines changed

Some content is hidden

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

114 files changed

+907
-1787
lines changed

.evergreen-functions.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ functions:
793793
working_dir: src/github.com/mongodb/mongodb-kubernetes
794794
binary: scripts/code_snippets/sample_commit_output.sh
795795

796-
# it executes a script by convention: ./scripts/code_snippets/${task_name}_test.sh
796+
# it executes a script by convention: ./scripts/code_snippets/tests/${task_name}
797797
test_code_snippets:
798798
- *switch_context
799799
- command: shell.exec
@@ -806,4 +806,4 @@ functions:
806806
- code_snippets_reset
807807
- task_name
808808
script: |
809-
./scripts/code_snippets/${task_name}_test.sh
809+
./scripts/code_snippets/tests/${task_name}

.evergreen-snippets.yml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
variables:
2+
- &setup_and_teardown_group_gke_code_snippets
3+
setup_task_can_fail_task: true
4+
setup_group:
5+
- func: clone
6+
- func: setup_gcloud_cli
7+
- func: setup_mongosh
8+
- func: download_kube_tools
9+
- func: build_multi_cluster_binary
10+
teardown_group:
11+
- func: upload_code_snippets_logs
12+
13+
- &setup_and_teardown_group_kind_code_snippets
14+
setup_task_can_fail_task: true
15+
setup_group:
16+
- func: clone
17+
- func: cleanup_exec_environment
18+
- func: download_kube_tools
19+
- func: configure_docker_auth
20+
- func: setup_kubernetes_environment
21+
- func: setup_cloud_qa
22+
teardown_task:
23+
- func: upload_e2e_logs
24+
- func: upload_code_snippets_logs
25+
- func: teardown_kubernetes_environment
26+
- func: teardown_cloud_qa
27+
28+
# This variable is copied over from .evergreen.yml because anchors don't work for included files
29+
- &base_om8_dependency
30+
depends_on:
31+
- name: build_om_images
32+
variant: build_om80_images
33+
- name: build_operator_ubi
34+
variant: init_test_run
35+
- name: build_init_database_image_ubi
36+
variant: init_test_run
37+
- name: build_database_image_ubi
38+
variant: init_test_run
39+
- name: build_test_image
40+
variant: init_test_run
41+
- name: build_init_appdb_images_ubi
42+
variant: init_test_run
43+
- name: build_init_om_images_ubi
44+
variant: init_test_run
45+
- name: build_agent_images_ubi
46+
variant: init_test_run
47+
48+
tasks:
49+
# Code snippets tasks
50+
# Each scripts/code_snippets/tests/test_*.sh should have its task defined here.
51+
# TODO: it should be autogenerated
52+
# Each task executes test_code_snippets functon executes scripts/code_snippets/tests/${task_name} by task name convention
53+
- name: test_gke_multi_cluster_snippets.sh
54+
tags: [ "code_snippets" ]
55+
commands:
56+
- func: test_code_snippets
57+
- func: sample_commit_output
58+
59+
- name: test_gke_multi_cluster_no_mesh_snippets.sh
60+
tags: [ "code_snippets" ]
61+
commands:
62+
- func: test_code_snippets
63+
- func: sample_commit_output
64+
65+
- name: test_kind_search_community_snippets.sh
66+
tags: [ "code_snippets", "patch-run" ]
67+
commands:
68+
- func: test_code_snippets
69+
- func: sample_commit_output
70+
71+
- name: test_kind_search_enterprise_snippets.sh
72+
tags: [ "code_snippets", "patch-run" ]
73+
commands:
74+
- func: test_code_snippets
75+
- func: sample_commit_output
76+
77+
task_groups:
78+
- name: gke_code_snippets_task_group
79+
<<: *setup_and_teardown_group_gke_code_snippets
80+
max_hosts: -1
81+
tasks:
82+
- test_gke_multi_cluster_snippets.sh
83+
- test_gke_multi_cluster_no_mesh_snippets.sh
84+
85+
- name: kind_code_snippets_task_group
86+
<<: *setup_and_teardown_group_kind_code_snippets
87+
max_hosts: -1
88+
tasks:
89+
- test_kind_search_community_snippets.sh
90+
- test_kind_search_enterprise_snippets.sh
91+
92+
buildvariants:
93+
# These variants are used to test the code snippets and each one can be used in patches
94+
# Prerelease is especially used when the repo is tagged
95+
# More details in the TD: https://docs.google.com/document/d/1fuTxfRtP8QPtn7sKYxQM_AGcD6xycTZH8svngGxyKhc/edit?tab=t.0#bookmark=id.e8uva0393mbe
96+
- name: public_gke_code_snippets
97+
display_name: public_gke_code_snippets
98+
allowed_requesters: [ "patch" ]
99+
run_on:
100+
- ubuntu2204-small
101+
tasks:
102+
- name: gke_code_snippets_task_group
103+
104+
- name: prerelease_gke_code_snippets
105+
display_name: prerelease_gke_code_snippets
106+
tags: [ "release" ]
107+
allowed_requesters: [ "patch", "github_tag" ]
108+
depends_on:
109+
- variant: release_images
110+
name: '*'
111+
patch_optional: true
112+
run_on:
113+
- ubuntu2204-small
114+
tasks:
115+
- name: gke_code_snippets_task_group
116+
117+
- name: private_gke_code_snippets
118+
display_name: private_gke_code_snippets
119+
allowed_requesters: [ "patch" ]
120+
run_on:
121+
- ubuntu2204-small
122+
<<: *base_om8_dependency
123+
tasks:
124+
- name: gke_code_snippets_task_group
125+
126+
- name: private_kind_code_snippets
127+
display_name: private_kind_code_snippets
128+
tags: [ "e2e_test_suite" ]
129+
allowed_requesters: [ "patch", "github_pr" ]
130+
run_on:
131+
- ubuntu2204-large
132+
<<: *base_om8_dependency
133+
tasks:
134+
- name: kind_code_snippets_task_group
135+
136+
- name: prerelease_kind_code_snippets
137+
display_name: prerelease_kind_code_snippets
138+
allowed_requesters: [ "patch" ]
139+
run_on:
140+
- ubuntu2204-large
141+
tasks:
142+
- name: kind_code_snippets_task_group
143+
144+
- name: public_kind_code_snippets
145+
display_name: public_kind_code_snippets
146+
allowed_requesters: [ "patch" ]
147+
run_on:
148+
- ubuntu2204-large
149+
tasks:
150+
- name: kind_code_snippets_task_group

.evergreen-tasks.yml

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -70,32 +70,6 @@ tasks:
7070
vars:
7171
image_name: ops-manager
7272

73-
# Code snippets tasks
74-
# Each task is selected by convention by running scripts/code_snippets/${task_name}_test.sh
75-
- name: task_gke_multi_cluster_snippets
76-
tags: [ "code_snippets" ]
77-
commands:
78-
- func: test_code_snippets
79-
- func: sample_commit_output
80-
81-
- name: task_gke_multi_cluster_no_mesh_snippets
82-
tags: [ "code_snippets" ]
83-
commands:
84-
- func: test_code_snippets
85-
- func: sample_commit_output
86-
87-
- name: task_kind_search_community_snippets
88-
tags: [ "code_snippets", "patch-run" ]
89-
commands:
90-
- func: test_code_snippets
91-
- func: sample_commit_output
92-
93-
- name: task_kind_search_enterprise_snippets
94-
tags: [ "code_snippets", "patch-run" ]
95-
commands:
96-
- func: test_code_snippets
97-
- func: sample_commit_output
98-
9973
## Below are only e2e runs for .evergreen.yml ##
10074

10175
- name: e2e_multiple_cluster_failures

.evergreen.yml

Lines changed: 2 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ include:
55
- filename: .evergreen-functions.yml
66
- filename: .evergreen-tasks.yml
77
- filename: .evergreen-mco.yml
8+
- filename: .evergreen-snippets.yml
89

910
variables:
1011
- &ops_manager_60_latest 6.0.27 # The order/index is important, since these are anchors. Please do not change
@@ -79,32 +80,6 @@ variables:
7980
- func: setup_building_host
8081
- func: build_multi_cluster_binary
8182

82-
- &setup_and_teardown_group_gke_code_snippets
83-
setup_task_can_fail_task: true
84-
setup_group:
85-
- func: clone
86-
- func: setup_gcloud_cli
87-
- func: setup_mongosh
88-
- func: download_kube_tools
89-
- func: build_multi_cluster_binary
90-
teardown_group:
91-
- func: upload_code_snippets_logs
92-
93-
- &setup_and_teardown_group_kind_code_snippets
94-
setup_task_can_fail_task: true
95-
setup_group:
96-
- func: clone
97-
- func: cleanup_exec_environment
98-
- func: download_kube_tools
99-
- func: configure_docker_auth
100-
- func: setup_kubernetes_environment
101-
- func: setup_cloud_qa
102-
teardown_task:
103-
- func: upload_e2e_logs
104-
- func: upload_code_snippets_logs
105-
- func: teardown_kubernetes_environment
106-
- func: teardown_cloud_qa
107-
10883
- &setup_and_teardown_task_cloudqa
10984
setup_task_can_fail_task: true
11085
setup_task:
@@ -168,6 +143,7 @@ variables:
168143
- name: build_init_om_images_ubi
169144
variant: init_test_run
170145

146+
# Any change to base_om8_dependency should be reflected to its copy in .evergreen-snippets.yml
171147
- &base_om8_dependency
172148
depends_on:
173149
- name: build_om_images
@@ -627,20 +603,6 @@ task_groups:
627603
- unit_tests_python
628604
- sbom_tests
629605

630-
- name: gke_code_snippets_task_group
631-
<<: *setup_and_teardown_group_gke_code_snippets
632-
max_hosts: -1
633-
tasks:
634-
- task_gke_multi_cluster_snippets
635-
- task_gke_multi_cluster_no_mesh_snippets
636-
637-
- name: kind_code_snippets_task_group
638-
<<: *setup_and_teardown_group_kind_code_snippets
639-
max_hosts: -1
640-
tasks:
641-
- task_kind_search_community_snippets
642-
- task_kind_search_enterprise_snippets
643-
644606
# Task group for deploying mongodbcommunity resources and testing the (former) MCO
645607
- name: e2e_mdb_community_task_group
646608
max_hosts: -1
@@ -1802,65 +1764,6 @@ buildvariants:
18021764
tasks:
18031765
- name: release_all_agents_on_ecr
18041766

1805-
# These variants are used to test the code snippets and each one can be used in patches
1806-
# Prerelease is especially used when the repo is tagged
1807-
# More details in the TD: https://docs.google.com/document/d/1fuTxfRtP8QPtn7sKYxQM_AGcD6xycTZH8svngGxyKhc/edit?tab=t.0#bookmark=id.e8uva0393mbe
1808-
- name: public_gke_code_snippets
1809-
display_name: public_gke_code_snippets
1810-
allowed_requesters: ["patch"]
1811-
run_on:
1812-
- ubuntu2204-small
1813-
tasks:
1814-
- name: gke_code_snippets_task_group
1815-
1816-
- name: prerelease_gke_code_snippets
1817-
display_name: prerelease_gke_code_snippets
1818-
tags: [ "release" ]
1819-
allowed_requesters: ["patch", "github_tag"]
1820-
depends_on:
1821-
- variant: release_images
1822-
name: '*'
1823-
patch_optional: true
1824-
run_on:
1825-
- ubuntu2204-small
1826-
tasks:
1827-
- name: gke_code_snippets_task_group
1828-
1829-
- name: private_gke_code_snippets
1830-
display_name: private_gke_code_snippets
1831-
allowed_requesters: ["patch"]
1832-
run_on:
1833-
- ubuntu2204-small
1834-
<<: *base_om8_dependency
1835-
tasks:
1836-
- name: gke_code_snippets_task_group
1837-
1838-
- name: private_kind_code_snippets
1839-
display_name: private_kind_code_snippets
1840-
tags: [ "e2e_test_suite" ]
1841-
allowed_requesters: ["patch", "github_pr"]
1842-
run_on:
1843-
- ubuntu2204-large
1844-
<<: *base_om8_dependency
1845-
tasks:
1846-
- name: kind_code_snippets_task_group
1847-
1848-
- name: prerelease_kind_code_snippets
1849-
display_name: prerelease_kind_code_snippets
1850-
allowed_requesters: ["patch"]
1851-
run_on:
1852-
- ubuntu2204-large
1853-
tasks:
1854-
- name: kind_code_snippets_task_group
1855-
1856-
- name: public_kind_code_snippets
1857-
display_name: public_kind_code_snippets
1858-
allowed_requesters: ["patch"]
1859-
run_on:
1860-
- ubuntu2204-large
1861-
tasks:
1862-
- name: kind_code_snippets_task_group
1863-
18641767
### Build variants for manual patch only
18651768

18661769
- name: backup_csv_images

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,5 @@ docs/**/test.sh.run.log
9191

9292
# goreleaser generated files
9393
dist
94+
logs
95+
*.run.log

0 commit comments

Comments
 (0)