Skip to content

Conversation

@jkhales
Copy link

@jkhales jkhales commented May 15, 2021

I noticed that not all files were cleaned up after running go test:

Screen Shot 2021-05-14 at 7 52 17 PM

  • Fixed this by adding in defer os.Remove calls next to the writes so it's easier to keep track of cleanup.
  • Switched the save location to a TempDir so even in the case of a catastrophic failure, the file system will take care of clean up. This also isolates the test correctly so there won't be any chance of file name conflict.
@jkhales jkhales marked this pull request as ready for review May 15, 2021 03:07
@jkhales jkhales force-pushed the @jkhales/clean-up-io-tests branch 2 times, most recently from 2b8dab3 to 97f657f Compare May 15, 2021 03:24
@jkhales jkhales force-pushed the @jkhales/clean-up-io-tests branch from 97f657f to 5e5711e Compare May 15, 2021 03:45
defer os.RemoveAll(tmpDataDir)

scrubbedGbk = ReadGbk("data/t4_intron.gb")
scrubbedGb := ReadGbk("data/t4_intron.gb")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol

Copy link
Collaborator

@TimothyStiles TimothyStiles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good and can be approved. Not sure why gbk is now gb but ¯_(ツ)_/¯

@TimothyStiles TimothyStiles merged commit 9d2eea8 into bebop:prime May 15, 2021
@jkhales jkhales deleted the @jkhales/clean-up-io-tests branch May 16, 2021 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants