Skip to content

Commit d322a0d

Browse files
committed
Create fresh TESTSYNC before each tests
1 parent 3c52985 commit d322a0d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

conf/run_tests.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )"
2424
CONFDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2525
buildDir="$ROOTDIR/build"
26+
SYNC_PROJECT_KEY="TESTSYNC"
2627

2728
[ ! -d "$buildDir" ] && mkdir "$buildDir"
2829

@@ -40,6 +41,10 @@ do
4041
sonar start -i $target && sleep 30
4142
fi
4243
if [ -d "$ROOTDIR/$GEN_LOC/$target/" ]; then
44+
# Recreate a fresh TESTSYNC project for sync tests
45+
curl -X POST -u "$SONAR_TOKEN_TEST_ADMIN_USER:" "$SONAR_HOST_URL_TEST/api/projects/delete?project=$SYNC_PROJECT_KEY"
46+
conf/scan.sh -nolint -Dsonar.host.url=$SONAR_HOST_URL_TEST -Dsonar.projectKey=$SYNC_PROJECT_KEY -Dsonar.projectName=$SYNC_PROJECT_KEY -Dsonar.token="$SONAR_TOKEN_TEST_ADMIN_ANALYSIS"
47+
# Run tests
4348
poetry run coverage run --branch --source="$ROOTDIR" -m pytest "$ROOTDIR/$GEN_LOC/$target/" --junit-xml="$buildDir/xunit-results-$target.xml"
4449
poetry run coverage xml -o "$buildDir/coverage-$target.xml"
4550
fi

0 commit comments

Comments
 (0)