Test fail-fast strategies as well

This commit is contained in:
Wouter Admiraal 2021-05-17 10:23:48 +02:00 committed by Wouter Admiraal
parent 7ed48e279f
commit 525e8f7b87
3 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1 @@

View File

@ -0,0 +1 @@

View File

@ -50,6 +50,42 @@ if [[ -z "$token" ]]; then
fi
success "New token generated."
info "Test fail-fast if SONAR_TOKEN is omitted..."
docker run -v `pwd`:/github/workspace/ --workdir /github/workspace --network $network sonarsource/sonarqube-scan-action
if [[ $? -eq 0 ]]; then
error "Should have failed fast."
exit 1
fi
success "Correctly failed fast."
info "Test fail-fast if SONAR_HOST_URL is omitted..."
docker run -v `pwd`:/github/workspace/ --workdir /github/workspace --network $network --env SONAR_TOKEN=$token sonarsource/sonarqube-scan-action
if [[ $? -eq 0 ]]; then
error "Should have failed fast."
exit 1
fi
success "Correctly failed fast."
info "Test fail-fast on Gradle project..."
pushd test/gradle-project/
docker run -v `pwd`:/github/workspace/ --workdir /github/workspace --network $network --env SONAR_TOKEN=$token --env SONAR_HOST_URL='http://sonarqube:9000' sonarsource/sonarqube-scan-action
if [[ $? -eq 0 ]]; then
error "Should have failed fast."
exit 1
fi
popd
success "Correctly failed fast."
info "Test fail-fast on Maven project..."
pushd test/maven-project/
docker run -v `pwd`:/github/workspace/ --workdir /github/workspace --network $network --env SONAR_TOKEN=$token --env SONAR_HOST_URL='http://sonarqube:9000' sonarsource/sonarqube-scan-action
if [[ $? -eq 0 ]]; then
error "Should have failed fast."
exit 1
fi
popd
success "Correctly failed fast."
info "Analyze project..."
cd test/example-project/
docker run -v `pwd`:/github/workspace/ --workdir /github/workspace --network $network --env SONAR_TOKEN=$token --env SONAR_HOST_URL='http://sonarqube:9000' sonarsource/sonarqube-scan-action