Skip to content
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

Fix tests that use temp dirs on Windows #669

Closed
wants to merge 7 commits into from
Closed

Fix tests that use temp dirs on Windows #669

wants to merge 7 commits into from

Conversation

inkychris
Copy link
Contributor

@inkychris inkychris commented Mar 16, 2019

Fixes #668.

Tests added in #440 called os.Clearenv() which on windows causes os.TempDir() to default to C:\Windows and cause subsequent file permission failures. This has been repaced with os.Unsetenv() for the variables used in those tests.

The TestDirsSearch test was using path.Base() in its assertion which did not account for backslashes used on Windows. This has been replaced with filepath.Base() which correctly returns the expected value.

The initDirs() method now terminates a test if the temporary root test directory does not exist which should help debug tests that use it if os.Clearenv() gets used in future tests.

@inkychris
Copy link
Contributor Author

Implemented in #673

@inkychris inkychris closed this Mar 30, 2019
@inkychris inkychris deleted the windows-temp-dir-fix branch March 30, 2019 20:24
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.

1 participant