Fixing linter errors. #38
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test-docker-image | |
on: | |
[ push, pull_request ] | |
permissions: | |
contents: read | |
packages: write | |
issues: write | |
pull-requests: write | |
jobs: | |
test-docker-image: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Build test environment | |
working-directory: docker/tests | |
run: | | |
docker compose build | |
- name: Run containers | |
working-directory: docker/tests | |
run: | | |
docker compose up -d | |
- name: Run CLI tests | |
working-directory: docker/tests | |
run: | | |
# test adding a subscription | |
docker exec subscriber wis2downloader add-subscription --topic cache/a/wis2/+/services/# | |
# test listing subscriptions | |
docker exec subscriber wis2downloader list-subscriptions | |
# publish a test message | |
docker exec publisher pywis-pubsub publish --topic cache/a/wis2/my-centre/services/downloader \ | |
--config /pywis-pubsub/config/config.yml \ | |
-i test -u "http://subscriber:5000/openapi" | |
sleep 1s | |
# cat file contents (check the published file has been downloaded) | |
cat ./data/downloads/$(date +"%Y")/$(date +"%m")/$(date +"%d")/cache/a/wis2/my-centre/services/downloader/openapi.bin | |
# test deleting subscriptions | |
docker exec subscriber wis2downloader remove-subscription --topic cache/a/wis2/+/services/# | |
- name: Run API tests | |
working-directory: docker/tests | |
run: | | |
# get metrics | |
curl http://localhost:5000/metrics | |
# test adding a subscription | |
curl -X 'POST' \ | |
'http://localhost:5000/subscriptions' \ | |
-H 'accept: application/json' \ | |
-H 'Content-Type: application/json' \ | |
-d '{ | |
"topic": "cache/a/wis2/+/services/#" | |
}' | |
# test listing subscriptions | |
curl http://localhost:5000/subscriptions | |
# publish a test message | |
docker exec publisher pywis-pubsub publish --topic cache/a/wis2/my-centre/services/downloader \ | |
--config /pywis-pubsub/config/config.yml \ | |
-i test -u "http://subscriber:5000/metrics" | |
sleep 1s | |
# cat file contents (check the published file has been downloaded) | |
cat ./data/downloads/`date +"%Y"`/`date +"%m"`/`date +"%d"`/cache/a/wis2/my-centre/services/downloader/metrics.bin | |
# test deleting subscriptions | |
curl -X DELETE http://localhost:5000/subscriptions/cache/a/wis2/%2B/services/%23 | |
- name: Shutdown | |
working-directory: docker/tests | |
run: | | |
docker compose down |