Skip to content

Commit 010a409

Browse files
committed
Refactor test commands and update log file patterns in CI workflows
1 parent 28493bc commit 010a409

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

.github/workflows/dotnet.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131
dotnet build-server shutdown
132132
dotnet test ./test/coverlet.collector.tests/coverlet.collector.tests.csproj -c ${{env.BuildConfiguration}} --no-build -bl:test.collector.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.projectsample]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" --diag:"./artifacts/log/${{env.BuildConfiguration}}/coverlet.collector.test.diag.log;tracelevel=verbose"
133133
dotnet build-server shutdown
134-
dotnet test ./test/coverlet.integration.tests/coverlet.integration.tests.csproj -c ${{env.BuildConfiguration}} --no-build -bl:test.integration.binlog -- --results-directory "./artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.integration.tests.trx" --diagnostic --diagnostic-output-directory "./artifacts/log/${{env.BuildConfiguration}}" --diagnostic-output-fileprefix "coverlet.integration.tests"
134+
dotnet test ./test/coverlet.integration.tests/coverlet.integration.tests.csproj -c ${{env.BuildConfiguration}} --no-build -bl:test.integration.binlog -- --results-directory "./artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.integration.tests.trx" --diagnostic --diagnostic-output-directory "./artifacts/log/${{env.BuildConfiguration}}"
135135
name: Run unit tests with coverage
136136
env:
137137
MSBUILDDISABLENODEREUSE: 1

eng/publish-coverlet-result-files.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,23 @@ steps:
66
inputs:
77
SourceFolder: '$(Build.SourcesDirectory)/artifacts'
88
Contents: |
9-
**/*.trx
10-
**/*.html
11-
**/*.opencover.xml
12-
**/*.cobertura.xml
13-
**/*.coverage.json
14-
**/*.diag.log
15-
**/log.txt
16-
**/log.datacollector.*.txt
17-
**/log.host.*.txt
18-
**/coverlet.integration.tests.diag*.log
19-
**/coverlet.collector.tests.diag*.log
20-
**/coverlet.msbuild.tasks.tests.diag*.log
21-
**/coverlet.core.coverage.tests.diag*.log
22-
**/coverlet.core.tests.diag*.log
9+
**/*.trx
10+
**/*.html
11+
**/*.opencover.xml
12+
**/*.cobertura.xml
13+
**/*.coverage.json
14+
**/log.txt
15+
**/log.datacollector.*.txt
16+
**/log.host.*.txt
17+
**/coverlet.MTP.unit.tests/**/*.diag
18+
**/coverlet.MTP.unit.tests/**/*.log
19+
**/coverlet.MTP.validation.tests/**/*.diag
20+
**/coverlet.MTP.validation.tests/**/*.log
21+
**/coverlet.core.coverage.tests/**/*.diag
22+
**/coverlet.core.coverage.tests/**/*.log
23+
**/coverlet.core.tests/**/*.diag
24+
**/coverlet.core.tests/**/*.log
25+
**/*.diag
2326
TargetFolder: '$(Build.SourcesDirectory)/artifacts/TestLogs'
2427

2528
- task: CopyFiles@2

eng/test.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ dotnet test test/coverlet.collector.tests/coverlet.collector.tests.csproj -c Deb
3030

3131
# coverlet.integration.tests (default net8.0)
3232
dotnet build-server shutdown
33-
dotnet test test/coverlet.integration.tests/coverlet.integration.tests.csproj -f net8.0 -c Debug --no-build -bl:test.integration.binlog -- --results-directory "$WORKSPACE_ROOT/artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.integration.tests.trx" --diagnostic --diagnostic-output-directory "$WORKSPACE_ROOT/artifacts/log/Debug" --diagnostic-output-fileprefix "coverlet.integration.tests"
33+
dotnet test test/coverlet.integration.tests/coverlet.integration.tests.csproj -f net8.0 -c Debug --no-build -bl:test.integration.binlog -- --results-directory "$WORKSPACE_ROOT/artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.integration.tests.trx" --diagnostic --diagnostic-output-directory "$WORKSPACE_ROOT/artifacts/log/Debug"
3434

3535
dotnet build-server shutdown
3636

@@ -43,8 +43,7 @@ if [[ "$SDK_MAJOR_VERSION" -ge 9 ]]; then
4343
# Check if the net9.0 test dll exists
4444
if [ -f "$WORKSPACE_ROOT/artifacts/bin/coverlet.integration.tests/debug_net9.0/coverlet.integration.tests.dll" ]; then
4545
echo "Executing command for SDK version $SDK_VERSION (9.0+ detected)..."
46-
dotnet test test/coverlet.integration.tests/coverlet.integration.tests.csproj -f net9.0 -c Debug --no-build -bl:test.integration.binlog -- --results-directory "$WORKSPACE_ROOT/artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.integration.tests.trx" --diagnostic --diagnostic-output-directory "$WORKSPACE_ROOT/artifacts/log/Debug" --diagnostic-output-fileprefix "coverlet.integration.tests"
47-
dotnet build-server shutdown
46+
dotnet test test/coverlet.integration.tests/coverlet.integration.tests.csproj -f net9.0 -c Debug --no-build -bl:test.integration.binlog -- --results-directory "$WORKSPACE_ROOT/artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.integration.tests.trx" --diagnostic --diagnostic-output-directory "$WORKSPACE_ROOT/artifacts/log/Debug"
4847
else
4948
echo "Skipping command execution. Required file does not exist."
5049
fi

0 commit comments

Comments
 (0)