GitRepoRegistration tests should reset database at start of each test #12

Open
opened 2026-09-06 08:38:10 +10:00 by pascal_nulah · 0 comments
Owner

GitRepoRegistration tests currently create a database per test then delete it once the test has run (pass or fail). If a dev is debugging via a test and stops instead of letting the test run to completion then the database will linger.

There should be an internal method on the GitManager that clears a database by name, which should drop and recreate any tables used by GitManager

todo: All of the tests in this suite should be wrapped in a try .. finally with the finally block calling DeleteDatabase so test databases don't linger around.
Alternatively (or in addition to), each test should attempt to rest any previously existing database with a ResetDatabase() method for instances where a test is run in debug with breakpoints and a dev hits stop instead of letting the test fail (which will result in the finally block never being called)
Originally posted by @pascal_nulah in #5/files (comment)

GitRepoRegistration tests currently create a database per test then delete it once the test has run (pass or fail). If a dev is debugging via a test and stops instead of letting the test run to completion then the database will linger. There should be an internal method on the `GitManager` that clears a database by name, which should drop and recreate any tables used by `GitManager` > ~~todo: All of the tests in this suite should be wrapped in a `try .. finally` with the finally block calling `DeleteDatabase` so test databases don't linger around.~~ > Alternatively (or in addition to), each test should attempt to rest any previously existing database with a `ResetDatabase()` method for instances where a test is run in debug with breakpoints and a dev hits stop instead of letting the test fail (which will result in the `finally` block never being called) > _Originally posted by @pascal_nulah in https://moar.ws/git/pascal_nulah/Nulah.PowerShell/pulls/5/files#issuecomment-98_
pascal_nulah added this to the Git project 2026-09-06 08:47:53 +10:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pascal_nulah/Nulah.PowerShell#12
No description provided.