|
| 1 | +name: PMM Integration |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - main |
| 6 | + - release-* |
| 7 | + tags: |
| 8 | + - '[0-9]+.[0-9]+.[0-9]+*' |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
| 13 | +jobs: |
| 14 | + test: |
| 15 | + name: Test |
| 16 | + runs-on: ubuntu-latest |
| 17 | + timeout-minutes: 30 |
| 18 | + continue-on-error: true |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + postgresql: [13, 14, 15, 16, 17, 18] |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Clone QA Integration |
| 25 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 26 | + with: |
| 27 | + repository: Percona-Lab/qa-integration |
| 28 | + ref: main |
| 29 | + path: qa-integration |
| 30 | + |
| 31 | + - name: Clone PMM UI tests |
| 32 | + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 |
| 33 | + with: |
| 34 | + repository: percona/pmm-ui-tests |
| 35 | + ref: main |
| 36 | + path: pmm-ui-tests |
| 37 | + |
| 38 | + - name: Set TARGET_BRANCH variable |
| 39 | + run: echo "TARGET_BRANCH=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV |
| 40 | + |
| 41 | + - name: Run PMM Server |
| 42 | + run: docker run --detach --restart always -p 443:8443 -p 8081:8080 --name pmm-server perconalab/pmm-server:3-dev-latest |
| 43 | + |
| 44 | + - name: Setup PostgreSQL ${{ matrix.postgresql }} & PGSM |
| 45 | + working-directory: qa-integration/pmm_qa |
| 46 | + run: | |
| 47 | + mkdir -m 777 -p /tmp/backup_data |
| 48 | + python3 -m venv virtenv |
| 49 | + . virtenv/bin/activate |
| 50 | + pip install --upgrade pip |
| 51 | + pip install --force-reinstall -U setuptools |
| 52 | + pip install -r requirements.txt |
| 53 | + python3 pmm-framework.py --database pdpgsql=${{ matrix.postgresql }},PGSM_BRANCH=${{ env.TARGET_BRANCH }} |
| 54 | +
|
| 55 | + - name: Install npx dependencies |
| 56 | + working-directory: pmm-ui-tests |
| 57 | + run: npm ci && npx playwright install --with-deps && npx codeceptjs def pr.codecept.js |
| 58 | + |
| 59 | + - name: Run integration tests |
| 60 | + working-directory: pmm-ui-tests |
| 61 | + run: | |
| 62 | + export PMM_UI_URL="http://127.0.0.1:8081/" |
| 63 | + npx codeceptjs run -c pr.codecept.js tests/qa-integration/pmm_pdpgsql_integration_test.js |
| 64 | +
|
| 65 | + - name: Collect pmm-agent logs |
| 66 | + if: failure() |
| 67 | + run: docker exec pdpgsql_pmm_${{ matrix.postgresql }}_1 cat /var/log/pmm-agent.log > ./pmm-ui-tests/tests/output/pmm-agent.log |
| 68 | + |
| 69 | + - name: Upload artifacts |
| 70 | + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 |
| 71 | + if: failure() |
| 72 | + with: |
| 73 | + name: tests-artifact |
| 74 | + path: ./pmm-ui-tests/tests/output/ |
| 75 | + if-no-files-found: ignore |
0 commit comments