Skip to content

Commit ddacb24

Browse files
add run specific test capability and CrashTestHostProcessorHelper (dotnet#4744)
* only run spefic test in CI for test * add crash test host process helper * delete crash test host process helper
1 parent 55efe1c commit ddacb24

File tree

4 files changed

+31
-2
lines changed

4 files changed

+31
-2
lines changed

build.proj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@
102102
Targets="RunCITests" />
103103
</Target>
104104

105+
<Target Name="RunSpecificTests">
106+
<MSBuild Projects="test\run-tests.proj"
107+
Targets="RunSpecificTests" />
108+
</Target>
109+
105110
<Target Name="RunNightlyBuildTests">
106111
<MSBuild Projects="test\run-night-build-tests.proj"
107112
Targets="RunNightlyBuildTests" />

build/ci/job-template.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ parameters:
77
codeCoverage: false
88
nightlyBuild: false
99
innerLoop: false
10+
runSpecific: false
1011
container: ''
1112

1213
jobs:
@@ -66,8 +67,12 @@ jobs:
6667
- script: ${{ parameters.buildScript }} -- /t:DownloadExternalTestFiles /p:IncludeBenchmarkData=$(_includeBenchmarkData)
6768
displayName: Download Benchmark Data
6869
- ${{ if eq(parameters.innerLoop, 'false') }}:
69-
- script: ${{ parameters.buildScript }} -$(_configuration) -runtests -coverage=${{ parameters.codeCoverage }}
70-
displayName: Run All Tests.
70+
- ${{ if eq(parameters.runSpecific, 'false') }}:
71+
- script: ${{ parameters.buildScript }} -$(_configuration) -runtests -coverage=${{ parameters.codeCoverage }}
72+
displayName: Run All Tests.
73+
- ${{ if eq(parameters.runSpecific, 'true') }}:
74+
- script: ${{ parameters.buildScript }} -$(_configuration) -runSpecificTests -coverage=${{ parameters.codeCoverage }}
75+
displayName: Run Specific Tests.
7176
- ${{ if eq(parameters.innerLoop, 'true') }}:
7277
- script: ${{ parameters.buildScript }} -$(_configuration) -runCITests -coverage=${{ parameters.codeCoverage }}
7378
displayName: Run CI Tests.

config.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@
8484
"values": [],
8585
"defaultValue": ""
8686
},
87+
"RunSpecificTests": {
88+
"description": "MsBuild target that run specific tests only. Call this after building.",
89+
"valueType": "target",
90+
"values": [],
91+
"defaultValue": ""
92+
},
8793
"RunNightlyBuildTests": {
8894
"description": "MsBuild target that run the nightly build tests. Call this after building.",
8995
"valueType": "target",
@@ -178,6 +184,12 @@
178184
"RunCITests": "default"
179185
}
180186
},
187+
"runSpecificTests": {
188+
"description": "Runs Specific tests. Call this after building.",
189+
"settings": {
190+
"RunSpecificTests": "default"
191+
}
192+
},
181193
"runnightlybuildtests": {
182194
"description": "Runs the nightly build tests. Call this after building.",
183195
"settings": {

test/run-tests.proj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020
Properties="VSTestNoBuild=true;VSTestBlame=true;VSTestTestCaseFilter=Category!=SkipInCI" />
2121
</Target>
2222

23+
<Target Name="RunSpecificTests">
24+
<Message Importance="High" Text="Running Specific tests ..." />
25+
<MSBuild Targets="VSTest"
26+
Projects="@(Project)"
27+
Properties="VSTestNoBuild=true;VSTestBlame=true;VSTestTestCaseFilter=Category=RunSpecificTest" />
28+
</Target>
29+
2330
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
2431

2532
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.traversal.targets))\dir.traversal.targets" />

0 commit comments

Comments
 (0)