Skip to content

Commit

Permalink
feature/mx-1500 speed-up wikidata tests (#68)
Browse files Browse the repository at this point in the history
# PR Context

- profiling the tests with cProfile and snakeviz showed wikidata tests
are only slow because of HTTP requests
- we checked the tests and they are all valid (no HTTP calls that could
be cut from the integration tests)
- instead we added pytest plugins to randomize order (always good idea
to detect bad test isolation) and to distribute test workload to all cpu
cores (this should speed up the test runs)

# Added
- pytest plugins for random order and parallelized test execution

# Changes
- `.\mex.bat test` uses random order and xdist plugins by default
  • Loading branch information
cutoffthetop authored Jan 23, 2024
1 parent a0d8386 commit 7564073
Show file tree
Hide file tree
Showing 4 changed files with 191 additions and 122 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- pytest plugins for random order and parallelized test execution

### Changes

- `mex.bat test` uses random order and xdist plugins by default

### Deprecated

### Removed
Expand Down
5 changes: 3 additions & 2 deletions mex.bat
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ echo linting all files
pre-commit run --all-files
if %errorlevel% neq 0 exit /b %errorlevel%

@REM run the pytest test suite with unit and integration tests
@REM run the pytest test suite with unit and integration tests in random order
@REM distributed across all available CPU cores
echo running all tests
poetry run pytest
poetry run pytest --random-order-bucket=global --numprocesses=auto --dist=worksteal
exit /b %errorlevel%


Expand Down
Loading

0 comments on commit 7564073

Please sign in to comment.