Skip to content

Add baseline version test #7627

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
merged 5 commits into from
Feb 26, 2019
Merged

Conversation

mikaelm12
Copy link
Contributor

Issue: #7546

@Eilon Eilon added the feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform label Feb 15, 2019
Copy link
Contributor

@natemcmaster natemcmaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: once you have approval from @Eilon or @muratg, too.

This change is a test change only and gives us coverage which would have caught #7546

@natemcmaster natemcmaster added this to the 2.1.x milestone Feb 15, 2019
@mikaelm12 mikaelm12 changed the title [WIP] Add baseline version test Add baseline version test Feb 16, 2019
var localAssemblyVersion = AssemblyName.GetAssemblyName(file)?.Version;
var splitPath = file.Split('\\');
var dllName = splitPath[splitPath.Length - 1];
Assert.True(nugetAssemblyVersions.ContainsKey(dllName), $"Expected {dllName} to be in the downloaded dlls");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh and BTW just checking, are there are no xUnit asserts for these two asserts here? Usually Assert.True is frowned upon, unless there's no other reasonable choice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert.Contains(nugetAssemblyVersions.Keys, ...) should work here. The only supposed loss would be the custom error message when it fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could change to use the Assert.Contains api. The error message becomes slightly less clear. I'm indifferent.

Copy link
Contributor

@Eilon Eilon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Please send TELL MODE email to shiproom alias with FYI (specify it's for 2.1). I sent you an email with info.

@@ -34,6 +38,7 @@
<PackageReference Include="xunit" Version="$(XunitPackageVersion)" />
<PackageReference Include="xunit.analyzers" Version="$(XunitAnalyzersPackageVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitRunnerVisualstudioPackageVersion)" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.2.2" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is test-only but have we used @natemcmaster's private packages elsewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mimicked here what we did in the internal repo.

var localAssemblyVersion = AssemblyName.GetAssemblyName(file)?.Version;
var splitPath = file.Split('\\');
var dllName = splitPath[splitPath.Length - 1];
Assert.True(nugetAssemblyVersions.ContainsKey(dllName), $"Expected {dllName} to be in the downloaded dlls");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assert.Contains(nugetAssemblyVersions.Keys, ...) should work here. The only supposed loss would be the custom error message when it fails.

@mikaelm12 mikaelm12 merged commit 5661c41 into release/2.1 Feb 26, 2019
@natemcmaster natemcmaster deleted the mikaelm12/AddBaselineVersionTest branch May 3, 2019 06:25
@dougbu dougbu modified the milestones: 2.1.x, 2.1.10 Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants