feat(ci): support slack message for OSS playwright run (#21163)

* feat(ci): support slack message for OSS playwright run

* update for slack message

* Update .github/workflows/mysql-nightly-e2e.yml

Co-authored-by: Akash Jain <15995028+akash-jain-10@users.noreply.github.com>

* Update .github/workflows/postgresql-nightly-e2e.yml

Co-authored-by: Akash Jain <15995028+akash-jain-10@users.noreply.github.com>

* fix download report step

* udpate tokens

* fix path issue

* wait for downloads to be completed

* add blob report to reporters

* upload blob reports to artifacts

* fix download step

* update download step for mysql

* fix upload / download approch

* skip tests to fasten testing

* fix ci error

* fix path issue

* fix path

* fix path

* update path

* fix download path

* revert playwright config

* address comments

---------

Co-authored-by: Akash Jain <15995028+akash-jain-10@users.noreply.github.com>
This commit is contained in:
Chirag Madlani 2025-05-19 17:23:54 +05:30 committed by GitHub
parent d298fc00c9
commit 0dc2058447
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 104 additions and 8 deletions

View File

@ -36,8 +36,8 @@ jobs:
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2]
shardTotal: [2]
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
@ -131,11 +131,12 @@ jobs:
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report--${{ matrix.shardIndex }}
path: openmetadata-ui/src/main/resources/ui/playwright/output/playwright-report
name: blob-report-${{ matrix.shardIndex }}
path: openmetadata-ui/src/main/resources/ui/blob-report
retention-days: 5
- name: Clean Up
@ -143,3 +144,40 @@ jobs:
cd ./docker/development
docker compose down --remove-orphans
sudo rm -rf ${PWD}/docker-volume
merge-reports:
needs: pw-ci-mysql-branch
runs-on: ubuntu-latest
if: ${{ !failure() || !cancelled() }}
env:
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_BOT_USER_OAUTH_TOKEN: ${{ secrets.E2E_SLACK_BOT_OAUTH_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.19.0
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: openmetadata-ui/src/main/resources/ui/blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge Reports and Generate Slack Notification
working-directory: openmetadata-ui/src/main/resources/ui/
env:
RUN_TITLE: "PostgreSQL Test for OSS Release: ${{ inputs.branch }}"
RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
SLACK_BOT_USER_OAUTH_TOKEN: ${{ secrets.E2E_SLACK_BOT_OAUTH_TOKEN }}
run: |
npx playwright merge-reports --reporter json ./blob-reports > merged_tests_results.json
npx playwright-slack-report -c playwright/salck-cli.config.json -j merged_tests_results.json > slack_report.json

View File

@ -131,11 +131,12 @@ jobs:
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/upload-artifact@v4
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.shardIndex }}
path: openmetadata-ui/src/main/resources/ui/playwright/output/playwright-report
name: blob-report-${{ matrix.shardIndex }}
path: openmetadata-ui/src/main/resources/ui/blob-report
retention-days: 5
- name: Clean Up
@ -143,3 +144,40 @@ jobs:
cd ./docker/development
docker compose down --remove-orphans
sudo rm -rf ${PWD}/docker-volume
merge-reports:
needs: pw-ci-postgresql-branch
runs-on: ubuntu-latest
if: ${{ !failure() || !cancelled() }}
env:
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SLACK_BOT_USER_OAUTH_TOKEN: ${{ secrets.E2E_SLACK_BOT_OAUTH_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18.19.0
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: openmetadata-ui/src/main/resources/ui/blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge Reports and Generate Slack Notification
working-directory: openmetadata-ui/src/main/resources/ui/
env:
RUN_TITLE: "PostgreSQL Test for OSS Release: ${{ inputs.branch }}"
RUN_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
SLACK_BOT_USER_OAUTH_TOKEN: ${{ secrets.E2E_SLACK_BOT_OAUTH_TOKEN }}
run: |
npx playwright merge-reports --reporter json ./blob-reports > merged_tests_results.json
npx playwright-slack-report -c playwright/salck-cli.config.json -j merged_tests_results.json > slack_report.json

1
.gitignore vendored
View File

@ -85,6 +85,7 @@ openmetadata-ui/src/main/resources/ui/playwright/output/
openmetadata-ui/src/main/resources/ui/playwright/e2e/.cache/
openmetadata-ui/src/main/resources/ui/.env
openmetadata-ui/src/main/resources/ui/playwright/.auth
openmetadata-ui/src/main/resources/ui/blob-report
#UI - Dereferenced Schemas
openmetadata-ui/src/main/resources/ui/src/jsons/connectionSchemas

View File

@ -45,6 +45,7 @@ export default defineConfig({
showError: true,
},
],
['blob'],
],
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {

View File

@ -0,0 +1,18 @@
{
"sendUsingBot": {
"channels": ["C04HGB0NY04"]
},
"slackLogLevel": "info",
"sendResults": "always",
"showInThread": true,
"meta": [
{
"key": "Title",
"value": "__ENV_RUN_TITLE"
},
{
"key": ":runner: Run URL",
"value": "__ENV_RUN_URL"
}
]
}