Skip to content

Commit

Permalink
Add nightly workflows for goth tests (#363) (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmazurek authored May 17, 2021
1 parent c4d341e commit 74abe12
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 5 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/goth-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Goth nightly

on:
schedule:
# run this workflow every day at 1:00 AM UTC
- cron: '0 1 * * *'

jobs:
goth-tests:
name: Run integration tests (stable)
runs-on: goth
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: 'b0.5'

- name: Configure python
uses: actions/setup-python@v2
with:
python-version: '3.8.0'

- name: Configure poetry
uses: Gr1N/setup-poetry@v4
with:
poetry-version: 1.1.6

- name: Install dependencies
run: |
poetry env use python3.8
poetry install -E integration-tests
- name: Disconnect Docker containers from default network
continue-on-error: true
run: |
docker network inspect docker_default
sudo apt-get install -y jq
docker network inspect docker_default | jq ".[0].Containers | map(.Name)[]" | tee /dev/stderr | xargs --max-args 1 -- docker network disconnect -f docker_default
- name: Remove Docker containers
continue-on-error: true
run: docker rm -f $(docker ps -a -q)

- name: Log in to GitHub Docker repository
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login docker.pkg.github.com -u ${{github.actor}} --password-stdin

- name: Run test suite
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
poetry run poe goth-assets
poetry run poe goth-tests
- name: Upload test logs
uses: actions/upload-artifact@v2
if: always()
with:
name: goth-logs
path: /tmp/goth-tests

# Only relevant for self-hosted runners
- name: Remove test logs
if: always()
run: rm -rf /tmp/goth-tests

# Only relevant for self-hosted runners
- name: Remove poetry virtual env
if: always()
# Python version below should agree with the version set up by this job.
# In future we'll be able to use the `--all` flag here to remove envs for
# all Python versions (https://github.com/python-poetry/poetry/issues/3208).
run: poetry env remove python3.8
5 changes: 4 additions & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
branches:
- master
- b0.*
schedule:
# run this workflow every day at 1:30 AM UTC
- cron: '30 1 * * *'

jobs:

Expand All @@ -28,7 +31,7 @@ jobs:
- name: Configure poetry
uses: Gr1N/setup-poetry@v4
with:
poetry-version: 1.1.4
poetry-version: 1.1.6

- name: Install dependencies
run: |
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ integration-tests = ['goth', 'pytest', 'pytest-asyncio']

[tool.poetry.dev-dependencies]
black = "^20.8b1"
pytest = "^5.4.3"
pytest = "^6.2"
portray = "^1"
pytest-asyncio = "^0.12.0"
pytest-asyncio = "^0.14"
mypy = "^0.782"
liccheck = "^0.4.7"
poethepoet = "^0.8.0"
pytest-cov = "^2.10.1"
pytest-cov = "^2.11"
pydoc-markdown = "^3.5.0"
factory-boy = "^3.2.0"

Expand Down Expand Up @@ -105,7 +105,7 @@ ya-market = "0.1.0"
[tool.poe.tasks]
test = "pytest --cov=yapapi --ignore tests/goth"
goth-assets = "python -m goth create-assets tests/goth/assets"
goth-tests = "pytest -svx tests/goth --config-override docker-compose.build-environment.release-tag=0.6."
goth-tests = "pytest -svx tests/goth"
typecheck = "mypy ."
codestyle = "black --check --diff ."
_liccheck_export = "poetry export -E cli -f requirements.txt -o .requirements.txt"
Expand Down

0 comments on commit 74abe12

Please sign in to comment.