Skip to content

Commit 6862ded

Browse files
committed
Merge branch 'mco-merge'
2 parents b550413 + b3273fa commit 6862ded

File tree

378 files changed

+41232
-0
lines changed

Some content is hidden

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

378 files changed

+41232
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Run E2E Fork
2+
jobs:
3+
- template: display-github-context
4+
- template: setup
5+
# dependabot gets a read only github token, and so must use pull_request_target instead of pull_request.
6+
if: contains(github.event.pull_request.labels.*.name, 'dependencies') || contains(github.event.pull_request.labels.*.name, 'safe-to-test')
7+
steps:
8+
- template: cancel-previous
9+
- template: checkout-fork
10+
- template: setup-and-install-python
11+
- template: quay-login
12+
- template: set-up-qemu
13+
- template: build-and-push-development-images
14+
- template: tests
15+
steps:
16+
- template: cancel-previous
17+
- template: checkout-fork
18+
- template: set-run-status
19+
- template: setup-and-install-python
20+
- template: setup-kind-cluster
21+
if: steps.last_run_status.outputs.last_run_status != 'success'
22+
- template: run-test-matrix
23+
- template: save-run-status
24+
- template: dump-and-upload-diagnostics
25+
26+
events:
27+
- template: pull-request-target
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Run E2E
2+
jobs:
3+
- template: display-github-context
4+
- template: setup
5+
# run on master, or if a PR is being created from a branch, or if it has been manually triggered.
6+
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/master' || (github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]')
7+
steps:
8+
- template: cancel-previous
9+
- template: checkout
10+
- template: setup-and-install-python
11+
- template: quay-login
12+
- template: set-up-qemu
13+
- template: build-and-push-development-images
14+
- template: tests
15+
steps:
16+
- template: cancel-previous
17+
- template: checkout
18+
- template: set-run-status
19+
- template: setup-and-install-python
20+
- template: setup-kind-cluster
21+
if: steps.last_run_status.outputs.last_run_status != 'success'
22+
- template: run-test-matrix
23+
- template: save-run-status
24+
- template: dump-and-upload-diagnostics
25+
26+
events:
27+
- template: on-pull-request-master
28+
- template: on-push-master
29+
- template: workflow-dispatch
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Run Single E2E
2+
jobs:
3+
- template: display-github-context
4+
- template: setup
5+
steps:
6+
- template: checkout
7+
- template: setup-and-install-python
8+
- template: quay-login
9+
- template: set-up-qemu
10+
- template: build-and-push-development-images
11+
- template: single-test
12+
steps:
13+
- template: checkout
14+
- template: setup-and-install-python
15+
- template: setup-kind-cluster
16+
- template: run-test-single
17+
- template: dump-and-upload-diagnostics-always
18+
19+
events:
20+
- template: single-e2e-workflow-dispatch
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pull_request:
2+
branches:
3+
- master
4+
paths-ignore:
5+
- 'docs/**'
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
push:
2+
branches:
3+
- master
4+
paths-ignore:
5+
- 'docs/**'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# pull_request_target means that the secrets of this repo will be used.
2+
pull_request_target:
3+
types: [labeled]
4+
branches:
5+
- master
6+
paths-ignore:
7+
- 'docs/**'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
workflow_dispatch:
2+
inputs:
3+
distro:
4+
description: 'Distro to run test'
5+
required: true
6+
default: "ubuntu"
7+
test-name:
8+
description: 'Name of test to run'
9+
required: true
10+
cluster-wide:
11+
description: 'Whether or not the test is cluster wide'
12+
required: true
13+
default: "false"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
workflow_dispatch: {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
action-context:
2+
if: always()
3+
runs-on: ubuntu-latest
4+
steps:
5+
- name: Dump GitHub context
6+
env:
7+
GITHUB_CONTEXT: ${{ toJSON(github) }}
8+
run: echo "$GITHUB_CONTEXT"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
setup:
2+
runs-on: ubuntu-latest
3+
strategy:
4+
fail-fast: false
5+
matrix:
6+
include:
7+
- pipeline-argument: operator
8+
- pipeline-argument: version-upgrade-hook
9+
- pipeline-argument: readiness-probe
10+
- pipeline-argument: agent
11+
- pipeline-argument: e2e
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
single-test:
2+
runs-on: ubuntu-latest
3+
needs: [setup]
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
tests:
2+
runs-on: ubuntu-latest
3+
needs: [setup]
4+
strategy:
5+
fail-fast: false
6+
matrix:
7+
include:
8+
- test-name: replica_set
9+
distro: ubi
10+
- test-name: replica_set_enterprise_upgrade_4_5
11+
distro: ubi
12+
- test-name: replica_set_enterprise_upgrade_5_6
13+
distro: ubi
14+
- test-name: replica_set_enterprise_upgrade_6_7
15+
distro: ubi
16+
- test-name: replica_set_enterprise_upgrade_7_8
17+
distro: ubi
18+
- test-name: replica_set_recovery
19+
distro: ubi
20+
- test-name: replica_set_mongod_readiness
21+
distro: ubi
22+
- test-name: replica_set_scale
23+
distro: ubi
24+
- test-name: replica_set_scale_down
25+
distro: ubi
26+
- test-name: replica_set_change_version
27+
distro: ubi
28+
- test-name: feature_compatibility_version
29+
distro: ubi
30+
- test-name: prometheus
31+
distro: ubi
32+
- test-name: replica_set_tls
33+
distro: ubi
34+
- test-name: replica_set_tls_recreate_mdbc
35+
distro: ubi
36+
- test-name: replica_set_tls_rotate
37+
distro: ubi
38+
- test-name: replica_set_tls_rotate_delete_sts
39+
distro: ubi
40+
- test-name: replica_set_tls_upgrade
41+
distro: ubi
42+
- test-name: statefulset_arbitrary_config
43+
distro: ubi
44+
- test-name: statefulset_arbitrary_config_update
45+
distro: ubi
46+
- test-name: replica_set_mongod_config
47+
distro: ubi
48+
- test-name: replica_set_cross_namespace_deploy
49+
distro: ubi
50+
cluster-wide: true
51+
- test-name: replica_set_custom_role
52+
distro: ubi
53+
- test-name: replica_set_arbiter
54+
distro: ubi
55+
- test-name: replica_set_custom_persistent_volume
56+
distro: ubi
57+
- test-name: replica_set_mount_connection_string
58+
distro: ubi
59+
- test-name: replica_set_mongod_port_change_with_arbiters
60+
distro: ubi
61+
- test-name: replica_set_operator_upgrade
62+
distro: ubi
63+
- test-name: replica_set_connection_string_options
64+
distro: ubi
65+
- test-name: replica_set_x509
66+
distro: ubi
67+
- test-name: replica_set_remove_user
68+
distro: ubi
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- name: Build and Push Images
2+
run: |
3+
python pipeline.py --image-name ${{ matrix.pipeline-argument }} --tag ${{ github.run_id }}
4+
env:
5+
MONGODB_COMMUNITY_CONFIG: "${{ github.workspace }}/scripts/ci/config.json"
6+
version_id: "${{ github.run_id }}"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: Cancel Previous Runs
2+
uses: styfle/cancel-workflow-action@0.12.1
3+
with:
4+
access_token: ${{ github.token }}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# We checkout the forked repository code.
2+
# Because we are using pull_request_target the Github Secrets will be passed
3+
# So code should be reviewed before labeling as "safe-to-test"
4+
- name: Checkout Code
5+
uses: actions/checkout@v4
6+
with:
7+
ref: ${{github.event.pull_request.head.sha}}
8+
repository: ${{github.event.pull_request.head.repo.full_name}}
9+
submodules: true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- name: Checkout Code
2+
uses: actions/checkout@v4
3+
with:
4+
submodules: true
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- name: Dump Diagnostics
2+
if: always()
3+
continue-on-error: true
4+
run: scripts/ci/dump_diagnostics.sh default # default since kind is running in the default namespace
5+
6+
- name: Upload Diagnostics
7+
if: always()
8+
uses: actions/upload-artifact@v4
9+
continue-on-error: true
10+
with:
11+
name: "${{ github.event.inputs.test-name }}-${{ github.event.inputs.distro }}-diagnostics"
12+
path: "${{ github.workspace }}/diagnostics"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
- name: Dump Diagnostics
2+
id: dump_diagnostics
3+
if: always() && steps.e2e_test.outcome == 'failure'
4+
continue-on-error: true
5+
run: scripts/ci/dump_diagnostics.sh default # default since kind is running in the default namespace
6+
7+
- name: Upload Diagnostics
8+
if: always() && steps.dump_diagnostics.outcome == 'success'
9+
uses: actions/upload-artifact@v4
10+
continue-on-error: true
11+
with:
12+
name: "${{ matrix.test-name }}-${{ matrix.distro }}-diagnostics"
13+
path: "${{ github.workspace }}/diagnostics"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
- name: Login to Quay.io
2+
uses: docker/login-action@v3
3+
with:
4+
registry: quay.io
5+
username: ${{ secrets.QUAY_USERNAME }}
6+
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
- name: Run Test
2+
id: e2e_test
3+
if: steps.last_run_status.outputs.last_run_status != 'success'
4+
run: |
5+
cluster_wide=${{ matrix.cluster-wide }}
6+
if [ -z "$cluster_wide" ]; then
7+
cluster_wide="false"
8+
fi
9+
python3 ./scripts/dev/e2e.py --test ${{ matrix.test-name }} --tag ${{ github.run_id }} --config_file ./scripts/ci/config.json --distro ${{ matrix.distro }} --cluster-wide ${cluster_wide}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- name: Run Test Single
2+
run: |
3+
python3 ./scripts/dev/e2e.py --test ${{ github.event.inputs.test-name }} --tag ${{ github.run_id }} --config_file ./scripts/ci/config.json --distro ${{ github.event.inputs.distro }} --cluster-wide ${{ github.event.inputs.cluster-wide }}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- name: Save run status
2+
if: always()
3+
run: echo "::set-output name=last_run_status::${{ steps.e2e_test.outcome }}" > last_run_status
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- name: Set default run status
2+
run: echo "::set-output name=last_run_status::pending" > last_run_status
3+
4+
# Tracking of the state of the previous test run is a workaround to the fact that it is not
5+
# possible to re-run a single failed job, only re-running the entire workflow is currently possible.
6+
# This workaround skips jobs if they have already passed.
7+
# see https://github.com/actions/runner/issues/432
8+
- name: Restore last run status
9+
id: last_run
10+
uses: actions/cache@v4
11+
with:
12+
path: last_run_status
13+
key: ${{ github.run_id }}-${{ matrix.test-name }}-${{ matrix.distro }}
14+
15+
- name: Set last run status
16+
id: last_run_status
17+
run: cat last_run_status
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- name: Set up QEMU
2+
uses: docker/setup-qemu-action@v3
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- name: Setup Python
2+
uses: actions/setup-python@v5
3+
with:
4+
python-version: '3.10.4'
5+
- name: Cache Dependencies
6+
uses: actions/cache@v4
7+
with:
8+
path: ~/.cache/pip
9+
key: ${{ hashFiles('requirements.txt') }}
10+
- name: Install Python Dependencies
11+
run: pip install -r requirements.txt
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
- name: Setup Kind Cluster
2+
run: |
3+
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
4+
chmod +x ./kind
5+
./kind create cluster
6+
- name: Create Directories
7+
run: |
8+
docker exec kind-control-plane mkdir -p /opt/data/mongo-data-0 /opt/data/mongo-data-1 /opt/data/mongo-data-2 /opt/data/mongo-logs-0 /opt/data/mongo-logs-1 /opt/data/mongo-logs-2
9+
10+
- name: Install CRD
11+
run: kubectl apply -f config/crd/bases/mongodbcommunity.mongodb.com_mongodbcommunity.yaml
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.github
2+
.idea
3+
zz_*
4+
vendor/
5+
scripts/
6+
.git/
7+
bin/
8+
testbin/
9+
.mypy_cache/
10+
main
11+
__debug_bin
12+
# allow agent LICENSE
13+
!scripts/dev/templates/agent/LICENSE
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @mircea-cosbuc @lsierant @nammn @Julien-Ben @MaciejKaras @lucian-tosa @fealebenpae @m1kola

0 commit comments

Comments
 (0)