Skip to content

Adding support to generate WiX version files #1386

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

Conversation

ruhullahshah
Copy link
Contributor

@ruhullahshah ruhullahshah changed the title Adding support to generate Wix version files Adding support to generate WiX version files Mar 15, 2018
Copy link
Member

@asbjornu asbjornu left a comment

Choose a reason for hiding this comment

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

Thanks for this. If it's possible to test this in any way, I would appreciate a few tests. 😄

@ruhullahshah
Copy link
Contributor Author

You are welcome. I have added some testcases that cover the use cases scenarios for this patch

@@ -0,0 +1,102 @@
namespace GitVersionExe.Tests
Copy link
Member

Choose a reason for hiding this comment

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

Why only GitVersionExe tests and not for GitVersionCore? Also, don't you agree approval tests such as this is better suited for file manipulation testing such as this?

public void ShouldCreateAssemblyInfoFileWhenNotExistsAndEnsureAssemblyInfo(string fileExtension)
{
var fileSystem = new TestFileSystem();
var workingDir = Path.GetTempPath();
var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension;
var fullPath = Path.Combine(workingDir, assemblyInfoFile);
var variables = VariableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false);
using (var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(assemblyInfoFile, workingDir, variables, fileSystem, true))
{
assemblyInfoFileUpdater.Update();
fileSystem.ReadAllText(fullPath).ShouldMatchApproved(c => c.SubFolder(Path.Combine("Approved", fileExtension)));
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you please explain this in detail?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, sure. Approval tests allows you to create a file on disk that is what the test is compared against. If the content matches, the test is successful, otherwise it fails and a diff is presented.

The above test will verify the manipulated file content against the following approved text file:

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by GitVersion.
//
// You can modify this code as we will not overwrite it when re-executing GitVersion
// </auto-generated>
//------------------------------------------------------------------------------
using System.Reflection;
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]

@asbjornu
Copy link
Member

@ruhullahshah, can you please find time to address the code review comment regarding approval testing, rebase and resolve the conflicts of this PR?

@ruhullahshah
Copy link
Contributor Author

I will resolve the pending work in #1599,

@ruhullahshah ruhullahshah deleted the feature/add_support_for_emitting_vars_in_wix_format branch February 20, 2019 15:21
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.

2 participants