-
-
Notifications
You must be signed in to change notification settings - Fork 442
[0.6.x] Improve config dir detection in tests #3796
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
[0.6.x] Improve config dir detection in tests #3796
Conversation
|
Hey, you should give our CONTRIBUTING.md a read, you should not be PRing to |
|
Sorry about that, I only read the Code Contribution section where it states that I should PR to master. At the top I see it mentioning the 0.6.x branch, I'll target that in a sec. |
ce76011 to
5f6f56f
Compare
gonX
left a comment
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.
Assuming the intent is to include support of the OTD_CONFIGURATIONS environment variable, wouldn't it be more interesting to instead change the existing ConfigurationDir variable to
Environment.GetEnvironmentVariable("OTD_CONFIGURATIONS")
?? Path.Join(ConfigurationProjectDir, "Configurations");
This would make this change a one, maybe 2 line change instead of this.
|
You can alternatively use the [CallerFilePath] attribute on a helper function to help figure out the root directory for the Configurations project. |
5f6f56f to
2829c76
Compare
This is almost exactly what I was looking for, great find and thanks!
My main intent is to make the tests pass when called with the extra argument
I agree, I mostly changed it because those variables didn't have any other references and it was subjectively more readable to me. |
|
I liked the idea of also supporting |
Previously some tests failed with
dotnet test OpenTabletDriver.Tests --configuration Release --runtime linux-x64, because the current working directory wasbin/Release/linux-x64directory instead of the usualbin/Release, and it couldn't find the configuration directory in the../../../..path.This PR prioritizes reading the config directory from an environment variable already used in other files.