You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: azure-pipelines.yml
+25-18
Original file line number
Diff line number
Diff line change
@@ -94,14 +94,17 @@ stages:
94
94
displayName: Build
95
95
96
96
- ${{ if eq(parameters.SkipTests, False) }}:
97
-
# -ci is allowing to import some environment variables and some required configurations
98
-
# -nobl avoids overwriting build binlog with binlog from tests
99
-
- script: Test.cmd
100
-
-configuration $(_BuildConfig)
101
-
-ci
102
-
-nobl
97
+
98
+
# Because the build step is using -ci flag, restore is done in a local .packages directory.
99
+
# We need to pass NUGET_PACKAGES so that when dotnet test is doing evaluation phase on the projects, it can resolve .props/.targets from packages and import them.
100
+
# Otherwise, props/targets are not imported. It's important that they are imported so that IsTestingPlatformApplication ends up being set.
101
+
- script: $(Build.SourcesDirectory)/.dotnet/dotnet test -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\TestStep.binlog
# Because the build step is using -ci flag, restore is done in a local .packages directory.
164
+
# We need to pass NUGET_PACKAGES so that when dotnet test is doing evaluation phase on the projects, it can resolve .props/.targets from packages and import them.
165
+
# Otherwise, props/targets are not imported. It's important that they are imported so that IsTestingPlatformApplication ends up being set.
166
+
- script: $(Build.SourcesDirectory)/.dotnet/dotnet test --solution NonWindowsTests.slnf -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\TestStep.binlog
# Because the build step is using -ci flag, restore is done in a local .packages directory.
221
+
# We need to pass NUGET_PACKAGES so that when dotnet test is doing evaluation phase on the projects, it can resolve .props/.targets from packages and import them.
222
+
# Otherwise, props/targets are not imported. It's important that they are imported so that IsTestingPlatformApplication ends up being set.
223
+
- script: $(Build.SourcesDirectory)/.dotnet/dotnet test --solution NonWindowsTests.slnf -c $(_BuildConfig) --no-build -bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\TestStep.binlog
// In the real-world issue, access to path C:\Program Files\dotnet\ is denied, but we run this from a local .dotnet folder, where we have write access.
30
30
// So instead of relying on the test run failing because of AccessDenied, we check the output, and see where TestResults were placed.
@@ -68,6 +68,10 @@ we end up with a -dev or -ci version which will lose resolution over -preview de
68
68
</ItemGroup>
69
69
</Project>
70
70
71
+
#file dotnet.config
72
+
[dotnet.test:runner]
73
+
name= "VSTest"
74
+
71
75
#file UnitTest1.cs
72
76
73
77
using Microsoft.VisualStudio.TestTools.UnitTesting;
Copy file name to clipboardexpand all lines: test/IntegrationTests/MSTest.Acceptance.IntegrationTests/RunsettingsTests.cs
+6-2
Original file line number
Diff line number
Diff line change
@@ -71,8 +71,12 @@ public async Task UnsupportedRunSettingsEntriesAreFlagged_Localization(string? t
71
71
switch(expectedLocale)
72
72
{
73
73
case"fr-FR":
74
-
testHostResult.AssertOutputContains("Les loggers Runsettings ne sont pas pris en charge par Microsoft.Testing.Platform et seront ignorés");
75
-
testHostResult.AssertOutputContains("Les datacollecteurs Runsettings ne sont pas pris en charge par Microsoft.Testing.Platform et seront ignorés");
74
+
// Using regex for the "é" of ignorés as something with encoding doesn't work properly.
75
+
// The é shows correctly when invoking with Arcade, but not with dotnet test.
76
+
// This is probably because Arcade infra uses Exec MSBuild task, which seems to be having extra logic around handling encoding.
77
+
// See https://github.com/dotnet/msbuild/blob/bcc2dc6a6509ffb63f1253a9bbbaaa233bd53a50/src/Tasks/Exec.cs
78
+
testHostResult.AssertOutputMatchesRegex(@"Les loggers Runsettings ne sont pas pris en charge par Microsoft\.Testing\.Platform et seront ignor.*?s");
79
+
testHostResult.AssertOutputMatchesRegex(@"Les datacollecteurs Runsettings ne sont pas pris en charge par Microsoft\.Testing\.Platform et seront ignor.*?s");
76
80
break;
77
81
case"it-IT":
78
82
testHostResult.AssertOutputContains("I logger Runsettings non sono supportati da Microsoft.Testing.Platform e verranno ignorati");
Copy file name to clipboardexpand all lines: test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Helpers/AcceptanceTestBase.cs
0 commit comments