Skip to content

Commit

Permalink
First experiment of a test written as GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
henryju committed May 13, 2024
1 parent 6abcb25 commit d3550ee
Showing 1 changed file with 33 additions and 7 deletions.
40 changes: 33 additions & 7 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,36 @@ jobs:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- run: ./test/run-qa.sh
timeout-minutes: 5
services:
sonarqube:
image: sonarqube:8.9-community
ports:
- 9000:9000
# - run: ./test/run-qa.sh
# timeout-minutes: 5

- run: mkdir -p ./integrationTest1
- run: mkdir -p ./integrationTest1/baseDir
- name: Test that inputs are correctly passed to the scanner - Run
uses: ./
with:
args: -Dsonar.someArg=aValue -Dsonar.scanner.dumpToFile=./integrationTest1/output.properties
projectBaseDir: ./integrationTest1/baseDir
env:
SONAR_HOST_URL: http://not_actually_used

- name: Test that inputs are correctly passed to the scanner - Assert
run: |
if [ ! -f ./integrationTest1/output.properties ]; then
echo "File ./integrationTest1/output.properties not found"
exit 1
fi
if ! grep -q "sonar.someArg=aValue" ./integrationTest1/output.properties; then
echo "Property sonar.someArg=aValue not found in ./integrationTest1/output.properties"
exit 1
fi
if ! grep -q "sonar.projectBaseDir=.*/integrationTest1/baseDir" ./integrationTest1/output.properties; then
echo "Property sonar.projectBaseDir=./integrationTest1/baseDir not found in ./integrationTest1/output.properties"
cat ./integrationTest1/output.properties
exit 1
fi
# services:
# sonarqube:
# image: sonarqube:8.9-community
# ports:
# - 9000:9000

0 comments on commit d3550ee

Please sign in to comment.