Skip to content

Commit b5d86b4

Browse files
committed
feat: Update build scripts to improve workspace directory handling and logging
1 parent 5c644ab commit b5d86b4

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

eng/build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ set -e
1515
# For running tests, use the separate test.sh script.
1616

1717
# Get the workspace root directory
18-
WORKSPACE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
18+
# Get the workspace root directory (parent of the script's directory)
19+
WORKSPACE_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
1920
cd "$WORKSPACE_ROOT"
21+
echo "Starting build... (root folder: ${PWD##*/})"
2022

2123
echo "Please cleanup '/tmp' folder if needed!"
2224

@@ -25,6 +27,7 @@ dotnet build-server shutdown
2527
pkill -f "coverlet.core.tests.exe" 2>/dev/null || true
2628

2729
# Delete coverage files
30+
echo "Cleaning up coverage files and build artifacts..."
2831
find . -name "coverage.cobertura.xml" -delete 2>/dev/null || true
2932
find . -name "coverage.json" -delete 2>/dev/null || true
3033
find . -name "coverage.net8.0.json" -delete 2>/dev/null || true

eng/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ steps:
6565
parameters:
6666
reports: $(Build.SourcesDirectory)\**\*.opencover.xml
6767
condition: and(succeededORFailed(), eq(variables['buildConfiguration'], 'debug'), eq(variables['agent.os'], 'Windows_NT'))
68+
minimumLineCoverage: 70
6869
assemblyfilters: '-xunit;-coverlet.testsubject;-Coverlet.Tests.ProjectSample.*;-coverlet.core.tests.samples.netstandard;-coverletsamplelib.integration.template;-coverlet.tests.utils'
6970

eng/publish-coverage-results.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ parameters:
77
assemblyfilters: '-xunit*'
88
classfilters: ''
99
breakBuild: false
10-
minimumLineCoverage: 70
10+
minimumLineCoverage: 90
1111

1212
steps:
1313
- task: Powershell@2

eng/test.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/bin/bash
22
set -e
33

4-
# Get the workspace root directory
5-
WORKSPACE_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
4+
# Get the workspace root directory (parent of the script's directory)
5+
WORKSPACE_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
66
cd "$WORKSPACE_ROOT"
7+
echo "Starting tests... (root folder: ${PWD##*/})"
78

89
# Kill existing test processes if they exist
910
pkill -f "coverlet.core.tests.dll" 2>/dev/null || true
@@ -15,7 +16,7 @@ pkill -f "coverlet.integration.tests.dll" 2>/dev/null || true
1516
dotnet build-server shutdown
1617
dotnet test test/coverlet.core.tests/coverlet.core.tests.csproj -c Debug --no-build -bl:test.core.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.projectsample]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" -- --results-directory "$WORKSPACE_ROOT/artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.core.tests.trx" --diagnostic --diagnostic-output-directory "$WORKSPACE_ROOT/artifacts/log/Debug" --diagnostic-output-fileprefix "coverlet.core.tests"
1718

18-
# coverlet.core.coverage.tests !!!! does not work on Linux (Dev Container) maybe takes hours !!!!
19+
# coverlet.core.coverage.tests !!!! does not work on Linux (Dev Container) VS debug assemblies not available !!!!
1920
# dotnet build-server shutdown
2021
# dotnet test test/coverlet.core.coverage.tests/coverlet.core.coverage.tests.csproj -c Debug --no-build -bl:test.core.coverage.binlog /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[coverlet.core.tests.samples.netstandard]*%2c[coverlet.tests.projectsample]*" /p:ExcludeByAttribute="GeneratedCodeAttribute" -- --results-directory "$WORKSPACE_ROOT/artifacts/reports" --report-xunit-trx --report-xunit-trx-filename "coverlet.core.coverage.tests.trx" --diagnostic --diagnostic-output-directory "$WORKSPACE_ROOT/artifacts/log/Debug" --diagnostic-output-fileprefix "coverlet.core.coverage.tests"
2122

0 commit comments

Comments
 (0)