Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2
updates:
- package-ecosystem: "nuget"
directory: "/src/"
directory: "/"
schedule:
interval: "monthly"
labels:
Expand Down
22 changes: 11 additions & 11 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@
</PropertyGroup>
<!-- Build packages-->
<ItemGroup>
<PackageVersion Include="Microsoft.Build.Framework" Version="17.14.8" PrivateAssets="all" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.14.8" PrivateAssets="all" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.14.28" PrivateAssets="all" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.14.28" PrivateAssets="all" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="all" />
</ItemGroup>
<!-- Runtime packages -->
<ItemGroup>
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.9" PrivateAssets="all" />
<PackageVersion Include="System.IO.Pipelines" Version="9.0.9" PrivateAssets="all" />
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.9" PrivateAssets="all" />
<PackageVersion Include="System.Text.Json" Version="9.0.9" PrivateAssets="all" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.10" PrivateAssets="all" />
<PackageVersion Include="System.IO.Pipelines" Version="9.0.10" PrivateAssets="all" />
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.10" PrivateAssets="all" />
<PackageVersion Include="System.Text.Json" Version="9.0.10" PrivateAssets="all" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" PrivateAssets="all" GeneratePathProperty="true" />
<PackageVersion Include="YamlDotNet.System.Text.Json" Version="1.6.6" PrivateAssets="all" />
</ItemGroup>
<!-- Test packages -->
<ItemGroup>
<PackageVersion Include="AggregateConfigBuildTask" Version="1.0.8" />
<PackageVersion Include="coverlet.collector" Version="6.0.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="MSTest.TestAdapter" Version="3.10.5" />
<PackageVersion Include="MSTest.TestFramework" Version="3.10.5" />
<PackageVersion Include="MSTest.TestAdapter" Version="4.0.1" />
<PackageVersion Include="MSTest.TestFramework" Version="4.0.1" />
</ItemGroup>
<!-- Global packages -->
<ItemGroup>
<GlobalPackageReference Include="AsyncFixer" Version="1.6.0" />
<GlobalPackageReference Include="Meziantou.Analyzer" Version="2.0.222" />
<GlobalPackageReference Include="Meziantou.Analyzer" Version="2.0.227" />
<GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
<GlobalPackageReference Include="ReferenceTrimmer" Version="3.3.12" />
<GlobalPackageReference Include="Roslynator.Analyzers" Version="4.14.0" />
<GlobalPackageReference Include="Roslynator.Analyzers" Version="4.14.1" />
</ItemGroup>
</Project>
9 changes: 5 additions & 4 deletions src/UnitTests/TaskTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@
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<bool>());
Assert.IsTrue(parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value<bool>());
}

[TestMethod]
Expand Down Expand Up @@ -401,7 +401,7 @@
Assert.AreEqual("String", parameters.GetValue("options", comparison)["value"].First()["source"].Type.ToString());
Assert.AreEqual("file1", parameters.GetValue("options", comparison)["value"].First()["source"].Value<string>());
Assert.AreEqual("Boolean", parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Type.ToString());
Assert.AreEqual(true, parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value<bool>());
Assert.IsTrue(parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value<bool>());
}

[TestMethod]
Expand Down Expand Up @@ -456,12 +456,12 @@
Assert.AreEqual("String", parameters.GetValue("options", comparison)["value"].First()["source"].Type.ToString());
Assert.AreEqual("file1.parameters", parameters.GetValue("options", comparison)["value"].First()["source"].Value<string>());
Assert.AreEqual("Boolean", parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Type.ToString());
Assert.AreEqual(true, parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value<bool>());
Assert.IsTrue(parameters.GetValue("options", comparison)["value"].First()["isEnabled"].Value<bool>());
}

[TestMethod]
[Description("Stress test to verify the source property is correctly added for 1,000 files with 10 options each.")]
[Timeout(60000)]

Check failure on line 464 in src/UnitTests/TaskTestBase.cs

View workflow job for this annotation

GitHub Actions / build

Use 'CooperativeCancellation = true' with '[Timeout]' to enable cooperative cancellation behavior (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0045)

Check failure on line 464 in src/UnitTests/TaskTestBase.cs

View workflow job for this annotation

GitHub Actions / build

Use 'CooperativeCancellation = true' with '[Timeout]' to enable cooperative cancellation behavior (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0045)
public void StressTest_ShouldAddSourcePropertyManyFiles()
{
// Arrange: Prepare sample YAML data.
Expand Down Expand Up @@ -521,7 +521,8 @@
[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);
Expand Down
18 changes: 11 additions & 7 deletions src/UnitTests/TaskUnixTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
[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;

Check failure on line 11 in src/UnitTests/TaskUnixTests.cs

View workflow job for this annotation

GitHub Actions / build

'TestContext' does not contain a definition for 'CooperativeCancellation' and no accessible extension method 'CooperativeCancellation' accepting a first argument of type 'TestContext' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 11 in src/UnitTests/TaskUnixTests.cs

View workflow job for this annotation

GitHub Actions / build

'TestContext' does not contain a definition for 'CooperativeCancellation' and no accessible extension method 'CooperativeCancellation' accepting a first argument of type 'TestContext' could be found (are you missing a using directive or an assembly reference?)
}
base.TestInitialize(isWindowsMode: false, testPath: "//mnt/drive/MockDirectory");
}
}
}
18 changes: 11 additions & 7 deletions src/UnitTests/TaskWindowsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
[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;

Check failure on line 11 in src/UnitTests/TaskWindowsTests.cs

View workflow job for this annotation

GitHub Actions / build

'TestContext' does not contain a definition for 'CooperativeCancellation' and no accessible extension method 'CooperativeCancellation' accepting a first argument of type 'TestContext' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 11 in src/UnitTests/TaskWindowsTests.cs

View workflow job for this annotation

GitHub Actions / build

'TestContext' does not contain a definition for 'CooperativeCancellation' and no accessible extension method 'CooperativeCancellation' accepting a first argument of type 'TestContext' could be found (are you missing a using directive or an assembly reference?)
}
base.TestInitialize(isWindowsMode: true, testPath: "C:\\MockDirectory");
}
}
}
2 changes: 1 addition & 1 deletion test/IntegrationTests/IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Version Condition=" '$(Version)' == '' ">0.0.1</Version>
<Version Condition=" '$(Version)' == '' ">0.0.1</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading