Skip to content
Merged
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 .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
"rollForward": false
}
}
}
}
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
<Uri>https://dev.azure.com/devdiv/DevDiv/_git/vs-code-coverage</Uri>
<Sha>17978349dbb9a89496b27bb0b0acd65d02d64e7c</Sha>
</Dependency>
<Dependency Name="MSTest" Version="4.3.0-preview.26302.5">
<Dependency Name="MSTest" Version="4.3.0-preview.26303.14">
<Uri>https://github.com/microsoft/testfx</Uri>
<Sha>32d35d6c457e3466263e23e8d9551481c974f1dd</Sha>
<Sha>e5487e9800ebba07f2247e70cace9738fe4e917d</Sha>
</Dependency>
<Dependency Name="Microsoft.Testing.Platform" Version="2.3.0-preview.26302.5">
<Dependency Name="Microsoft.Testing.Platform" Version="2.3.0-preview.26303.14">
<Uri>https://github.com/microsoft/testfx</Uri>
<Sha>32d35d6c457e3466263e23e8d9551481c974f1dd</Sha>
<Sha>e5487e9800ebba07f2247e70cace9738fe4e917d</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<MicrosoftDotNetBuildTasksTemplatingPackageVersion>11.0.0-beta.26302.1</MicrosoftDotNetBuildTasksTemplatingPackageVersion>
<MicrosoftTestingExtensionsCodeCoverageVersion>18.8.0-preview.26302.7</MicrosoftTestingExtensionsCodeCoverageVersion>
<!-- empty line to avoid merge conflicts for darc PRs to update CC and MSTest+MTP -->
<MSTestVersion>4.3.0-preview.26302.5</MSTestVersion>
<MicrosoftTestingPlatformVersion>2.3.0-preview.26302.5</MicrosoftTestingPlatformVersion>
<MSTestVersion>4.3.0-preview.26303.14</MSTestVersion>
<MicrosoftTestingPlatformVersion>2.3.0-preview.26303.14</MicrosoftTestingPlatformVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,15 @@ public async Task TagsOnlyMode_EmitsOnlyBuildTags()
await uploader.ConsumeAsync(CreateProducer(), CreateFailedTestNodeUpdateMessage(), CancellationToken.None).ConfigureAwait(false);
await uploader.OnTestSessionFinishingAsync(new TestSessionContext()).ConfigureAwait(false);

CollectionAssert.AreEquivalent(
Assert.AreSequenceEqual(
new[]
{
"##vso[build.addbuildtag]has-crashdump",
"##vso[build.addbuildtag]has-hangdump",
"##vso[build.addbuildtag]has-test-failures",
},
GetFormattedLines());
GetFormattedLines(),
SequenceOrder.InAnyOrder);
Assert.DoesNotContain(line => line.Contains("artifact.upload", StringComparison.Ordinal), GetFormattedLines());
Assert.IsEmpty(GetWarnings());
}
Expand Down Expand Up @@ -134,7 +135,7 @@ public async Task FilesMode_SkipsArtifactsOutsideResultsDirectory()
await uploader.OnTestSessionStartingAsync(new TestSessionContext()).ConfigureAwait(false);
await uploader.OnTestSessionFinishingAsync(new TestSessionContext()).ConfigureAwait(false);

CollectionAssert.AreEqual(
Assert.AreSequenceEqual(
new[] { $"##vso[artifact.upload containerfolder=Artifacts;artifactname=Artifacts]{InResults("inside.trx")}" },
GetFormattedLines());
}
Expand All @@ -158,7 +159,7 @@ public async Task AllMode_EmitsBuildTagsAndArtifactLines()
await uploader.ConsumeAsync(CreateProducer(), CreateFailedTestNodeUpdateMessage(), CancellationToken.None).ConfigureAwait(false);
await uploader.OnTestSessionFinishingAsync(new TestSessionContext()).ConfigureAwait(false);

