Skip to content

Commit cbea0c0

Browse files
Add GitHub Actions workflow for SSO Playwright tests (#24980)
* Initial plan * Add Playwright SSO tests workflow with @sso tag filtering Co-authored-by: chirag-madlani <12962843+chirag-madlani@users.noreply.github.com> * Add comprehensive documentation to SSO tests workflow Co-authored-by: chirag-madlani <12962843+chirag-madlani@users.noreply.github.com> * update workflow --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: chirag-madlani <12962843+chirag-madlani@users.noreply.github.com>
1 parent e2e1474 commit cbea0c0

1 file changed

Lines changed: 164 additions & 0 deletions

File tree

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# Copyright 2025 Collate
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
# http://www.apache.org/licenses/LICENSE-2.0
6+
# Unless required by applicable law or agreed to in writing, software
7+
# distributed under the License is distributed on an "AS IS" BASIS,
8+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9+
# See the License for the specific language governing permissions and
10+
# limitations under the License.
11+
12+
# This workflow executes SSO-specific end-to-end (e2e) tests using Playwright with MySQL as the database.
13+
#
14+
# Purpose:
15+
# - Run SSO configuration tests for various authentication providers (Google, Azure AD, Okta, SAML, LDAP, etc.)
16+
# - Validate SSO provider selection, field visibility, and configuration workflows
17+
# - Tests are tagged with @sso and run in isolation from other Playwright tests
18+
#
19+
# Triggers:
20+
# - Manual trigger via workflow_dispatch
21+
# - Pull requests with "safe to test" label
22+
# - Excludes draft PRs
23+
#
24+
# Test Location:
25+
# - openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SSOConfiguration.spec.ts
26+
#
27+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
28+
29+
name: SSO Authentication Tests (Nightly)
30+
31+
# schedule:
32+
# # Run every night at 2 AM UTC
33+
# - cron: '0 2 * * *'
34+
workflow_dispatch: # Allow manual trigger
35+
inputs:
36+
sso_provider:
37+
description: "SSO Provider to test"
38+
required: true
39+
default: "google"
40+
type: choice
41+
options:
42+
- google
43+
- okta
44+
- azure
45+
- auth0
46+
- saml
47+
- cognito
48+
49+
permissions:
50+
contents: read
51+
52+
concurrency:
53+
group: sso-auth-tests-${{ github.workflow }}-${{ github.event.inputs.sso_provider || 'scheduled' }}
54+
cancel-in-progress: true
55+
56+
jobs:
57+
sso-auth-tests:
58+
runs-on: ubuntu-latest
59+
if: ${{ !github.event.pull_request.draft }}
60+
environment: test
61+
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
provider: ${{ github.event.inputs.sso_provider == 'all' && fromJSON('["google", "okta", "azure", "auth0"]') || github.event.inputs.sso_provider && fromJSON(format('["{0}"]', github.event.inputs.sso_provider)) || fromJSON('["google"]') }}
66+
67+
steps:
68+
- name: Free Disk Space (Ubuntu)
69+
uses: jlumbroso/free-disk-space@main
70+
with:
71+
tool-cache: false
72+
android: true
73+
dotnet: true
74+
haskell: true
75+
large-packages: false
76+
swap-storage: true
77+
docker-images: false
78+
79+
- name: Wait for the labeler
80+
uses: lewagon/wait-on-check-action@v1.3.4
81+
if: ${{ github.event_name == 'pull_request_target' }}
82+
with:
83+
ref: ${{ github.event.pull_request.head.sha }}
84+
check-name: Team Label
85+
repo-token: ${{ secrets.GITHUB_TOKEN }}
86+
wait-interval: 90
87+
88+
- name: Verify PR labels
89+
uses: jesusvasquez333/verify-pr-label-action@v1.4.0
90+
if: ${{ github.event_name == 'pull_request_target' }}
91+
with:
92+
github-token: "${{ secrets.GITHUB_TOKEN }}"
93+
valid-labels: "safe to test"
94+
pull-request-number: "${{ github.event.pull_request.number }}"
95+
disable-reviews: true # To not auto approve changes
96+
97+
- name: Checkout
98+
uses: actions/checkout@v4
99+
with:
100+
ref: ${{ github.event.pull_request.head.sha }}
101+
102+
- name: Cache Maven Dependencies
103+
id: cache-output
104+
uses: actions/cache@v4
105+
with:
106+
path: ~/.m2
107+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
108+
restore-keys: |
109+
${{ runner.os }}-maven-
110+
111+
- name: Setup Openmetadata Test Environment
112+
uses: ./.github/actions/setup-openmetadata-test-environment
113+
with:
114+
python-version: "3.10"
115+
# Skip ingestion setup for SSO tests
116+
args: "-d postgresql -i false"
117+
ingestion_dependency: "all"
118+
119+
- name: Setup Node.js
120+
uses: actions/setup-node@v4
121+
with:
122+
node-version-file: 'openmetadata-ui/src/main/resources/ui/.nvmrc'
123+
124+
- name: Install dependencies
125+
working-directory: openmetadata-ui/src/main/resources/ui/
126+
run: yarn --ignore-scripts --frozen-lockfile
127+
128+
- name: Install Playwright Browsers
129+
run: npx playwright@1.51.1 install --with-deps
130+
131+
- name: Run SSO Authentication Tests
132+
working-directory: openmetadata-ui/src/main/resources/ui
133+
run: npx playwright test playwright/e2e/Auth/SSOAuthentication.spec.ts --workers=1
134+
env:
135+
SSO_PROVIDER_TYPE: ${{ matrix.provider }}
136+
SSO_USERNAME: ${{ secrets[format('{0}_SSO_USERNAME', upper(matrix.provider))] }}
137+
SSO_PASSWORD: ${{ secrets[format('{0}_SSO_PASSWORD', upper(matrix.provider))] }}
138+
PLAYWRIGHT_IS_OSS: true
139+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140+
timeout-minutes: 60
141+
142+
- name: Upload test results
143+
if: always()
144+
uses: actions/upload-artifact@v4
145+
with:
146+
name: sso-auth-test-results-${{ matrix.provider }}
147+
path: openmetadata-ui/src/main/resources/ui/playwright/output/playwright-report
148+
retention-days: 5
149+
150+
- name: Clean Up
151+
run: |
152+
cd ./docker/development
153+
docker compose down --remove-orphans
154+
sudo rm -rf ${PWD}/docker-volume
155+
156+
notify:
157+
needs: sso-auth-tests
158+
runs-on: ubuntu-latest
159+
if: failure()
160+
steps:
161+
- name: Send notification on failure
162+
run: |
163+
echo "SSO Authentication tests failed for one or more providers"
164+
# Add your notification logic here (Slack, email, etc.)

0 commit comments

Comments
 (0)