Skip to content

Commit

Permalink
SQRP-122 Reference SonarQube Community Build
Browse files Browse the repository at this point in the history
  • Loading branch information
anita-stanisz-sonarsource committed Jan 8, 2025
1 parent 06320b9 commit bf07745
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inputs:
required: false
default: .scannerwork/report-task.txt
pollingTimeoutSec:
description: "The maximum time (in seconds) to poll for SonarQube Server's Quality Gate status. Default: 300."
description: "The maximum time (in seconds) to poll for SonarQube's Quality Gate status. Default: 300."
required: false
default: "300"
outputs:
Expand Down
4 changes: 2 additions & 2 deletions script/check-quality-gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ done
printf '\n'

if [[ ${status} == "PENDING" || ${status} == "IN_PROGRESS" ]] && [[ ${SECONDS} -ge ${endTime} ]]; then
echo "Polling timeout reached for waiting for finishing of the Sonar scan! Aborting the check for SonarQube Server's Quality Gate."
echo "Polling timeout reached for waiting for finishing of the Sonar scan! Aborting the check for SonarQube's Quality Gate."
exit 1
fi

Expand All @@ -77,6 +77,6 @@ elif [[ ${qualityGateStatus} == "ERROR" ]]; then
fail "Quality Gate has FAILED.${reset}\n\n${analysisResultMsg}"
else
set_output "quality-gate-status" "FAILED"
fail "Quality Gate not set for the project. Please configure the Quality Gate in SonarQube Server or remove sonarqube-quality-gate action from the workflow."
fail "Quality Gate not set for the project. Please configure the Quality Gate in SonarQube or remove sonarqube-quality-gate action from the workflow."
fi

4 changes: 2 additions & 2 deletions test/check-quality-gate-test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ teardown() {

[ "$status" -eq 1 ]
[[ "${github_out_actual}" = "quality-gate-status=FAILED" ]]
[[ "$output" = *"Quality Gate not set for the project. Please configure the Quality Gate in SonarQube Server or remove sonarqube-quality-gate action from the workflow."* ]]
[[ "$output" = *"Quality Gate not set for the project. Please configure the Quality Gate in SonarQube or remove sonarqube-quality-gate action from the workflow."* ]]
}

@test "fail when polling timeout is reached" {
Expand All @@ -119,7 +119,7 @@ teardown() {
run script/check-quality-gate.sh metadata_tmp 5

[ "$status" -eq 1 ]
[[ "$output" = *"Polling timeout reached for waiting for finishing of the Sonar scan! Aborting the check for SonarQube Server's Quality Gate."* ]]
[[ "$output" = *"Polling timeout reached for waiting for finishing of the Sonar scan! Aborting the check for SonarQube's Quality Gate."* ]]
}

@test "fail when Quality Gate status WARN" {
Expand Down

0 comments on commit bf07745

Please sign in to comment.