CollectionAssert.AreEqual(
Assert.AreSequenceEqual(
new[]
{
"##vso[build.addbuildtag]has-crashdump",
Expand Down Expand Up @@ -187,7 +188,7 @@ public async Task IncludeAndExcludeGlobs_AreAppliedToArtifactUploads()
await uploader.OnTestSessionStartingAsync(new TestSessionContext()).ConfigureAwait(false);
await uploader.OnTestSessionFinishingAsync(new TestSessionContext()).ConfigureAwait(false);

CollectionAssert.AreEqual(
Assert.AreSequenceEqual(
new[] { $"##vso[artifact.upload containerfolder=Artifacts;artifactname=Artifacts]{InResults("keep.trx")}" },
GetFormattedLines());
}
Expand All @@ -207,13 +208,14 @@ public async Task ConsumedArtifacts_DetectCrashAndHangDumps()
await uploader.ConsumeAsync(CreateProducer("HangDumpProcessLifetimeHandler", "Hang dump"), CreateFileArtifact(InResults("hang", "dump.log")), CancellationToken.None).ConfigureAwait(false);
await uploader.OnTestSessionFinishingAsync(new TestSessionContext()).ConfigureAwait(false);

CollectionAssert.AreEquivalent(
Assert.AreSequenceEqual(
new[]
{
"##vso[build.addbuildtag]has-crashdump",
"##vso[build.addbuildtag]has-hangdump",
},
GetFormattedLines());
GetFormattedLines(),
SequenceOrder.InAnyOrder);
}

[TestMethod]
Expand Down Expand Up @@ -268,7 +270,7 @@ public async Task MissingTfBuild_EmitsWarningAndSkipsOutput()
await uploader.ConsumeAsync(CreateProducer(), CreateFailedTestNodeUpdateMessage(), CancellationToken.None).ConfigureAwait(false);
await uploader.OnTestSessionFinishingAsync(new TestSessionContext()).ConfigureAwait(false);

CollectionAssert.AreEqual(
Assert.AreSequenceEqual(
new[] { "Azure DevOps artifact upload was requested, but TF_BUILD is not set to 'true'; skipping Azure DevOps artifact upload and build tags." },
GetWarnings());
Assert.IsEmpty(GetFormattedLines());
Expand Down Expand Up @@ -329,7 +331,7 @@ public async Task ArtifactUploadPaths_AreEscaped()
await uploader.OnTestSessionStartingAsync(new TestSessionContext()).ConfigureAwait(false);
await uploader.OnTestSessionFinishingAsync(new TestSessionContext()).ConfigureAwait(false);

CollectionAssert.AreEqual(
Assert.AreSequenceEqual(
new[] { $"##vso[artifact.upload containerfolder=Artifacts;artifactname=Artifacts]{escapedSpecialPath}" },
GetFormattedLines());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ public async Task AzureDevOpsTestResultsClient_HonorsRetryAfterOn429()
Assert.AreEqual(7, runId);
Assert.HasCount(1, task.DelayCalls);
Assert.AreEqual(TimeSpan.FromSeconds(3), task.DelayCalls[0]);
CollectionAssert.AreEqual(new[] { "send:1", "delay:3", "send:2" }, events);
Assert.AreSequenceEqual(new[] { "send:1", "delay:3", "send:2" }, events);
}

[TestMethod]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ public async Task OnTestHostProcessExitedAsync_OnlyPublishesDumpsThatAppearedDur
.OrderBy(static p => p, StringComparer.Ordinal)
.ToArray();
string[] expected = new[] { fresh1, fresh2 }.OrderBy(static p => p, StringComparer.Ordinal).ToArray();
CollectionAssert.AreEqual(expected, publishedDumps);
Assert.AreSequenceEqual(expected, publishedDumps);
}
finally
{
Expand Down Expand Up @@ -499,7 +499,7 @@ public async Task OnTestHostProcessExitedAsync_PatternWithMultiplePlaceholders_D
.OfType<FileArtifact>()
.Select(static a => a.FileInfo.FullName)
.ToArray();
CollectionAssert.AreEqual(new[] { testhostDump }, publishedDumps);
Assert.AreSequenceEqual(new[] { testhostDump }, publishedDumps);

// The "expected dump not found" warning must NOT be emitted: the testhost dump was
// recognized via the regex even though `expectedDumpFile` (literal `%p` substitution)
Expand Down Expand Up @@ -550,7 +550,7 @@ public async Task OnTestHostProcessExitedAsync_PatternWithRepeatedPidPlaceholder
.OfType<FileArtifact>()
.Select(static a => a.FileInfo.FullName)
.ToArray();
CollectionAssert.AreEqual(new[] { testhostDump }, publishedDumps);
Assert.AreSequenceEqual(new[] { testhostDump }, publishedDumps);
string captured = string.Join(" | ", outputDevice.Displayed);
Assert.DoesNotContain("dump_555_backup_555.dmp", captured, "CannotFindExpectedCrashDumpFile must not be displayed when the testhost dump was recognized via the regex.");
}
Expand Down Expand Up @@ -602,7 +602,7 @@ public async Task OnTestHostProcessExitedAsync_TesthostAndChildBothCrashWithMult
.OrderBy(static p => p, StringComparer.Ordinal)
.ToArray();
string[] expected = new[] { testhostDump, childDump }.OrderBy(static p => p, StringComparer.Ordinal).ToArray();
CollectionAssert.AreEqual(expected, publishedDumps);
Assert.AreSequenceEqual(expected, publishedDumps);
string captured = string.Join(" | ", outputDevice.Displayed);
Assert.DoesNotContain("Dump_%e_123.dmp", captured, "CannotFindExpectedCrashDumpFile must not be displayed when the testhost dump was recognized via the regex.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void RoundTrip_AllFieldsPopulated_ReadsBackEqual()
Assert.AreEqual(TrxStreamMessageKind.DebugOrTrace, round.Messages[2].Kind);
Assert.IsNull(round.Messages[2].Message);
Assert.IsNotNull(round.Categories);
CollectionAssert.AreEqual(new[] { "cat-a", "cat-b" }, round.Categories.ToArray());
Assert.AreSequenceEqual(new[] { "cat-a", "cat-b" }, round.Categories.ToArray());
Assert.IsNotNull(round.Metadata);
Assert.AreEqual("k", round.Metadata[0].Key);
Assert.AreEqual("v", round.Metadata[0].Value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public void TryGetCommandLineOptionArguments_SingleScalarValue_ReturnsSingleElem

Assert.IsTrue(configuration.TryGetCommandLineOptionArguments("hangdump-timeout", out string[]? arguments));
Assert.IsNotNull(arguments);
CollectionAssert.AreEqual(new[] { "5m" }, arguments);
Assert.AreSequenceEqual(new[] { "5m" }, arguments);
}

[TestMethod]
Expand All @@ -124,7 +124,7 @@ public void TryGetCommandLineOptionArguments_IndexedEntries_ReturnsContiguousArr

Assert.IsTrue(configuration.TryGetCommandLineOptionArguments("filter-uid", out string[]? arguments));
Assert.IsNotNull(arguments);
CollectionAssert.AreEqual(new[] { "a", "b", "c" }, arguments);
Assert.AreSequenceEqual(new[] { "a", "b", "c" }, arguments);
}

[TestMethod]
Expand All @@ -140,7 +140,7 @@ public void TryGetCommandLineOptionArguments_IndexedEntriesWinOverBareKey()

Assert.IsTrue(configuration.TryGetCommandLineOptionArguments("foo", out string[]? arguments));
Assert.IsNotNull(arguments);
CollectionAssert.AreEqual(new[] { "indexed" }, arguments);
Assert.AreSequenceEqual(new[] { "indexed" }, arguments);
}

[TestMethod]
Expand Down Expand Up @@ -175,14 +175,14 @@ public async Task CommandLineHandler_DelegatesToConfiguration_WhenSupplied()
Assert.IsTrue(options.IsOptionSet("filter-uid"));

Assert.IsTrue(options.TryGetOptionArgumentList("hangdump-timeout", out string[]? timeoutArgs));
CollectionAssert.AreEqual(new[] { "10m" }, timeoutArgs);
Assert.AreSequenceEqual(new[] { "10m" }, timeoutArgs);

Assert.IsTrue(options.TryGetOptionArgumentList("hangdump", out string[]? hangdumpArgs));
Assert.IsNotNull(hangdumpArgs);
Assert.IsEmpty(hangdumpArgs);

Assert.IsTrue(options.TryGetOptionArgumentList("filter-uid", out string[]? filterArgs));
CollectionAssert.AreEqual(new[] { "a", "b" }, filterArgs);
Assert.AreSequenceEqual(new[] { "a", "b" }, filterArgs);
}

