Skip to content

Test improvements

Øyvind Evju requested to merge test-improvements into dev

Description

Various improvements of our testing setup.

CI and test running:

  • Removed the need for setup-local-integration-test.source
  • Rewrote run-<xxx>-tests.sh to initiate database so they can be run directly in Docker (changed Makefile accordingly)
  • Merged run-api-migration-tests.sh and run-api-tests.sh
  • Removed the need for a supervisor.cfg specific for tests

Configs:

  • Create pytest.ini
  • Install package pytest-env to allow for test-specific environment variables in pytest.ini
  • Add correct parser to .eslintrc and use legacy decorator

Pytest:

  • With addition of pytest.ini, and modifications to devcontainer.json, one can now run or debug one or all tests through VSCode
  • Rewrote a test in test_annotationshadow.py that was basically a fixture
  • Create a fixture for setting up an annotationserver, required specifically for test_polling.py
  • Minor changes to testdatabase.py to create database from scratch when needed

Formatting tests:

  • Rewrote run-formatting-tests.sh with a smaller footprint
  • Added eslint to formatting tests
  • Added // eslint-disable-line no-unused-vars to all template imports (the imports are necessary, but not caught by eslint)

Related issues

Notes to review (code/docs/QA)

Tests

General

  • Tests have been added that prove my fix is effective or that my feature works
  • Related tests have been modified/removed

Hypothesis testing:

  • Soak testing has been done
  • Distribution between positive / negative cases has been checked

Database

  • Includes changes to database schema
  • Includes necessary database migrations

Configuration

  • Includes changes to configuration
  • Includes configuration migration instructions in documentation

Merge checklist

  • Self-review of code has been performed.
  • Feature review and validation against specification has been performed (if applicable). Apply label: QAdone
  • Need for documentation has been evaluated and, if necessary, updated. Apply label: docsdone
  • Code and implementation has been reviewed by other core developer (including any changes based on initial review). Apply label: code reviewdone
Edited by Morten C. Eike

Merge request reports