Skip to content

Commit 29577e8

Browse files
update workflows
1 parent 2f8b8e4 commit 29577e8

16 files changed

Lines changed: 3205 additions & 1 deletion

.github/workflows/sso-auth-tests-local-providers.yml

Lines changed: 421 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Copyright 2021 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 runs SSO authentication tests nightly to verify SSO providers are working correctly.
13+
# Tests are excluded from regular Playwright runs to avoid requiring SSO credentials for all CI/CD.
14+
15+
name: SSO Authentication Tests (Nightly)
16+
17+
on:
18+
# schedule:
19+
# # Run every night at 2 AM UTC
20+
# - cron: '0 2 * * *'s
21+
workflow_dispatch: # Allow manual trigger
22+
inputs:
23+
sso_provider:
24+
description: "SSO Provider to test"
25+
required: true
26+
default: "google"
27+
type: choice
28+
options:
29+
- google
30+
- okta
31+
- azure
32+
- auth0
33+
- saml
34+
- cognito
35+
- all
36+
37+
permissions:
38+
contents: read
39+
40+
concurrency:
41+
group: sso-auth-tests-${{ github.workflow }}-${{ github.event.inputs.sso_provider || 'scheduled' }}
42+
cancel-in-progress: true
43+
44+
jobs:
45+
sso-auth-tests:
46+
runs-on: ubuntu-latest
47+
timeout-minutes: 90
48+
environment: test
49+
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
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"]') }}
54+
55+
steps:
56+
- name: Free Disk Space (Ubuntu)
57+
uses: jlumbroso/free-disk-space@main
58+
with:
59+
tool-cache: false
60+
android: true
61+
dotnet: true
62+
haskell: true
63+
large-packages: false
64+
swap-storage: true
65+
docker-images: false
66+
67+
- name: Checkout
68+
uses: actions/checkout@v4
69+
70+
- name: Cache Maven Dependencies
71+
id: cache-output
72+
uses: actions/cache@v4
73+
with:
74+
path: ~/.m2
75+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
76+
restore-keys: |
77+
${{ runner.os }}-maven-
78+
79+
- name: Setup OpenMetadata Test Environment
80+
uses: ./.github/actions/setup-openmetadata-test-environment
81+
with:
82+
python-version: "3.10"
83+
args: "-d mysql"
84+
ingestion_dependency: "mysql,elasticsearch"
85+
86+
- name: Setup Node.js
87+
uses: actions/setup-node@v4
88+
with:
89+
node-version-file: "openmetadata-ui/src/main/resources/ui/.nvmrc"
90+
91+
- name: Install UI dependencies
92+
working-directory: openmetadata-ui/src/main/resources/ui
93+
run: yarn --ignore-scripts --frozen-lockfile
94+
95+
- name: Install Playwright Browsers
96+
run: npx playwright@1.51.1 install --with-deps chromium
97+
98+
- name: Run SSO Authentication Tests
99+
working-directory: openmetadata-ui/src/main/resources/ui
100+
run: npx playwright test playwright/e2e/Auth/SSOAuthentication.spec.ts --workers=1
101+
env:
102+
SSO_PROVIDER_TYPE: ${{ matrix.provider }}
103+
SSO_USERNAME: ${{ secrets[format('{0}_SSO_USERNAME', upper(matrix.provider))] }}
104+
SSO_PASSWORD: ${{ secrets[format('{0}_SSO_PASSWORD', upper(matrix.provider))] }}
105+
PLAYWRIGHT_IS_OSS: true
106+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
107+
timeout-minutes: 60
108+
109+
- name: Upload test results
110+
if: always()
111+
uses: actions/upload-artifact@v4
112+
with:
113+
name: sso-auth-test-results-${{ matrix.provider }}
114+
path: openmetadata-ui/src/main/resources/ui/playwright/output/playwright-report
115+
retention-days: 7
116+
117+
- name: Upload test traces
118+
if: failure()
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: sso-auth-test-traces-${{ matrix.provider }}
122+
path: openmetadata-ui/src/main/resources/ui/playwright/output/test-results/**/trace.zip
123+
retention-days: 7
124+
125+
- name: Clean Up
126+
if: always()
127+
run: |
128+
cd ./docker/development
129+
docker compose down --remove-orphans
130+
sudo rm -rf ${PWD}/docker-volume
131+
132+
notify:
133+
needs: sso-auth-tests
134+
runs-on: ubuntu-latest
135+
if: failure()
136+
steps:
137+
- name: Send notification on failure
138+
run: |
139+
echo "SSO Authentication tests failed for one or more providers"
140+
# Add your notification logic here (Slack, email, etc.)

