Page MenuHomePhabricator

[build-bot] Fix database test when an extension is not present on the database file
ClosedPublic

Authored by jasonbcox on Oct 22 2020, 17:05.

Details

Summary

In some versions of Python, a different database backend may be selected.
The backend selected may or may not append an extension to the database file.

This patch fixes the implementation and test to work whether a file extension is present
or not. It also moves the test database to a more predictable location and does not
clean it up after the test is run to allow for easier post-test debugging.

Test Plan
Running `pytest` in either `contrib/buildbot` or `contrib/buildbot/test` produces
`contrib/buildbot/test/test_output/database`(with optional `.db` extension).
Running `pytest` repeatedly, the tests still pass.

Event Timeline

Fabien added a subscriber: Fabien.

Tested working no my environment which adds no extension to the db file

This revision is now accepted and ready to land.Oct 22 2020, 20:11