From 7a9b59ef2ed6125032a58d1fd1d41e703be2044f Mon Sep 17 00:00:00 2001 From: General Kroll Date: Wed, 27 May 2026 07:28:49 +1000 Subject: [PATCH] testing-materials-assembly Summary: - Run traffic lights integration tests *prior* to host file and mocked hosts routing. - This prevents mocks from being engaged, and therefore fixes: - Robot tests `Run traffic light robot integration tests`. - Robot tests `Run foreign traffic light robot integration tests`. --- .github/workflows/build.yml | 56 +++++++++++++++++++++---------------- test/robot/README.md | 10 ++++++- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a04af9a8..abff2bba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -661,29 +661,6 @@ jobs: echo "BUILDMINORVERSION=${BUILDMINORVERSION}" echo "BUILDPATCHVERSION=${BUILDPATCHVERSION}" } >> "${GITHUB_ENV}" - - if [ "${{ matrix.registry }}" = "test/registry" ]; then - python3 test/python/stackql_test_tooling/tcp_lb.py --generate-hosts-entries | sudo tee -a /etc/hosts - python3 test/python/stackql_test_tooling/tcp_lb.py --generate-nginx-lb > test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf - fi - - - - name: Install testing dependencies - run: | - sudo apt-get update - sudo apt-get install --yes --no-install-recommends postgresql-client - if [ "${{ matrix.registry }}" = "test/registry" ]; then - sudo apt-get install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring - curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \ - | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null - gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg - echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \ - http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" \ - | sudo tee /etc/apt/sources.list.d/nginx.list - sudo apt-get update - sudo apt-get install nginx - sudo nginx -c "$(pwd)/test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf" - fi - name: Install Python dependencies run: | @@ -751,7 +728,7 @@ jobs: PYTHONPATH: '${{ env.PYTHONPATH }}:${{ github.workspace }}/test/python' AZURE_CLIENT_ID: ${{ secrets.AZURE_FOREIGN_CLIENT_ID }} AZURE_CLIENT_SECRET: ${{ secrets.AZURE_FOREIGN_CLIENT_SECRET }} - AZURE_INTEGRATION_TESTING_SUB_ID: ${{ secrets.AZURE_INTEGRATION_TESTING_SUB_ID }} + AZURE_TARGET_SUBSCRIPTION_ID: ${{ secrets.AZURE_INTEGRATION_TESTING_SUB_ID }} AZURE_TENANT_ID: ${{ secrets.AZURE_FOREIGN_TENANT_ID }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_FOREIGN_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_FOREIGN_SECRET_ACCESS_KEY }} @@ -782,6 +759,37 @@ jobs: run: | cat ./test/robot/foreign-integration-traffic-lights/tmp/* || true + - name: Generate hosts file and nginx materials + env: + BUILDCOMMITSHA: ${{github.sha}} + BUILDBRANCH: ${{github.ref}} + BUILDPLATFORM: ${{runner.os}} + BUILDPATCHVERSION: ${{github.run_number}} + CGO_ENABLED: 1 + CGO_LDFLAGS: '-static' + run: | + if [ "${{ matrix.registry }}" = "test/registry" ]; then + python3 test/python/stackql_test_tooling/tcp_lb.py --generate-hosts-entries | sudo tee -a /etc/hosts + python3 test/python/stackql_test_tooling/tcp_lb.py --generate-nginx-lb > test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf + fi + + - name: Install testing dependencies + run: | + sudo apt-get update + sudo apt-get install --yes --no-install-recommends postgresql-client + if [ "${{ matrix.registry }}" = "test/registry" ]; then + sudo apt-get install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring + curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \ + | sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null + gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg + echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \ + http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" \ + | sudo tee /etc/apt/sources.list.d/nginx.list + sudo apt-get update + sudo apt-get install nginx + sudo nginx -c "$(pwd)/test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf" + fi + - name: Generate rewritten registry for simulations if: ${{ matrix.registry != 'test/registry' }} run: | diff --git a/test/robot/README.md b/test/robot/README.md index 870d7d43..67173380 100644 --- a/test/robot/README.md +++ b/test/robot/README.md @@ -44,12 +44,20 @@ env PYTHONPATH="$PYTHONPATH:$(pwd)/test/python" robot -d test/robot/integration test/robot/integration ``` +For the vanilla traffic lights, eg (after sourcing requisite env vars): + +```bash +# source cicd/vol/vendor-secrets/secrets.sh + +env PYTHONPATH="$PYTHONPATH:$(pwd)/test/python" robot --outputdir test/robot/reports-integration-traffic-lights test/robot/integration-traffic-lights +``` + In particular, for the foreign auth integration tests, some tests may be unstable in some cloud and CI environments, so you may want to check locally, eg (after sourcing requisite env vars): ```bash # source cicd/vol/vendor-secrets/foreign_to_stackql_user.sh -env PYTHONPATH="$PYTHONPATH:$(pwd)/test/python" robot --outputdir test/robot/reports-integration-traffic-lights test/robot/foreign-integration-traffic-lights +env PYTHONPATH="$PYTHONPATH:$(pwd)/test/python" robot --outputdir test/robot/reports-foreign-integration-traffic-lights test/robot/foreign-integration-traffic-lights ```