From 9cf0e9be3191a7c4f91b7e2b83aa9e0bcb39afe7 Mon Sep 17 00:00:00 2001 From: Billy Richardson Date: Sat, 18 Oct 2025 00:41:21 -0700 Subject: [PATCH 1/2] Revert integration test default version --- .github/dependabot.yml | 2 +- Directory.Packages.props | 22 +++++++++---------- test/IntegrationTests/IntegrationTests.csproj | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 30b4c83..c88ffa1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,7 @@ version: 2 updates: - package-ecosystem: "nuget" - directory: "/src/" + directory: "/" schedule: interval: "monthly" labels: diff --git a/Directory.Packages.props b/Directory.Packages.props index d25bb69..a96a3f1 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,16 +6,16 @@ - - + + - - - - + + + + @@ -23,17 +23,17 @@ - + - - + + - + - + diff --git a/test/IntegrationTests/IntegrationTests.csproj b/test/IntegrationTests/IntegrationTests.csproj index 1bbeaf3..53b25ed 100644 --- a/test/IntegrationTests/IntegrationTests.csproj +++ b/test/IntegrationTests/IntegrationTests.csproj @@ -8,7 +8,7 @@ false true true - 0.0.1 + 0.0.1 From bb9c59ebe5e2cf7b06392481e7e84e8c6ce0edd4 Mon Sep 17 00:00:00 2001 From: Billy Richardson Date: Sat, 18 Oct 2025 01:57:40 -0700 Subject: [PATCH 2/2] Fix MSTest analyzer warnings --- src/UnitTests/TaskTestBase.cs | 9 +++++---- src/UnitTests/TaskUnixTests.cs | 18 +++++++++++------- src/UnitTests/TaskWindowsTests.cs | 18 +++++++++++------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/src/UnitTests/TaskTestBase.cs b/src/UnitTests/TaskTestBase.cs index a78d19e..10995e4 100644 --- a/src/UnitTests/TaskTestBase.cs +++ b/src/UnitTests/TaskTestBase.cs @@ -351,7 +351,7 @@ public void ShouldCorrectlyParseBooleanValues() JObject parameters = (JObject)armTemplate["parameters"]; Assert.AreEqual("array", parameters.GetValue("options", comparison)["type"].ToString()); Assert.AreEqual("Boolean", parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Type.ToString()); - Assert.AreEqual(true, parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); + Assert.IsTrue(parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); } [TestMethod] @@ -401,7 +401,7 @@ public void ShouldIncludeAdditionalPropertiesInJsonInput(bool useLegacyAdditiona Assert.AreEqual("String", parameters.GetValue("options", comparison)["value"].First()["source"].Type.ToString()); Assert.AreEqual("file1", parameters.GetValue("options", comparison)["value"].First()["source"].Value()); Assert.AreEqual("Boolean", parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Type.ToString()); - Assert.AreEqual(true, parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); + Assert.IsTrue(parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); } [TestMethod] @@ -456,7 +456,7 @@ public void ShouldIncludeAdditionalPropertiesInArmParameterFile(bool useLegacyAd Assert.AreEqual("String", parameters.GetValue("options", comparison)["value"].First()["source"].Type.ToString()); Assert.AreEqual("file1.parameters", parameters.GetValue("options", comparison)["value"].First()["source"].Value()); Assert.AreEqual("Boolean", parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Type.ToString()); - Assert.AreEqual(true, parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); + Assert.IsTrue(parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value()); } [TestMethod] @@ -521,7 +521,8 @@ public void StressTest_ShouldAddSourcePropertyManyFiles() [Description("Test that files are correctly translated between ARM, JSON, and YAML.")] public void ShouldTranslateBetweenFormatsAndValidateNoDataLoss(string inputType, string[] steps) { - Assert.IsTrue(steps?.Length > 0); + Assert.IsNotNull(steps); + Assert.IsGreaterThan(steps.Length, 0); // Setup input file string inputFilePath = SetupInputFile(inputType); diff --git a/src/UnitTests/TaskUnixTests.cs b/src/UnitTests/TaskUnixTests.cs index f1e44a2..4d60ed9 100644 --- a/src/UnitTests/TaskUnixTests.cs +++ b/src/UnitTests/TaskUnixTests.cs @@ -3,10 +3,14 @@ namespace AggregateConfigBuildTask.Tests.Unit [TestClass] public class TaskUnixTests : TaskTestBase { - [TestInitialize] - public void TestInitialize() - { - base.TestInitialize(isWindowsMode: false, testPath: "//mnt/drive/MockDirectory"); - } - } -} + [TestInitialize] + public void TestInitialize() + { + if (TestContext is not null) + { + TestContext.CooperativeCancellation = true; + } + base.TestInitialize(isWindowsMode: false, testPath: "//mnt/drive/MockDirectory"); + } + } +} diff --git a/src/UnitTests/TaskWindowsTests.cs b/src/UnitTests/TaskWindowsTests.cs index a67168e..a311760 100644 --- a/src/UnitTests/TaskWindowsTests.cs +++ b/src/UnitTests/TaskWindowsTests.cs @@ -3,10 +3,14 @@ namespace AggregateConfigBuildTask.Tests.Unit [TestClass] public class TaskWindowsTests : TaskTestBase { - [TestInitialize] - public void TestInitialize() - { - base.TestInitialize(isWindowsMode: true, testPath: "C:\\MockDirectory"); - } - } -} + [TestInitialize] + public void TestInitialize() + { + if (TestContext is not null) + { + TestContext.CooperativeCancellation = true; + } + base.TestInitialize(isWindowsMode: true, testPath: "C:\\MockDirectory"); + } + } +}