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 <[email protected]>
  • Loading branch information
ynezz committed Dec 22, 2023
1 parent 6b1cf25 commit 050deea
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ 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
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 050deea

Please sign in to comment.