-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun-test-case.sh
More file actions
44 lines (32 loc) · 1.31 KB
/
run-test-case.sh
File metadata and controls
44 lines (32 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
# run-test-case.sh
# Contentstack
#
# Created by Uttam Ukkoji on 12/04/21.
# Copyright © 2026 Contentstack. All rights reserved.
echo "Removing files"
TEST_TARGETS=('Contentstack.Management.Core.Unit.Tests' 'Contentstack.Management.Core.Tests')
for i in "${TEST_TARGETS[@]}"
do
rm -rf "$i/TestResults"
done
DATE=$(date +'%d-%b-%Y')
FILE_NAME="Contentstack-DotNet-Test-Case-$DATE"
echo "Running test case..."
dotnet test --logger "trx;LogFileName=Report-$FILE_NAME.trx" --collect:"XPlat code coverage"
echo "Test case Completed..."
echo "Generating code coverage report..."
for i in "${TEST_TARGETS[@]}"
do
cd "$i"
reportgenerator "-reports:**/**/coverage.cobertura.xml" "-targetdir:TestResults/Coverage-$FILE_NAME" -reporttypes:HTML
cd ..
done
echo "Code coverage report generate."
echo "Generating enhanced HTML report (merged TRX + Cobertura)..."
dotnet run --project tools/EnhancedTestReport/EnhancedTestReport.csproj -- \
--trx-dir "Contentstack.Management.Core.Unit.Tests/TestResults" \
--trx-dir "Contentstack.Management.Core.Tests/TestResults" \
--cobertura-dir "Contentstack.Management.Core.Unit.Tests/TestResults" \
--cobertura-dir "Contentstack.Management.Core.Tests/TestResults" \
--output "Contentstack.Management.Core.Unit.Tests/TestResults/EnhancedReport-$FILE_NAME.html"