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

Don't hardcode runsettings if built from VS #20679

Merged

Conversation

kasobol-msft
Copy link
Contributor

@kasobol-msft kasobol-msft commented Apr 26, 2021

Attempt to fix #20674 .

The <RunSettingsFilePath Condition="'$(RunSettingsFilePath)' == ''">$(RepoEngPath)\nunit.runsettings</RunSettingsFilePath> didn't work :-(

https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2015/msbuild/visual-studio-integration-msbuild?view=vs-2015&redirectedfrom=MSDN#building-solutions

@pakrym
Copy link
Contributor

pakrym commented Apr 26, 2021

I was hoping to teach people to switch settings by commenting/uncomenting lines in the centralized file.

@kasobol-msft
Copy link
Contributor Author

kasobol-msft commented Apr 26, 2021

I was hoping to teach people to switch settings by commenting/uncomenting lines in the centralized file.

Maybe we can also AND this with some env variable to make it opt-in.
I find editing a file far less pleasant experience than clicking a checkbox to select between few prepared files... (prepared from centarlized file of course by filling these commented out gaps).

@pakrym
Copy link
Contributor

pakrym commented Apr 26, 2021

There seems to be another variable for runsettings location:
image

Can you see whether VS uses that one instead?

@kasobol-msft
Copy link
Contributor Author

kasobol-msft commented Apr 27, 2021

I tried <RunSettingsFilePath Condition="'$(VSTestSetting)' == ''">$(RepoEngPath)\nunit.runsettings</RunSettingsFilePath> without luck. However by looking at that snippet - shouldn't VSTestSetting take precedence over RunSettingsFilePath if that VS were using that one?

https://docs.microsoft.com/en-us/visualstudio/test/configure-unit-tests-by-using-a-dot-runsettings-file?view=vs-2019#set-a-build-property

Looks like:
image

@kasobol-msft
Copy link
Contributor Author

We'll follow up with VS team to seek better solution.

@kasobol-msft kasobol-msft merged commit 07e0bfe into Azure:master Apr 27, 2021
@kasobol-msft kasobol-msft deleted the fix-test-runner-in-vs-runsettings branch April 27, 2021 18:04
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.

[BUG] Hardcoded runsettings makes VS test runner runsettings picker not working.
3 participants