Run zenko tests out of cluster#2336
Run zenko tests out of cluster#2336SylvainSenechal wants to merge 6 commits intodevelopment/2.14from
Conversation
Hello sylvainsenechal,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
d6a0f4c to
245e27d
Compare
77b703d to
8d5ede4
Compare
8d5ede4 to
18c02d8
Compare
… out of cluster Issue: ZENKO-5201
18c02d8 to
733afdf
Compare
| ) | ||
| done | ||
|
|
||
| ( |
There was a problem hiding this comment.
No need for this anymore as we don't need the container, and config is handled differently
| working-directory: ./.github/scripts/end2end | ||
| - name: Linting | ||
| shell: bash | ||
| run: bash run-e2e-test.sh "end2end" ${E2E_IMAGE_NAME}:${E2E_IMAGE_TAG} "lint" "default" |
There was a problem hiding this comment.
No need to do the linting in the deploy action..
- this deploy action is run multiple times in the ci
- it was building an image, taking time, all that just for linting
Now you will see later in end2end.yaml there is a simple yarn run lint
| DIR=$(dirname "$0") | ||
|
|
||
| # Set up ingress endpoints and /etc/hosts for out-of-cluster access | ||
| source "$DIR/configure-e2e-endpoints.sh" |
There was a problem hiding this comment.
This setup will be common to ctst and end2end tests.
Hopefully we will soon be able to have a common setup for both type of tests, to avoid having to go from configure-ctst to configure e2e, with many things that are common
| @@ -0,0 +1,139 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
This should be idempotent. I used it multiple times in Codespace without issues
|
|
||
| SERVICE_ACCOUNT="${ZENKO_NAME}-config" | ||
| POD_NAME="${ZENKO_NAME}-config" | ||
| MANAGEMENT_ENDPOINT="http://${ZENKO_NAME}-management-orbit-api:5001" |
There was a problem hiding this comment.
This is the kind of things that we have to change now that the test doesn't run in a pod within the Zenko cluster
| pip3 install --break-system-packages -r "$ZENKO_TESTS_DIR/requirements.txt" | ||
|
|
||
| cd "$ZENKO_TESTS_DIR" | ||
|
|
||
| envsubst < e2e-config.yaml.template > e2e-config.yaml |
There was a problem hiding this comment.
This used to be setup in the Dockerfile that I deleted
| @@ -0,0 +1,130 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
I came up with this to deal with the env variables.
It's a bit tricky as I wanted it to work for both github ci and codespace
Variables setup here are pretty much the same as the ones that were setup in the (now deleted) run-e2e-test.sh file
| - name: Deploy second Zenko for PRA | ||
| run: bash deploy-zenko.sh end2end-pra default './configs/zenko.yaml' | ||
| env: | ||
| ZENKO_MONGODB_DATABASE: pradb |
There was a problem hiding this comment.
setup in prepare-pra.sh directly
| cache-from: type=gha,scope=kafka-connect-${{ env.KAFKA_CONNECT_TAG }} | ||
| cache-to: type=gha,mode=max,scope=kafka-connect-${{ env.KAFKA_CONNECT_TAG }} | ||
|
|
||
| build-test-image: |
There was a problem hiding this comment.
No more image, just a new lint step as I removed it from the deploy action
| working-directory: ./.github/scripts/end2end | ||
| run: | | ||
| source .github/scripts/end2end/setup-e2e-env.sh | ||
| yarn run test_operator |
There was a problem hiding this comment.
I prefer this, simple, direct use of yarn commands instead of going through scripts with FOUR arguments 🧐
I just don't really like having to source the env var for each run so if you have suggestion I'm open
There was a problem hiding this comment.
you can instead add a first step which updates the env for followup steps
| RoleSessionName='end2end', | ||
| WebIdentityToken=token, | ||
| DurationSeconds=60 * 60 * 12, # 12 hrs | ||
| DurationSeconds=60 * 60 * 12, # 12 hrs (max allowed by STS for assume role) |
There was a problem hiding this comment.
I wanna keep this comment, I tried to use 30 days because in my codespace it was expiring after 12h, but when I used 30 days it broke because the api only accepts 12h
| "mocha": "^10.0.0", | ||
| "mocha-junit-reporter": "^2.2.1", | ||
| "mocha-multi-reporters": "^1.1.7", | ||
| "mocha-tags": "^1.0.1", |
There was a problem hiding this comment.
- Never used,
- Could be useful in theory,
- Will never be used in practice, so just add again if needed (will never be needed 🌚 )
| "test_operator": "mocha --exit -t 10000 --reporter mocha-multi-reporters --reporter-options configFile=config.json,cmrOutput=mocha-junit-reporter+testsuitesTitle+test_operator ./init_test.js", | ||
| "test_smoke": "mocha --exit -t 10000 --reporter mocha-multi-reporters --reporter-options configFile=config.json,cmrOutput=mocha-junit-reporter+testsuitesTitle+test_smoke --recursive smoke_tests", | ||
| "test_iam_policies": "mocha --exit -t 15000 --reporter mocha-multi-reporters --reporter-options configFile=config.json,cmrOutput=mocha-junit-reporter+testsuitesTitle+test_iam_policies --recursive iam_policies", | ||
| "test_all_extensions": "run-p --aggregate-output test_crr test_aws_crr test_expiration test_transition test_ingestion_oob_s3c", |
There was a problem hiding this comment.
Btw, I just had a look at end2end-sharded. The step "Run backbeat end to end tests", which is running test_all_extensions, now runs within ~12 min, against ~28min before.
I had to double check, as I thought some tests were simply not run, but we run the same tests. I think previously the parallel run was not working, maybe because of some weird stuff happening when this command is run in a pod, the pod can't run stuff in parallel or something.
There was a problem hiding this comment.
it seems this step perform a yarn install: by having it running directly in the runner, it will now be cached (automatically!) by setup-node, and would thus be much faster?
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
| else | ||
| trap "kill ${_MONGO_PF_PID} 2>/dev/null || true" EXIT | ||
| fi | ||
| sleep 2 |
| if [[ "${BASH_SOURCE[0]:-}" != "${0}" ]]; then | ||
| # Sourced — register cleanup only if not already registered | ||
| if [ -z "${_SETUP_E2E_CLEANUP_SET:-}" ]; then | ||
| trap "kill ${_MONGO_PF_PID} 2>/dev/null || true" EXIT | ||
| export _SETUP_E2E_CLEANUP_SET=1 | ||
| fi | ||
| else | ||
| trap "kill ${_MONGO_PF_PID} 2>/dev/null || true" EXIT |
There was a problem hiding this comment.
| if [[ "${BASH_SOURCE[0]:-}" != "${0}" ]]; then | |
| # Sourced — register cleanup only if not already registered | |
| if [ -z "${_SETUP_E2E_CLEANUP_SET:-}" ]; then | |
| trap "kill ${_MONGO_PF_PID} 2>/dev/null || true" EXIT | |
| export _SETUP_E2E_CLEANUP_SET=1 | |
| fi | |
| else | |
| trap "kill ${_MONGO_PF_PID} 2>/dev/null || true" EXIT | |
| if [[ "${BASH_SOURCE[0]:-}" == "${0}" ]]; then | |
| trap "kill ${_MONGO_PF_PID} 2>/dev/null || true" EXIT | |
| elif [ -z "${_SETUP_E2E_CLEANUP_SET:-}" ]; then | |
| # Sourced — register cleanup only if not already registered | |
| trap "kill ${_MONGO_PF_PID} 2>/dev/null || true" EXIT | |
| export _SETUP_E2E_CLEANUP_SET=1 | |
| fi |
| ! lsof -i ":${MONGO_PORT}" &>/dev/null; then | ||
| kubectl port-forward -n "${MONGO_NS}" "svc/${MONGO_SVC}" "${MONGO_PORT}:${MONGO_PORT}" & | ||
| _MONGO_PF_PID=$! | ||
| # Clean up on exit only if we started it (not when sourced for interactive use) |
There was a problem hiding this comment.
comment is not correct anymore, seems we now always kill mongo? (i.e. except I already registered)
so ust handling the "double registration" should be enough:
if [ -z "${_SETUP_E2E_CLEANUP_SET:-}" ]; then
trap "kill ${_MONGO_PF_PID} 2>/dev/null || true" EXIT
export _SETUP_E2E_CLEANUP_SET=1
fi
| # Auto-source in future Codespace terminals | ||
| echo '[ -f "$HOME/.zenko.env" ] && source "$HOME/.zenko.env"' >> "$HOME/.bashrc" |
There was a problem hiding this comment.
should probably be added to the devcontariner's Dockerfile instead
Issue: ZENKO-5201