backport: Fix/optionset preheat n1 master #6756
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Run analytics api tests [Doris] | |
| env: | |
| # This is to make sure Maven don't timeout fetching dependencies. See: https://github.com/actions/virtual-environments/issues/1499 | |
| MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=125 | |
| # PR → quiet (unless ci-verbose label), push/schedule → info, workflow_dispatch → user choice | |
| MAVEN_ARGS: ${{ (inputs.maven_log == 'debug' && '-X') || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci-verbose') && '-q') || (inputs.maven_log == 'quiet' && '-q') || '' }} | |
| on: | |
| pull_request: | |
| types: [opened, labeled, synchronize] | |
| schedule: | |
| - cron: "36 1 * * *" # Run at 01:36 AM | |
| workflow_dispatch: | |
| inputs: | |
| maven_log: | |
| description: "Maven log verbosity" | |
| required: false | |
| default: "quiet" | |
| type: choice | |
| options: | |
| - quiet | |
| - info | |
| - debug | |
| concurrency: | |
| group: ${{ github.workflow}}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| api-analytics-test-doris: | |
| env: | |
| CORE_IMAGE_NAME: "dhis2/core-dev:local" | |
| PR_NUMBER: ${{ github.event.number }} | |
| DOCKER_CHANNEL: "dhis2/core-pr" | |
| SIERRA_LEONE_DB_PATH: "/tmp/db/sierra-leone" | |
| SIERRA_LEONE_DB_VERSION: "2.39.6" | |
| GITHUB_TOKEN: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} | |
| SSH_SIGNING_KEY: ${{ secrets.DHIS2_BOT_SSH_SIGNING_KEY }} | |
| SSH_SIGNING_PASSPHRASE: ${{ secrets.DHIS2_BOT_SSH_SIGNING_PASSPHRASE }} | |
| runs-on: ubuntu-22.04 | |
| if: contains(github.event.pull_request.labels.*.name, 'run-api-analytics-tests-doris') || (github.event_name == 'workflow_dispatch') | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Free disk space on runner (Ubuntu) | |
| shell: bash | |
| run: | | |
| # Remove Android and .NET libs (approx. 14GB) | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /usr/share/dotnet | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 17 | |
| distribution: temurin | |
| cache: maven | |
| - name: Build container image | |
| run: | | |
| # only build image for running api tests in this workflow | |
| mvn clean package --threads 2C --batch-mode --no-transfer-progress \ | |
| -DskipTests -Dmaven.test.skip=true --update-snapshots --file dhis-2/pom.xml \ | |
| --projects dhis-web-server --also-make --activate-profiles jibDockerBuild \ | |
| -Djib.to.image=$CORE_IMAGE_NAME | |
| - name: Get Sierra Leone DB from cache | |
| uses: actions/cache@v5 | |
| id: cache-sierra-leone-db | |
| with: | |
| path: ${{ env.SIERRA_LEONE_DB_PATH }} | |
| key: sierra-leone-db-analytics-${{ env.SIERRA_LEONE_DB_VERSION }} | |
| - name: Download Sierra Leone DB | |
| if: ${{ steps.cache-sierra-leone-db.outputs.cache-hit != 'true' }} | |
| run: | | |
| mkdir -p ${{ env.SIERRA_LEONE_DB_PATH }} | |
| wget https://databases.dhis2.org/sierra-leone/${{ env.SIERRA_LEONE_DB_VERSION }}/analytics_be/dhis2-db-sierra-leone.sql.gz --no-clobber --directory-prefix ${{ env.SIERRA_LEONE_DB_PATH }} | |
| - name: Run tests | |
| run: | | |
| cd dhis-2/dhis-test-e2e | |
| source setup_doris_links | |
| DHIS2_IMAGE="$CORE_IMAGE_NAME" \ | |
| DHIS2_E2E_TEST_DUMP_PATH="$SIERRA_LEONE_DB_PATH" \ | |
| DORIS_VERSION=3.0.7 \ | |
| docker compose -f docker-compose.yml -f docker-compose.doris.yml -f docker-compose.e2e.yml \ | |
| -f docker-compose.e2e-analytics.yml -f docker-compose.doris-analytics.yml \ | |
| up --remove-orphans --exit-code-from test | |
| - name: Upload logs | |
| if: failure() | |
| run: | | |
| cd dhis-2/dhis-test-e2e | |
| docker compose logs web > ~/logs.txt | |
| - uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: "tomcat_logs" | |
| path: "~/logs.txt" | |
| send-slack-message: | |
| runs-on: ubuntu-latest | |
| if: | | |
| always() && | |
| contains(needs.*.result, 'failure') && | |
| github.ref == 'refs/heads/master' | |
| needs: [api-analytics-test-doris] | |
| steps: | |
| - uses: rtCamp/action-slack-notify@v2 | |
| env: | |
| SLACK_WEBHOOK: ${{ secrets.SLACK_BACKEND_WEBHOOK }} | |
| SLACK_CHANNEL: "team-backend" | |
| SLACK_MESSAGE: "Latest analytics e2e test run against Doris on master failed and needs investigation :detective-duck:. \n Commit message: ${{ github.event.head_commit.message }}" | |
| SLACK_COLOR: "#ff0000" |