Skip to content

Create cucumber-integration-tests.yml #2

Create cucumber-integration-tests.yml

Create cucumber-integration-tests.yml #2

name: Cucumber Integration Tests
on:
pull_request:
branches:
- main
jobs:
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Update integration test application properties
run: |
sed -i 's/LogTestRail=false/LogTestRail=true/g' onadata/integration-tests/src/test/resources/application.properties
sed -i 's/baseUrl=<onadata_baseUrl>/baseUrl='$(echo $TEST_ONADATA_BASEURL)'/g' onadata/integration-tests/src/test/resources/application.properties
sed -i 's/TestRailusername=<testrail_username>/TestRailusername='$(echo $TEST_TESTRAIL_USERNAME)'/g' onadata/integration-tests/src/test/resources/application.properties
sed -i 's/TestRailpassword=<testrail_password>/TestRailpassword='$(echo $TEST_TESTRAIL_PASSWORD )'/g' onadata/integration-tests/src/test/resources/application.properties
sed -i 's/TestRailurl=<testrail_url>/TestRailurl='$(echo $TEST_TESTRAIL_URL)'/g' onadata/integration-tests/src/test/resources/application.properties
env:
TEST_ONADATA_BASEURL: ${{ secrets.TEST_ONADATA_BASEURL }}
TEST_TESTRAIL_USERNAME: ${{ secrets.TEST_TESTRAIL_USERNAME }}
TEST_TESTRAIL_PASSWORD: ${{ secrets.TEST_TESTRAIL_PASSWORD }}
TEST_TESTRAIL_URL: ${{ secrets.TEST_TESTRAIL_URL }}
- name: Wait (max 5 mins) for onadata server to be reachable
run: |
count=0; while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' baseUrl/status)" != "200" ]]; do if [[ count -lt 120 ]]; then ((count=count+1)); else exit 1; fi; sleep 5; done
- name: Run integration tests
run: mvn -f onadata/integration-tests/ clean test