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-18Lines changed: 25 additions & 18 deletions
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;
0 commit comments