-
Notifications
You must be signed in to change notification settings - Fork 652
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
Clean up AssemblyInfo file updating #1249
Conversation
I see there there are some test failures, but none of them look related to my changes... |
Made a bit more progress. I've turned I've also started the |
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 really like what this PR does. Please have a look at my comments and let me know what you think.
@@ -119,6 +119,9 @@ | |||
<Compile Include="GitVersionCache.cs" /> | |||
<Compile Include="GitVersionCacheKey.cs" /> | |||
<Compile Include="GitVersionCacheKeyFactory.cs" /> | |||
<EmbeddedResource Include="GitVersionInformationResources\Templates\GitVersionInformation.cs" /> | |||
<EmbeddedResource Include="GitVersionInformationResources\AddFormats\GitVersionInformation.cs" /> |
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.
Since these are jumbled around anyway, would you mind grouping the related files together in the .csproj
?
<Reference Include="Shouldly, Version=2.7.0.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Shouldly.2.7.0\lib\net40\Shouldly.dll</HintPath> | ||
<Private>True</Private> | ||
<Reference Include="Shouldly, Version=2.8.3.0, Culture=neutral, PublicKeyToken=6042cbcb05cbc941, processorArchitecture=MSIL"> |
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.
Since some of the build failures seems related to the upgrade of Shoudly, can you perhaps avoid that upgrade in this PR? On one of the Travis builds, this is the output:
The type initializer for
Shouldly.ShouldlyConfiguration
threw an exception.
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 can back this out, but the reason I upgraded it was that the older version was throwing an error about it not having a diff tool, so I was blocked. Upgrading it allowed it to use the VS diff tool.
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 would appreciate if you could install an external diff tool so we could have this PR free of any package upgrades. I hope that should take care of the build failures.
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.
@asbjornu I do have an external diff tool, SourceGear DiffMerge, but Shouldly doesn't appear to know about it. Are there some docs I can follow to temporarily wire that up so I can actually run the tests but not need to bump the version?
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.
Seems like this might be a good place to start.
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.
Thanks, I'll see what I can do to get it working and I'll remove the package upgrade.
@asbjornu I have cleaned up the project files and removed the Shouldly update, but it looks like AppVeyor is still failing. I've run all of those failing tests locally, and they seem to work fine. Regarding the rest of the changes to finish this PR up, I hope to have it wrapped up this week. |
@bording: Those build failures are indeed very strange. If someone else from @GitTools/developers should come by, here's the failure: Error : ConfigProviderTests.CanWriteOutEffectiveConfiguration
System.Exception : Cannot find method in call stack with attribute NUnit.Framework.TestCaseAttribute
at Shouldly.Configuration.FindMethodUsingAttribute`1.GetTestMethodInfo(StackTrace stackTrace, Int32 startAt) in C:\projects\shouldly\src\Shouldly.Shared\Configuration\FindMethodUsingAttribute.cs:line 20
at Shouldly.ShouldMatchApprovedTestExtensions.ShouldMatchApproved(String actual, Func`1 customMessage, Action`1 configureOptions) in C:\projects\shouldly\src\Shouldly.Shared\ShouldlyExtensionMethods\ShouldMatchApprovedTestExtensions.cs:line 49
at Shouldly.ShouldMatchApprovedTestExtensions.ShouldMatchApproved(String actual) in C:\projects\shouldly\src\Shouldly.Shared\ShouldlyExtensionMethods\ShouldMatchApprovedTestExtensions.cs:line 17
at ConfigProviderTests.CanWriteOutEffectiveConfiguration() in C:\projects\gitversion\src\GitVersionCore.Tests\ConfigProviderTests.cs:line 177 |
Pushed up a few more changes, but didn't get as much done as I'd hoped I would. 😞 @asbjornu I started looking into turning the existing Is it really important to keep this aspect in the new tests? It seems a bit excessive to me. Also, it only tests the C# and VB output, and not F#. I'm thinking that having the Shouldly output to verify the output looks correct would be enough here, especially considering that's all the |
Hmm, still seeing those weird test failures. I see that other PRs have been merged recently, and the failures didn't happen on those branches, but I'm not sure what I've done here that would cause them. I guess I'll need to spend some time figuring that out since it doesn't look like it's going away on it's own... |
Compiling the generated files with Roslyn is a bit excessive, I agree. It's good to know that the generated content actually compiles (especially since it's just basic and unsafe string replacements), but we can probably move that to the build pipeline instead. @gep13, do you have Ideas on how we can have Cake do the instrumentation there instead of doing it within a test? It's unfortunate that the tests are failing and that I don't have time assisting you. I'm back from holiday in a couple of weeks and might be able to take a closer look then. The best of luck meanwhile, though and thanks for this work, @bording! It's highly appreciated! |
Just wanted to chime in and say that I'm still planning on getting back to finishing this. Lack of spare time and then vacation has conspired to prevent me from working on it recently. Hope to get back to it soon! |
@asbjornu With the changes I've just pushed up, I'm removing the WIP and think this is ready for a review. I haven't added a way to create the |
Looks like those unrelated tests are still failing on AppVeyor 😢 |
@bording: Thanks for your work on this! ❤️ Those failing tests are bizarre. Especially because they're only failing on AppVeyor. Perhaps an upgrade of Shouldly can help? |
I can try it and see if it makes a difference. |
Quick look at the stack trace a few comments above, nunit attribute is mentioned - so could also check if updating nunit packages helps at all. |
Dug into the Shouldly code a bit and I realized what was going on! The tests I added were calling The configuration appears to be global, so I added And, since those tests were all marked to not run on mono, that's why Travis wasn't failing. @asbjornu Should I revert the Shouldly updates? Maybe go back to 2.8.3 instead of the beta? |
Excellent! 2.8.3 sounds fine. |
Done! |
Sigh, now it looks like 2.8.3 is causing Travis to fail because it added a Visual Studio difftool option, and looking for that is throwing. I guess back to 2.7.0 it is! |
@bording: Fantastic work, thank you so much for this! ❤️ |
This is still WIP, but here's what I have so far:
AssemblyInfoFileUpdate
has been moved into GitVersionCore and renamedAssemblyInfoFileUpdater
UpdateAssemblyInfo
task has been rewritten to useAssemblyInfoFileUpdater
Things to do still:
GitVersionInformation
classAssemblyInfoBuilder
stuff from GitVersionTaskFixes #1242