private static IConfiguration BuildConfiguration(IReadOnlyList<KeyValuePair<string, string?>> entries)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public async Task EnumerateCommandLineOptions_ScalarString_YieldsSingleArgumentE
JsonCommandLineOptionEntry entry = Assert.ContainsSingle(entries);
Assert.AreEqual("timeout", entry.OptionName);
Assert.IsFalse(entry.IsDisabled);
CollectionAssert.AreEqual(new[] { "30s" }, entry.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "30s" }, entry.Arguments.ToArray());
}

[TestMethod]
Expand Down Expand Up @@ -88,7 +88,7 @@ public async Task EnumerateCommandLineOptions_Array_YieldsAllArguments()
JsonCommandLineOptionEntry entry = Assert.ContainsSingle(entries);
Assert.AreEqual("filter-uid", entry.OptionName);
Assert.IsFalse(entry.IsDisabled);
CollectionAssert.AreEqual(new[] { "a", "b", "c" }, entry.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "a", "b", "c" }, entry.Arguments.ToArray());
}

[TestMethod]
Expand Down Expand Up @@ -164,7 +164,7 @@ public async Task EnumerateCommandLineOptions_MixedEntries_AllReturned()
Assert.HasCount(4, entries);

JsonCommandLineOptionEntry timeout = entries.Single(e => e.OptionName == "timeout");
CollectionAssert.AreEqual(new[] { "30s" }, timeout.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "30s" }, timeout.Arguments.ToArray());
Assert.IsFalse(timeout.IsDisabled);

