Skip to content

add test for not null with default #539

add test for not null with default

add test for not null with default #539

Workflow file for this run

name: Conformance
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
conformance:
runs-on: ubuntu-latest
env:
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
permissions:
contents: write
pull-requests: write # to write comment
steps:
- uses: actions/checkout@v4
- name: Create env
run: cp .env.example .env
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Do quickstart
run: |
# start the stack
docker compose --profile testing_conformance up --build -d
# deploy static files and migrate database
docker compose exec django python manage.py migrate --no-input
docker compose exec django python manage.py populate_users
docker compose exec django python manage.py populate_data
- name: Load .env file
uses: xom9ikk/dotenv@v2
- name: Healthcheck
run: wget http://${OGCAPIF_HOST}:${DJANGO_DEV_PORT}/oapif/collections/tests.point_2056_10fields/items
- name: Run conformance test suite
run: docker compose run conformance_test
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: emailable-report
path: |
./tests/output/**/emailable-report.html
- name: Install requirements
run: pip install lxml
- name: Check baseline
id: baseline
run: |
EXIT_CODE=0
python tests/conformance/parse_report.py tests/output/emailable-report.html tests/conformance/conformance-baseline.json || EXIT_CODE=$?
echo "EXIT_CODE=${EXIT_CODE}" >> $GITHUB_OUTPUT
- name: Commit baseline if improved >> checkout
uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && steps.baseline.outputs.EXIT_CODE == '1' }}
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
path: ./baseline_repo
- name: Commit baseline if improved >> copy baseline file
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && steps.baseline.outputs.EXIT_CODE == '1' }}
run: cp tests/conformance/conformance-baseline.json baseline_repo/tests/conformance/conformance-baseline.json
- name: Commit baseline if improved >> commit
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && steps.baseline.outputs.EXIT_CODE == '1' }}
uses: EndBug/add-and-commit@v9
with:
add: tests/conformance/conformance-baseline.json
cwd: ./baseline_repo
message: update conformance baseline
- name: 💬 Prepare comment
id: prepare_comment
if: ${{ github.event_name == 'pull_request' && steps.baseline.outputs.EXIT_CODE != '0' }}
run : |
if [[ ${{ steps.baseline.outputs.EXIT_CODE }} == 1 ]]; then
echo "comment=Conformance tests got better! (update conformance baseline if the job fails)" >> $GITHUB_OUTPUT
else
echo "comment=Oh no! Conformance tests got worse!" >> $GITHUB_OUTPUT
fi
- name: 💬 Create comment
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ github.event_name == 'pull_request' && steps.baseline.outputs.EXIT_CODE != '0' }}
with:
message: ${{ steps.prepare_comment.outputs.comment }}
- name: Recheck baseline
run: |
python tests/conformance/parse_report.py tests/output/emailable-report.html tests/conformance/conformance-baseline.json
- name: Failure logs
if: failure()
run: docker-compose logs