-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathrun-test-case.sh
More file actions
36 lines (25 loc) · 823 Bytes
/
run-test-case.sh
File metadata and controls
36 lines (25 loc) · 823 Bytes
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
#!/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."