JsonCommandLineOptionEntry noBanner = entries.Single(e => e.OptionName == "no-banner");
Expand All @@ -175,7 +175,7 @@ public async Task EnumerateCommandLineOptions_MixedEntries_AllReturned()
Assert.IsTrue(hangdump.IsDisabled);

JsonCommandLineOptionEntry filterUid = entries.Single(e => e.OptionName == "filter-uid");
CollectionAssert.AreEqual(new[] { "a", "b" }, filterUid.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "a", "b" }, filterUid.Arguments.ToArray());
}

// ---------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void GetCurrentExecutableInfo_AppHost_NoPassedArgs_UsesEnvironmentArgsSki

ExecutableInfo executable = info.GetCurrentExecutableInfo();

CollectionAssert.AreEqual(new[] { "--filter", "MyTest" }, executable.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "--filter", "MyTest" }, executable.Arguments.ToArray());
}

[TestMethod]
Expand All @@ -35,7 +35,7 @@ public void GetCurrentExecutableInfo_AppHost_WithPassedArgs_UsesPassedArgsInstea

ExecutableInfo executable = info.GetCurrentExecutableInfo();

CollectionAssert.AreEqual(new[] { "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
}

[TestMethod]
Expand All @@ -60,7 +60,7 @@ public void GetCurrentExecutableInfo_DotnetMuxer_NoPassedArgs_PrependsExecToEnvi

ExecutableInfo executable = info.GetCurrentExecutableInfo();

CollectionAssert.AreEqual(new[] { "exec", "myapp.dll", "--filter", "MyTest" }, executable.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "exec", "myapp.dll", "--filter", "MyTest" }, executable.Arguments.ToArray());
}

[TestMethod]
Expand All @@ -74,7 +74,7 @@ public void GetCurrentExecutableInfo_DotnetMuxer_WithPassedArgs_KeepsDllPathAndU

ExecutableInfo executable = info.GetCurrentExecutableInfo();

CollectionAssert.AreEqual(new[] { "exec", "myapp.dll", "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "exec", "myapp.dll", "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
}

[TestMethod]
Expand All @@ -86,7 +86,7 @@ public void GetCurrentExecutableInfo_DotnetMuxer_WithPassedArgsAndEmptyEnvironme

ExecutableInfo executable = info.GetCurrentExecutableInfo();

CollectionAssert.AreEqual(new[] { "exec", "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "exec", "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
}

[TestMethod]
Expand All @@ -98,7 +98,7 @@ public void GetCurrentExecutableInfo_MonoMuxer_NoPassedArgs_UsesEnvironmentArgsA

ExecutableInfo executable = info.GetCurrentExecutableInfo();

CollectionAssert.AreEqual(new[] { "myapp.dll", "--filter", "MyTest" }, executable.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "myapp.dll", "--filter", "MyTest" }, executable.Arguments.ToArray());
}

[TestMethod]
Expand All @@ -112,7 +112,7 @@ public void GetCurrentExecutableInfo_MonoMuxer_WithPassedArgs_KeepsDllPathAndUse

ExecutableInfo executable = info.GetCurrentExecutableInfo();

CollectionAssert.AreEqual(new[] { "myapp.dll", "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "myapp.dll", "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
}

[TestMethod]
Expand All @@ -124,7 +124,7 @@ public void GetCurrentExecutableInfo_MonoMuxer_WithPassedArgsAndEmptyEnvironment

ExecutableInfo executable = info.GetCurrentExecutableInfo();

CollectionAssert.AreEqual(new[] { "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
}

[TestMethod]
Expand All @@ -142,7 +142,7 @@ public void GetCurrentExecutableInfo_PassedArgsAreSnapshotted_CallerMutationDoes

ExecutableInfo executable = info.GetCurrentExecutableInfo();

CollectionAssert.AreEqual(new[] { "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
Assert.AreSequenceEqual(new[] { "--retry-failed-tests", "1" }, executable.Arguments.ToArray());
}

private static Mock<IEnvironment> CreateDotnetMuxerEnvironment(string[] commandLineArgs)
Expand Down
Loading