-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathstart_testing.sh
31 lines (25 loc) · 950 Bytes
/
start_testing.sh
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
#!/bin/bash
source /home/bubify/.bashrc
cd /home/bubify
sudo chown -R bubify:bubify .m2
cd backend
export TERM=xterm
rm -rf target
# Start tests based on the argument
if [ "$TEST_TYPE" == "unit" ]; then
echo "Running only unit tests..."
mvn test -Dspring.profiles.active=test -Dmaven.test.failure.ignore=true
elif [ "$TEST_TYPE" == "integration" ]; then
echo "Running only integration tests..."
mvn verify -Dspring.profiles.active=test -Dmaven.test.failure.ignore=true -DskipUnit=true
else
echo "Running all tests..."
mvn verify -Dspring.profiles.active=test -Dmaven.test.failure.ignore=true
fi
# Create JaCoCo report
mvn jacoco:report
# Copy and overwrite test reports in home directory
mkdir -p /home/bubify/backend/test-reports
cp -rf target/failsafe-reports /home/bubify/backend/test-reports
cp -rf target/surefire-reports /home/bubify/backend/test-reports
cp -rf target/site/jacoco /home/bubify/backend/test-reports