Skip to content

Commit

Permalink
poll sonar for start
Browse files Browse the repository at this point in the history
  • Loading branch information
jdamata committed Oct 5, 2024
1 parent 16b33ec commit d4104ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/acceptance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
terraform_wrapper: false
- name: run acceptance tests
run: |
while [[ "$(curl -s -o /dev/null -w "%{http_code}" admin:admin@localhost:9000/api/system/info)" != "200" ]]; do echo "waiting for SonarQube to start"; sleep 15; done
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
env:
TF_ACC: 1
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export GO111MODULE=on
export TF_LOG=DEBUG
SRC=$(shell find . -name '*.go')
SONARQUBE_IMAGE?=sonarqube:lts-developer
SONARQUBE_IMAGE?=sonarqube:latest
SONARQUBE_START_SLEEP?=60

.PHONY: all vet build test
Expand All @@ -19,8 +19,7 @@ vet:

testacc:
docker run --name sonarqube1 -d -p 9001:9000 ${SONARQUBE_IMAGE}
# timeout 300 bash -c 'while [[ "curl -s -o /dev/null -w ''%{http_code}'' localhost:9001/api/system/info" != "401" ]]; do echo "waiting for sonarqube to start"; sleep 15; done'
sleep ${SONARQUBE_START_SLEEP}
timeout 300 bash -c 'while [[ "$$(curl -s -o /dev/null -w "%{http_code}" admin:admin@localhost:9001/api/system/info)" != "200" ]]; do echo "waiting for SonarQube to start"; sleep 15; done'
-TF_ACC=1 SONAR_HOST=http://localhost:9001 SONAR_USER=admin SONAR_PASS=admin go test -race -coverprofile=coverage.txt -covermode=atomic ./...
docker stop sonarqube1
docker rm sonarqube1

0 comments on commit d4104ab

Please sign in to comment.