docker/local-sso/.env.example

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Local SSO Environment Configuration
2+
# Copy this file to .env and customize as needed
3+
4+
# ============================================
5+
# Keycloak Configuration
6+
# ============================================
7+
KEYCLOAK_URL=http://localhost:8080
8+
KEYCLOAK_ADMIN=admin
9+
KEYCLOAK_ADMIN_PASSWORD=admin123
10+
KEYCLOAK_REALM=openmetadata
11+
12+
# ============================================
13+
# LDAP Configuration
14+
# ============================================
15+
LDAP_ORGANISATION=OpenMetadata
16+
LDAP_DOMAIN=openmetadata.org
17+
LDAP_ADMIN_PASSWORD=admin123
18+
LDAP_CONFIG_PASSWORD=config123
19+
20+
# ============================================
21+
# OpenMetadata Configuration
22+
# ============================================
23+
OPENMETADATA_URL=http://localhost:8585
24+
OM_DATABASE=openmetadata_db
25+
26+
# Database
27+
DB_DRIVER_CLASS=com.mysql.cj.jdbc.Driver
28+
DB_HOST=mysql
29+
DB_PORT=3306
30+
DB_USER=openmetadata_user
31+
DB_USER_PASSWORD=openmetadata_password
32+
33+
# Elasticsearch
34+
ELASTICSEARCH_HOST=elasticsearch
35+
ELASTICSEARCH_PORT=9200
36+
ELASTICSEARCH_SCHEME=http
37+
38+
# Authentication (populated automatically by docker-compose)
39+
AUTHENTICATION_PROVIDER=saml
40+
AUTHENTICATION_AUTHORITY=http://localhost:8080
41+
AUTHENTICATION_CLIENT_ID=http://localhost:8585
42+
AUTHENTICATION_CALLBACK_URL=http://localhost:8585/callback
43+
44+
# Authorizer
45+
AUTHORIZER_CLASS_NAME=org.openmetadata.service.security.DefaultAuthorizer
46+
AUTHORIZER_REQUEST_FILTER=org.openmetadata.service.security.JwtFilter
47+
AUTHORIZER_ADMIN_PRINCIPALS=[admin@openmetadata.org,adminuser]
48+
AUTHORIZER_PRINCIPAL_DOMAIN=http://localhost:8080
49+
50+
# ============================================
51+
# Playwright Test Configuration
52+
# ============================================
53+
# Uncomment and use for Playwright tests
54+
55+
# For Keycloak SAML
56+
# SSO_PROVIDER_TYPE=saml
57+
# SSO_USERNAME=testuser
58+
# SSO_PASSWORD=Test@123
59+
# PLAYWRIGHT_TEST_BASE_URL=http://localhost:8585
60+
61+
# For LDAP
62+
# SSO_PROVIDER_TYPE=ldap
63+
# SSO_USERNAME=testuser
64+
# SSO_PASSWORD=Test@123
65+
# PLAYWRIGHT_TEST_BASE_URL=http://localhost:8585
66+
67+
# ============================================
68+
# Optional: Custom Test Users
69+
# ============================================
70+
# Add your own test users here and create them using the helper scripts
71+
# TEST_USER_1_USERNAME=customuser
72+
# TEST_USER_1_PASSWORD=Custom@123
73+
# TEST_USER_1_EMAIL=customuser@openmetadata.org

0 commit comments

Comments
 (0)