Skip to content

Commit

Permalink
ci: More docker test
Browse files Browse the repository at this point in the history
  • Loading branch information
garberg committed Jun 14, 2024
1 parent 0bae9b5 commit 9c903e3
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,36 @@ jobs:
tags: ${{ env.WWW_CI_TAG }}
push: false

- name: "Run Docker test suite"
- name: "Setup Docker test"
run: |
# Set up database
# Install dependencies
sudo apt install -y \
python3-nose \
python3-requests \
postgresql-14-ip4r
# Set up PostgreSQL
sudo service postgresql start
pg_isready
sudo su -c "cd nipap/sql; PGPASSWORD=papin make install" postgres
# Start nipapd container
docker run --network=host --rm -d --name=nipapd_ci -e DB_HOST=127.0.0.1 -e DB_USERNAME=nipap -e DB_PASSWORD=papin ${{ env.NIPAPD_CI_TAG }}
sleep 5
docker logs nipapd_ci
# Set up for test
sudo mkdir -p /etc/nipap
sudo docker cp nipap_ci:/etc/nipap/nipap.conf /etc/nipap/
docker exec -it nipap_ci nipap-passwd add -u unittest -p gottatest -n unittest
docker exec -it nipap_ci nipap-passwd add -u readonly -p gottatest --readonly -n "Read-only user for running unit tests"
- name: "Run docker tests"
run: |
# Run tests
nosetests3 tests/test_xmlrpc.py
nosetests3 tests/nipaptest.py
nosetests3 tests/test_cli.py
nosetests3 tests/test_nipap_ro.py
nosetests3 tests/test_rest.py

0 comments on commit 9c903e3

Please sign in to comment.