Skip to content

Commit

Permalink
⚡ CI - Run some tests in parralel (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldemarmiesse authored Feb 12, 2023
1 parent 5a4b792 commit 751e284
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 18 deletions.
62 changes: 44 additions & 18 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Run tests

on: [push, pull_request]

on:
push:
branches:
- master
pull_request: {}

jobs:
build-linux-lint:
Expand All @@ -9,7 +14,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.8'
- name: Run all tests
run: |
cat /etc/docker/daemon.json
Expand All @@ -23,36 +28,57 @@ jobs:
isort --check ./
black --check ./
build-linux-test-with-binaries:
build-linux-test-with-binaries-other-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.7'
- name: Run all tests
run: |
cat /etc/docker/daemon.json
echo '{"insecure-registries" : [ "localhost:5000" ]}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
sleep 2
docker info
pip install -e .
pip install -r ./tests/test-requirements.txt
mkdir -p ~/.docker/cli-plugins/
wget https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64 -O ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
wget https://github.com/docker/buildx/releases/download/v0.10.0/buildx-v0.10.0.linux-amd64 -O ~/.docker/cli-plugins/docker-buildx
chmod +x ~/.docker/cli-plugins/docker-buildx
pytest -v --durations=10 ./tests
bash tests/ci-setup.sh
pytest -v --durations=10 --ignore=tests/python_on_whales/components
build-linux-test-component:
strategy:
matrix:
component:
- buildx
- test_compose.py
- test_config.py
- test_container.py
- test_context.py
- test_image.py
- test_manifest.py
- test_network.py
- test_node.py
- test_plugin.py
- test_service.py
- test_stack.py
- test_swarm.py
- test_system.py
- test_task.py
- test_volume.py
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Run test
run: |
bash tests/ci-setup.sh
pytest -v --durations=10 tests/python_on_whales/components/${{ matrix.component }}
build-linux-test-without-any-binary:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.7'
- name: Run all tests
run: |
cat /etc/docker/daemon.json
Expand Down
15 changes: 15 additions & 0 deletions tests/ci-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
set -ex

cat /etc/docker/daemon.json
echo '{"insecure-registries" : [ "localhost:5000" ]}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
sleep 2
docker info
pip install -e .
pip install -r ./tests/test-requirements.txt

mkdir -p ~/.docker/cli-plugins/
wget -q https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64 -O ~/.docker/cli-plugins/docker-compose
chmod +x ~/.docker/cli-plugins/docker-compose
wget -q https://github.com/docker/buildx/releases/download/v0.10.0/buildx-v0.10.0.linux-amd64 -O ~/.docker/cli-plugins/docker-buildx
chmod +x ~/.docker/cli-plugins/docker-buildx

0 comments on commit 751e284

Please sign in to comment.