-
Notifications
You must be signed in to change notification settings - Fork 377
Add ASP.NET Core runtime version test #7227
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
Merged
jonfortescue
merged 11 commits into
dotnet:main
from
jonfortescue:AspNetCoreRuntimeVersionTest
Apr 15, 2021
Merged
Changes from 4 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
bde95f9
Add test for checking if the ASP.NET runtime version is the same as .NET
jonfortescue a430963
Merge test into UnitTests.proj
jonfortescue 63f267c
Windows-only the new test
jonfortescue 1426f74
Switch to pascal casing, set different exit codes
jonfortescue f79935b
move part 1
jonfortescue ca5da62
full rename, part 2
jonfortescue 20200d6
Refactor msbuild
jonfortescue 2e8b4b1
whoops
jonfortescue 6b62721
switch to XHarnessRunner.props
jonfortescue b3575d1
Testing
jonfortescue 1077627
oops
jonfortescue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
src/Microsoft.DotNet.Helix/Sdk/tools/dotnet-cli/DotNetCli.props
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| Param( | ||
| [string] $aspNetCoreVersion | ||
| ) | ||
|
|
||
| $versionRegex = "(?<version>\d+\.\d+)\.\d+(?:-(?<preview>\w+\.\d+)\.\d+\.\d+)?" | ||
|
|
||
| $dotnetVersion = & dotnet --version | ||
| $dotNetSdkMatch = $dotnetVersion -Match $versionRegex | ||
| if ($dotNetSdkMatch -eq $false) { | ||
| Write-Host ".NET SDK version '$dotnetVersion' did not match regex!" | ||
| exit 2 | ||
| } | ||
| $dotnetMajorVersion = $Matches.version | ||
| $dotnetPreviewVersion = $Matches.preview | ||
| Write-Host ".NET SDK '$dotnetVersion' -- major version: '$dotnetMajorVersion'; preview: '$dotnetPreviewVersion'" | ||
|
|
||
| $aspNetCoreMatch = $aspNetCoreVersion -Match $versionRegex | ||
| if ($aspNetCoreMatch -eq $false) { | ||
| Write-Host "ASP.NET Core Runtime version '$aspNetCoreVersion' did not match regex!" | ||
| exit 3 | ||
| } | ||
| $aspNetCoreMajorVersion = $Matches.version | ||
| $aspNetCorePreviewVersion = $Matches.preview | ||
| Write-Host "ASP.NET SDK '$aspNetCoreVersion' -- major version: '$aspNetCoreMajorVersion'; preview: '$aspNetCorePreviewVersion'" | ||
|
|
||
| if ($dotnetMajorVersion -ne $aspNetCoreMajorVersion -or $dotnetPreviewVersion -ne $aspNetCorePreviewVersion) { | ||
| Write-Host "ASP.NET Core Runtime version and .NET Core Runtime version do not match -- update DotNetCli.props!" | ||
| exit 1 | ||
| } |
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
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.
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.
Can you also please use this property inside
XHarnessRunner.targets?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.
@premun Check out the latest push and see if you think this will work.
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.
@jonfortescue it didn't work out of the box? without pulling the property in its own file?
I think the whole DotNetCli is included for Helix SDK already
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.
I am meaning to say - did you just try using the property without any other changes?