Skip to content

Commit

Permalink
test: Refactor test cases (#119)
Browse files Browse the repository at this point in the history
Refactor testcases to
- Use python3.12
- Respect docker architecture
- Run different architecture in parallel GitHub actions
  • Loading branch information
roger-zhangg authored Apr 19, 2024
1 parent 4c2c20d commit fe11d78
Show file tree
Hide file tree
Showing 4 changed files with 211 additions and 149 deletions.
38 changes: 33 additions & 5 deletions .github/workflows/integ-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,44 @@ on:
- develop

jobs:
integ-tests:
go-tests:
runs-on: ubuntu-latest
environment:
name: prod
name: integ-tests
steps:
- uses: actions/checkout@v4
- name: run go tests
run: make tests-with-docker
integ-tests-x86:
runs-on: ubuntu-latest
environment:
name: integ-tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: run integration tests
run: make integ-tests-with-docker-x86-64
integ-tests-arm64:
runs-on: ubuntu-latest
environment:
name: integ-tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: run integration tests
run: make integ-tests-with-docker-arm64
integ-tests-old:
runs-on: ubuntu-latest
environment:
name: integ-tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: allows us to build arm64 images
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- name: run integration tests
run: make integ-tests-with-docker
run: make integ-tests-with-docker-old
30 changes: 28 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,35 @@ integ-tests-and-compile: tests
integ-tests-with-docker: tests-with-docker
make compile-with-docker-all
make integ-tests
integ-tests:

prep-python:
python3 -m venv .venv
.venv/bin/pip install --upgrade pip
.venv/bin/pip install requests parameterized

exec-python-e2e-test:
.venv/bin/python3 test/integration/local_lambda/test_end_to_end.py

integ-tests:
make prep-python
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
make TEST_ARCH=x86_64 TEST_PORT=8002 exec-python-e2e-test
make TEST_ARCH=arm64 TEST_PORT=9002 exec-python-e2e-test
make TEST_ARCH="" TEST_PORT=9052 exec-python-e2e-test

integ-tests-with-docker-x86-64:
make ARCH=x86_64 compile-with-docker
make prep-python
make TEST_ARCH=x86_64 TEST_PORT=8002 exec-python-e2e-test

integ-tests-with-docker-arm64:
make ARCH=arm64 compile-with-docker
make prep-python
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
make TEST_ARCH=arm64 TEST_PORT=9002 exec-python-e2e-test

integ-tests-with-docker-old:
make ARCH=old compile-with-docker
make prep-python
make TEST_ARCH="" TEST_PORT=9052 exec-python-e2e-test

Loading

0 comments on commit fe11d78

Please sign in to comment.