-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
testserver: expose NoFileCleanup
option to allow retention of files after Stop
#172
base: master
Are you sure you want to change the base?
testserver: expose NoFileCleanup
option to allow retention of files after Stop
#172
Conversation
… after `Stop` Retaining files after `Stop` can help debug some test-failures because one can start the server back up (off the store-dir left behind after failure). Looking at the data the failing test left behind can help hypothesize better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your contribution!
@@ -234,6 +234,12 @@ func TestRunServer(t *testing.T) { | |||
) | |||
}, | |||
}, | |||
{ | |||
name: "No File Cleanup", | |||
instantiation: func(t *testing.T) (*sql.DB, func()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any way for this test to assert that the directory still exists at the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a dedicated test TestBaseDirIsPreservedWhenNoFileCleanupRequested
(but also had to add some additional machinery to power it).
…leCleanup` `BasedirOverride` allows user to set testserver base-dir (as opposed to using a random-dir generated by testserver lib. This helps test `NoFileCleanup` better as preserved store-dir's state can now be asserted upon after original testserver's teardown.
ddb3646
to
ae92af3
Compare
@rafiss does this look alright? |
Retaining files after
Stop
can help debug some test-failures becauseone can start the server back up (off the store-dir left behind after
failure). Looking at the data the failing test left behind can help
hypothesize better.