fix: prevent sorting of measuring points when none are available for water wells #921
Workflow file for this run
This file contains hidden or 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
| # This workflow will install Python dependencies, run tests and lint with a single version of Python | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
| name: Test Suite | |
| on: | |
| pull_request: | |
| branches: ['production', 'staging', 'transfer'] | |
| permissions: | |
| contents: read | |
| jobs: | |
| run-tests: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgis: | |
| image: postgis/postgis:latest | |
| # image: postgis/postgis:17-3.5 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| # Maps tcp port 5432 on service container to the host | |
| - 5432:5432 | |
| steps: | |
| - name: Check out source repository | |
| uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Run tests | |
| env: | |
| MODE: development | |
| POSTGRES_HOST: localhost | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| DB_DRIVER: postgres | |
| run: uv run pytest -vv --durations=20 --cov --cov-report=xml --junitxml=junit.xml | |
| - name: Checkout BDD repo (features only) | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: DataIntegrationGroup/OcotilloBDD | |
| path: bdd | |
| - name: Copy BDD features into backend test directory | |
| run: | | |
| mkdir -p tests/features | |
| cp -r bdd/features/backend/* tests/features/ | |
| - name: Run BDD tests | |
| env: | |
| POSTGRES_HOST: localhost | |
| POSTGRES_PORT: 5432 | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| DB_DRIVER: postgres | |
| BASE_URL: http://localhost:8000 | |
| run: | | |
| uv run behave tests/features --tags="@backend and @production" --no-capture | |
| # uv run behave tests/features/transducer-data-response.feature \ | |
| # tests/features/thing-type-path-parameters.feature \ | |
| # tests/features/thing-query-parameters.feature \ | |
| # tests/features/well-notes.feature \ | |
| # tests/features/location-notes.feature \ | |
| # tests/features/geojson-response.feature | |
| # use this when we have consensus on tag nomenclature | |
| # uv run behave tests/features --tags="@backend and @production" --no-capture | |
| - name: Upload results to Codecov | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Upload test results to Codecov | |
| if: ${{ !cancelled() }} | |
| uses: codecov/test-results-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} |