Skip to content

Commit 7a9b59e

Browse files
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`.
1 parent 0b2bdc0 commit 7a9b59e

2 files changed

Lines changed: 41 additions & 25 deletions

File tree

.github/workflows/build.yml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -661,29 +661,6 @@ jobs:
661661
echo "BUILDMINORVERSION=${BUILDMINORVERSION}"
662662
echo "BUILDPATCHVERSION=${BUILDPATCHVERSION}"
663663
} >> "${GITHUB_ENV}"
664-
665-
if [ "${{ matrix.registry }}" = "test/registry" ]; then
666-
python3 test/python/stackql_test_tooling/tcp_lb.py --generate-hosts-entries | sudo tee -a /etc/hosts
667-
python3 test/python/stackql_test_tooling/tcp_lb.py --generate-nginx-lb > test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf
668-
fi
669-
670-
671-
- name: Install testing dependencies
672-
run: |
673-
sudo apt-get update
674-
sudo apt-get install --yes --no-install-recommends postgresql-client
675-
if [ "${{ matrix.registry }}" = "test/registry" ]; then
676-
sudo apt-get install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
677-
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
678-
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
679-
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg
680-
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
681-
http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" \
682-
| sudo tee /etc/apt/sources.list.d/nginx.list
683-
sudo apt-get update
684-
sudo apt-get install nginx
685-
sudo nginx -c "$(pwd)/test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf"
686-
fi
687664
688665
- name: Install Python dependencies
689666
run: |
@@ -751,7 +728,7 @@ jobs:
751728
PYTHONPATH: '${{ env.PYTHONPATH }}:${{ github.workspace }}/test/python'
752729
AZURE_CLIENT_ID: ${{ secrets.AZURE_FOREIGN_CLIENT_ID }}
753730
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_FOREIGN_CLIENT_SECRET }}
754-
AZURE_INTEGRATION_TESTING_SUB_ID: ${{ secrets.AZURE_INTEGRATION_TESTING_SUB_ID }}
731+
AZURE_TARGET_SUBSCRIPTION_ID: ${{ secrets.AZURE_INTEGRATION_TESTING_SUB_ID }}
755732
AZURE_TENANT_ID: ${{ secrets.AZURE_FOREIGN_TENANT_ID }}
756733
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_FOREIGN_ACCESS_KEY_ID }}
757734
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_FOREIGN_SECRET_ACCESS_KEY }}
@@ -782,6 +759,37 @@ jobs:
782759
run: |
783760
cat ./test/robot/foreign-integration-traffic-lights/tmp/* || true
784761
762+
- name: Generate hosts file and nginx materials
763+
env:
764+
BUILDCOMMITSHA: ${{github.sha}}
765+
BUILDBRANCH: ${{github.ref}}
766+
BUILDPLATFORM: ${{runner.os}}
767+
BUILDPATCHVERSION: ${{github.run_number}}
768+
CGO_ENABLED: 1
769+
CGO_LDFLAGS: '-static'
770+
run: |
771+
if [ "${{ matrix.registry }}" = "test/registry" ]; then
772+
python3 test/python/stackql_test_tooling/tcp_lb.py --generate-hosts-entries | sudo tee -a /etc/hosts
773+
python3 test/python/stackql_test_tooling/tcp_lb.py --generate-nginx-lb > test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf
774+
fi
775+
776+
- name: Install testing dependencies
777+
run: |
778+
sudo apt-get update
779+
sudo apt-get install --yes --no-install-recommends postgresql-client
780+
if [ "${{ matrix.registry }}" = "test/registry" ]; then
781+
sudo apt-get install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
782+
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor \
783+
| sudo tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
784+
gpg --dry-run --quiet --no-keyring --import --import-options import-show /usr/share/keyrings/nginx-archive-keyring.gpg
785+
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
786+
http://nginx.org/packages/ubuntu $(lsb_release -cs) nginx" \
787+
| sudo tee /etc/apt/sources.list.d/nginx.list
788+
sudo apt-get update
789+
sudo apt-get install nginx
790+
sudo nginx -c "$(pwd)/test/tcp/reverse-proxy/nginx/dynamic-sni-proxy.conf"
791+
fi
792+
785793
- name: Generate rewritten registry for simulations
786794
if: ${{ matrix.registry != 'test/registry' }}
787795
run: |

test/robot/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,20 @@ env PYTHONPATH="$PYTHONPATH:$(pwd)/test/python" robot -d test/robot/integration
4444
test/robot/integration
4545
```
4646

47+
For the vanilla traffic lights, eg (after sourcing requisite env vars):
48+
49+
```bash
50+
# source cicd/vol/vendor-secrets/secrets.sh
51+
52+
env PYTHONPATH="$PYTHONPATH:$(pwd)/test/python" robot --outputdir test/robot/reports-integration-traffic-lights test/robot/integration-traffic-lights
53+
```
54+
4755
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):
4856

4957
```bash
5058
# source cicd/vol/vendor-secrets/foreign_to_stackql_user.sh
5159

52-
env PYTHONPATH="$PYTHONPATH:$(pwd)/test/python" robot --outputdir test/robot/reports-integration-traffic-lights test/robot/foreign-integration-traffic-lights
60+
env PYTHONPATH="$PYTHONPATH:$(pwd)/test/python" robot --outputdir test/robot/reports-foreign-integration-traffic-lights test/robot/foreign-integration-traffic-lights
5361
```
5462

5563

0 commit comments

Comments
 (0)