Skip to content

wip: attempt to shorten runtime of test suite#2208

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/investigate-speed-up-test-suite
Draft

wip: attempt to shorten runtime of test suite#2208
Copilot wants to merge 2 commits into
mainfrom
copilot/investigate-speed-up-test-suite

Conversation

Copilot AI commented May 29, 2026

Copy link
Copy Markdown
Contributor
  • Understand the existing fresh_db fixture pattern and test file structure
  • Verify SQLAlchemy 2.0 Session(bind=connection, join_transaction_mode="create_savepoint") works correctly
  • Add transactional_db fixture to flexmeasures/conftest.py
  • Add *_transactional_db counterpart fixtures for all fixtures needed by the test file
  • Update test_sensor_schedules_fresh_db.py to use transactional fixtures (20 tests)
  • All 20 tests pass with the new approach
  • Full test suite passes (1198 passed, 3 xfailed, no regressions)
  • Pre-commit hooks pass
  • Added changelog entry
  • PR wip: attempt to shorten runtime of test suite #2208 open

Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Copilot AI changed the title perf(tests): speed up test_numerical_errors by shortening schedule horizon perf(tests): shorten test_numerical_errors schedule horizon from 24h to 4h May 29, 2026
Copilot finished work on behalf of Flix6x May 29, 2026 11:55
Copilot AI requested a review from Flix6x May 29, 2026 11:55
…db.py

Introduces a new `transactional_db` fixture (and its `*_transactional_db`
counterparts) that wraps each test in a transaction/savepoint instead of
recreating the DB schema from scratch. Migrates
`test_sensor_schedules_fresh_db.py` (20 tests) to use this approach,
reducing the number of expensive `drop_all + create_all` operations from
one-per-test to one-per-module.

All 20 tests pass with the new approach.

Agent-Logs-Url: https://github.com/FlexMeasures/flexmeasures/sessions/3708b30c-e092-420a-948a-005fbf747bc7

Co-authored-by: Flix6x <30658763+Flix6x@users.noreply.github.com>
Copilot finished work on behalf of Flix6x May 29, 2026 13:31
@Flix6x Flix6x changed the title perf(tests): shorten test_numerical_errors schedule horizon from 24h to 4h wip: attempt to shorten runtime of test suite May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants