-
Notifications
You must be signed in to change notification settings - Fork 1.1k
207 lines (190 loc) · 9.02 KB
/
cypress-integration-tests-mysql-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: MySQL PR Cypress Integration Tests
on:
workflow_dispatch:
pull_request_target:
types:
- labeled
- opened
- synchronize
- reopened
- ready_for_review
paths:
- openmetadata-spec/**
- openmetadata-ui/**
- openmetadata-service/**
- openmetadata-clients/**
- common/**
permissions:
contents: read
concurrency:
group: cypress-integration-tests-pr-mysql-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
cypress-ci-mysql:
if: |
github.event_name == 'workflow_dispatch' ||
( github.event_name == 'pull_request_target'&& github.event.pull_request.draft == false )
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
parallel-machine: [1, 2, 3, 4]
environment: test
steps:
- name: Set Cypress Project Environment variable
id: cypress-project-id
run: |
echo "CYPRESS_PROJECT_ID=${{ secrets.CYPRESS_PR_PROJECT_ID }}" >> $GITHUB_OUTPUT
echo "CYPRESS_RECORD_KEY=${{ secrets.CYPRESS_PR_RECORD_KEY }}" >> $GITHUB_OUTPUT
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
swap-storage: true
docker-images: false
- name: Wait for the labeler
uses: lewagon/wait-on-check-action@v1.3.3
if: ${{ github.event_name == 'pull_request_target' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: Team Label
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 90
- name: Verify PR labels
uses: jesusvasquez333/verify-pr-label-action@v1.4.0
if: ${{ github.event_name == 'pull_request_target' }}
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
valid-labels: "safe to test"
pull-request-number: "${{ github.event.pull_request.number }}"
disable-reviews: true # To not auto approve changes
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Get Cypress Filter
id: get_cypress_filter
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr view --json labels --jq '[.labels[].name | select(startswith("e2e:")) | sub("e2e:";"")] | join(" ")' >> labels
echo "e2eFilters=$(cat labels)" >> $GITHUB_OUTPUT
- name: Cache Maven Dependencies
id: cache-output
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Get yarn cache directory path
if: steps.cache-output.outputs.exit-code == 0
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
if: steps.yarn-cache-dir-path.outputs.exit-code == 0
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Set up JDK 17
if: steps.cache-output.outputs.exit-code == 0
uses: actions/setup-java@v3
with:
java-version: "17"
distribution: "temurin"
- name: Generating Data Models
run: |
pip install --upgrade pip
sudo make install_antlr_cli
make install_dev generate
- name: Start Server and Ingest Sample Data
env:
INGESTION_DEPENDENCY: "all"
run: ./docker/run_local_docker.sh -d mysql
timeout-minutes: 60
- name: Run Cypress Tests
uses: cypress-io/github-action@v4
timeout-minutes: 120
with:
install-command: yarn --frozen-lockfile --silent --ignore-scripts
record: true
parallel: true
working-directory: openmetadata-ui/src/main/resources/ui/
wait-on: "http://localhost:8585"
group: cypress-ci-mysql-pr-oss-${{ github.run_id }}-${{github.run_attempt}}
browser: chrome
command: npx cypress run --config-file=cypress.config.ts --env grepTags='${{ steps.get_cypress_filter.outputs.e2eFilters }}'
env:
CYPRESS_BASE_URL: "http://localhost:8585"
CYPRESS_RECORD_KEY: ${{ steps.cypress-project-id.outputs.CYPRESS_RECORD_KEY }}
CYPRESS_SNOWFLAKE_USERNAME: ${{ secrets.TEST_SNOWFLAKE_USERNAME }}
CYPRESS_SNOWFLAKE_PASSWORD: ${{ secrets.TEST_SNOWFLAKE_PASSWORD }}
CYPRESS_SNOWFLAKE_ACCOUNT: ${{ secrets.TEST_SNOWFLAKE_ACCOUNT }}
CYPRESS_SNOWFLAKE_DATABASE: ${{ secrets.TEST_SNOWFLAKE_DATABASE }}
CYPRESS_SNOWFLAKE_WAREHOUSE: ${{ secrets.TEST_SNOWFLAKE_WAREHOUSE }}
CYPRESS_PROJECT_ID: ${{ steps.cypress-project-id.outputs.CYPRESS_PROJECT_ID }}
CYPRESS_BQ_PRIVATE_KEY: ${{ secrets.TEST_BQ_PRIVATE_KEY }}
CYPRESS_BQ_PROJECT_ID: ${{ secrets.TEST_BQ_PROJECT_ID }}
CYPRESS_BQ_PRIVATE_KEY_ID: ${{ secrets.TEST_BQ_PRIVATE_KEY_ID }}
CYPRESS_BQ_PROJECT_ID_TAXONOMY: ${{ secrets.TEST_BQ_PROJECT_ID_TAXONOMY }}
CYPRESS_BQ_CLIENT_EMAIL: ${{ secrets.TEST_BQ_CLIENT_EMAIL }}
CYPRESS_BQ_CLIENT_ID: ${{ secrets.TEST_BQ_CLIENT_ID }}
CYPRESS_REDSHIFT_HOST: ${{ secrets.E2E_REDSHIFT_HOST_PORT }}
CYPRESS_REDSHIFT_USERNAME: ${{ secrets.E2E_REDSHIFT_USERNAME }}
CYPRESS_REDSHIFT_PASSWORD: ${{ secrets.E2E_REDSHIFT_PASSWORD }}
CYPRESS_REDSHIFT_DATABASE: ${{ secrets.TEST_REDSHIFT_DATABASE }}
CYPRESS_METABASE_USERNAME: ${{ secrets.TEST_METABASE_USERNAME }}
CYPRESS_METABASE_PASSWORD: ${{ secrets.TEST_METABASE_PASSWORD }}
CYPRESS_METABASE_DB_SERVICE_NAME: ${{ secrets.TEST_METABASE_DB_SERVICE_NAME }}
CYPRESS_METABASE_HOST_PORT: ${{ secrets.TEST_METABASE_HOST_PORT }}
CYPRESS_SUPERSET_USERNAME: ${{ secrets.TEST_SUPERSET_USERNAME }}
CYPRESS_SUPERSET_PASSWORD: ${{ secrets.TEST_SUPERSET_PASSWORD }}
CYPRESS_SUPERSET_HOST_PORT: ${{ secrets.TEST_SUPERSET_HOST_PORT }}
CYPRESS_KAFKA_BOOTSTRAP_SERVERS: ${{ secrets.TEST_KAFKA_BOOTSTRAP_SERVERS }}
CYPRESS_KAFKA_SCHEMA_REGISTRY_URL: ${{ secrets.TEST_KAFKA_SCHEMA_REGISTRY_URL }}
CYPRESS_GLUE_ACCESS_KEY: ${{ secrets.TEST_GLUE_ACCESS_KEY }}
CYPRESS_GLUE_SECRET_KEY: ${{ secrets.TEST_GLUE_SECRET_KEY }}
CYPRESS_GLUE_AWS_REGION: ${{ secrets.TEST_GLUE_AWS_REGION }}
CYPRESS_GLUE_ENDPOINT: ${{ secrets.TEST_GLUE_ENDPOINT }}
CYPRESS_GLUE_STORAGE_SERVICE: ${{ secrets.TEST_GLUE_STORAGE_SERVICE }}
CYPRESS_MYSQL_USERNAME: ${{ secrets.TEST_MYSQL_USERNAME }}
CYPRESS_MYSQL_PASSWORD: ${{ secrets.TEST_MYSQL_PASSWORD }}
CYPRESS_MYSQL_HOST_PORT: ${{ secrets.TEST_MYSQL_HOST_PORT }}
CYPRESS_MYSQL_DATABASE_SCHEMA: ${{ secrets.TEST_MYSQL_DATABASE_SCHEMA }}
CYPRESS_POSTGRES_USERNAME: ${{ secrets.TEST_POSTGRES_USERNAME }}
CYPRESS_POSTGRES_PASSWORD: ${{ secrets.TEST_POSTGRES_PASSWORD }}
CYPRESS_POSTGRES_HOST_PORT: ${{ secrets.TEST_POSTGRES_HOST_PORT }}
CYPRESS_POSTGRES_DATABASE: ${{ secrets.TEST_POSTGRES_DATABASE }}
CYPRESS_AIRFLOW_HOST_PORT: ${{ secrets.TEST_AIRFLOW_HOST_PORT }}
CYPRESS_ML_MODEL_TRACKING_URI: ${{ secrets.TEST_ML_MODEL_TRACKING_URI }}
CYPRESS_ML_MODEL_REGISTRY_URI: ${{ secrets.TEST_ML_MODEL_REGISTRY_URI }}
CYPRESS_S3_STORAGE_ACCESS_KEY_ID: ${{ secrets.TEST_S3_STORAGE_ACCESS_KEY_ID }}
CYPRESS_S3_STORAGE_SECRET_ACCESS_KEY: ${{ secrets.TEST_S3_STORAGE_SECRET_ACCESS_KEY }}
CYPRESS_S3_STORAGE_END_POINT_URL: ${{ secrets.TEST_S3_STORAGE_END_POINT_URL }}
# 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 }}
- name: Clean Up
run: |
cd ./docker/development
docker compose down --remove-orphans
sudo rm -rf ${PWD}/docker-volume