This repository was archived by the owner on Jan 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 173
Enable temporary .csproj creation and associated language server tests #582
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
msoeken
approved these changes
Aug 22, 2020
Member
msoeken
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.
Looks good to me, but I am not the expert for this one.
bettinaheim
reviewed
Aug 24, 2020
bettinaheim
reviewed
Aug 24, 2020
bettinaheim
reviewed
Aug 24, 2020
Co-authored-by: bettinaheim <34236215+bettinaheim@users.noreply.github.com>
Contributor
Author
|
@ricardo-espinoza @bettinaheim the tests are now passing reliably with the current set of changes, so I think it is ready to go, pending your review. Thanks! |
ricardo-espinoza
approved these changes
Sep 1, 2020
bettinaheim
approved these changes
Sep 2, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR re-enables temporary .csproj creation (essentially undoing #585) and also ensures that language server tests pass deterministically when opening both .qs files and non-.qs files.
There a few pieces to this fix, in addition to re-adding the code that was removed in #585:
Only create temporary projects for
.qsfiles. SomeBasicFunctionalitytests load randomly-named source files without a.qsextension, and we want to allow those tests to operate as they do today.Ensure that
MSBuildLocatoris registered for both theBasicFunctionalityandProjectLoadertest classes viaAssemblyInitializeattribute, rather than just a static constructor. With the static constructor approach, the order of execution was not deterministic, and if theBasicFunctionalitytests were run prior to theProjectLoadertest class initialization, the proper version of MSBuild was not always being discovered. This actually led the tests to always pass, because the failure to create the temporary project was simply logged and the tests continued down their old path without a temporary project.Change the temporary project folder naming scheme so that it is stable. The previous
GetHashCode()approach was not even stable within a single test run, which occasionally caused errors. This is a good change from a user perspective as well, since it will ensure that the same temporary project is always used for code in a given folder.