nav icon indicating copy to clipboard operation
nav copied to clipboard

Overhaul test suite with fixtures

Open lunkwill42 opened this issue 1 year ago • 4 comments

This PR has an overarching goal of making the test suite easier to run locally, rather then requiring devs to run all tests inside a very specifically defined Docker container (which is NOT how the test suite is run on GitHub actions).

Goals:

  • [ ] Rather than spin up all kinds of third party services as part of either tox or conftest.py, such as gunicorn, PostgreSQL, Xvfb, while expecting that these are available in the local environment, these services should be defined as test fixtures. Any test that depends on PostgreSQL should declare a dependency to this fixture, in order for it to be able to use PostgreSQL.
  • [ ] A PostgreSQL fixture should be able to work with an already setup PostgreSQL server (such as in GitHub Actions), or spin up its own using Docker, rather than relying on being run inside a very specific container environment.
  • [ ] Once all tests are properly "fixturized", the separation of the "unit", "integration" and "functional" test suites into separate tox environments should go away. These test environments are essentially all the same, when it comes to Python dependencies, and are a source of a lot of redundancies that lead to time-consuming test runs.

Some of the changes herein would probably stand to be factored out into separate PRs, as there are many fixes to the existing test suite that are not dependent on the fixture changes made.

lunkwill42 avatar Sep 05 '23 13:09 lunkwill42

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Sep 05 '23 13:09 sonarqubecloud[bot]

Test results

       9 files         9 suites   3m 33s :stopwatch: 2 070 tests 1 506 :heavy_check_mark: 13 :zzz: 114 :x: 437 :fire: 4 678 runs  3 547 :heavy_check_mark: 36 :zzz: 228 :x: 867 :fire:

For more details on these failures and errors, see this check.

Results for commit b8a3582d.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Sep 05 '23 13:09 github-actions[bot]

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Dec 11 '23 09:12 sonarqubecloud[bot]

Quality Gate Passed Quality Gate passed

Issues
1 New issue

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Feb 27 '24 14:02 sonarqubecloud[bot]