Skip to content

Commit

Permalink
ci: improve QA with cram based tests
Browse files Browse the repository at this point in the history
Currently we've broken master container but we're not aware about it as
current tests are very lame, so lets improve it a bit with some more
reliable, extensible solution.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
  • Loading branch information
ynezz committed Dec 22, 2023
1 parent ba9021e commit f94c6dd
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ jobs:
run: |
docker run --detach ${{ matrix.container_test_command }} --name test-${{ matrix.container_flavor }} local/${{ matrix.container_flavor }}
sleep 5
docker logs test-${{ matrix.container_flavor }} | tee ${{ matrix.container_flavor }}.log
grep "${{ matrix.container_verify_string }}" ${{ matrix.container_flavor }}.log
pip install cram
cram --verbose "tests/cram/${{ matrix.container_flavor }}"
deploy:
name: Push Container
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ phase[12]/twistd.*
!.github/**/*
!requirements-dev.txt
!.ruff.toml
!tests
!tests/**/*
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cram==0.7
black==23.3.0
ruff==0.0.267
7 changes: 7 additions & 0 deletions tests/cram/master/01-logs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Check that logs have expected content after container startup:

$ docker logs test-master
updating existing installation
creating /master/master.cfg.sample
creating database (sqlite:///state.sqlite)
buildmaster configured in /master
10 changes: 10 additions & 0 deletions tests/cram/worker/01-logs.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Check that logs have expected content after container startup:

$ docker logs test-worker
updating existing installation
mkdir /builder/info
Creating info/admin, you need to edit it appropriately.
Creating info/host, you need to edit it appropriately.
Not creating info/access_uri - add it if you wish
Please edit the files in /builder/info appropriately.
worker configured in /builder

0 comments on commit f94c6dd

Please sign in to comment.