Skip to content

Commit

Permalink
Test fix (#533)
Browse files Browse the repository at this point in the history
* Update Microsoft.Build.Sql.csproj

* Update ScriptDom to 161.9123.0

* Add target to remove included files via :r from build

* Update System.IO.Packaging to 8.0.1

* Fix test VerifyCodeAnalyzerFromPackageReference

* Update DacFx to 162.5.57

* Fix merge conflict

* Clean up extra space
  • Loading branch information
zijchen authored Dec 4, 2024
1 parent 7770d9f commit 0d9d03c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/Microsoft.Build.Sql.Tests/CodeAnalysisTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ public void VerifyCodeAnalyzerFromPackageReference()
// Set up and create the analyzer package
string tempFolder = TestUtils.CreateTempDirectory();
TestUtils.CopyDirectoryRecursive(Path.Combine(CommonTestDataDirectory, "CodeAnalyzerSample"), tempFolder);
RunGenericDotnetCommand($"pack {Path.Combine(tempFolder, "CodeAnalyzerSample.csproj")} -o {tempFolder}", out _, out _);
RunGenericDotnetCommand($"pack {Path.Combine(tempFolder, "CodeAnalyzerSample.csproj")} -o {tempFolder} -p:Version=1.1.1-test", out _, out _);

// Copy analyzer package to local Nuget source
string analyzerPackagePath = Path.Combine(tempFolder, "CodeAnalyzerSample.1.0.0.nupkg");
string analyzerPackagePath = Path.Combine(tempFolder, "CodeAnalyzerSample.1.1.1-test.nupkg");
FileAssert.Exists(analyzerPackagePath);
File.Copy(analyzerPackagePath, Path.Combine(WorkingDirectory, "pkg", "CodeAnalyzerSample.1.0.0.nupkg"));
File.Copy(analyzerPackagePath, Path.Combine(WorkingDirectory, "pkg", "CodeAnalyzerSample.1.1.1-test.nupkg"));

// Add the analyzer package as a PackageReference to the test sqlproj
ProjectUtils.AddItemGroup(this.GetProjectFilePath(), "PackageReference",
new string[] { "CodeAnalyzerSample" },
item =>
{
item.AddMetadata("Version", "1.0.0");
item.AddMetadata("Version", "1.1.1-test");
});

// Set up code analysis properties
Expand Down

0 comments on commit 0d9d03c

Please sign in to comment.