Skip to content

Commit e22e21d

Browse files
vchanmykalmax
andauthored
Chore: Add UI test job to CI (#712)
* Add UI test job to CI * Update preview script * Add OpenAPI spec to source control * Format openapi.json * Increase playwright web server timeout to two minutes * Download playwright browsers * install Playwright dependencies * disable vite proxy for testing * increase timeout and move build as separate step * use node:18 image * use node 19 * move to node 18 and run build before preview --------- Co-authored-by: Max Mykal <mykalmax@yahoo.com>
1 parent c6adb1d commit e22e21d

7 files changed

Lines changed: 1234 additions & 42 deletions

File tree

.circleci/config.yml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,12 @@ jobs:
4040
CONTINUE_ON_ERROR="false" \
4141
npx https://github.com/TobikoData/circleci-gh-conventional-release
4242
43-
generate-openapi-spec:
44-
docker:
45-
- image: cimg/python:3.11
46-
resource_class: small
47-
steps:
48-
- checkout
49-
- run:
50-
name: Install dependencies
51-
command: make install-dev
52-
- run:
53-
name: Generate OpenAPI spec
54-
command: python web/server/openapi.py
55-
- persist_to_workspace:
56-
root: web/client
57-
paths:
58-
- openapi.json
59-
6043
ide-build:
6144
docker:
6245
- image: cimg/node:19.8
6346
resource_class: medium
6447
steps:
6548
- checkout
66-
- attach_workspace:
67-
at: web/client
6849
- run:
6950
name: Install packages
7051
command: npm --prefix web/client ci
@@ -90,14 +71,10 @@ workflows:
9071
jobs:
9172
- gh-release:
9273
<<: *on_tag_filter
93-
- generate-openapi-spec:
94-
<<: *on_tag_filter
95-
requires:
96-
- gh-release
9774
- ide-build:
9875
<<: *on_tag_filter
9976
requires:
100-
- generate-openapi-spec
77+
- gh-release
10178
- publish:
10279
<<: *on_tag_filter
10380
requires:

.circleci/continue_config.yml

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ commands:
2222
or:
2323
- << pipeline.parameters.common >>
2424
- << pipeline.parameters.python >>
25-
- equal: [ main, << pipeline.git.branch >> ]
25+
- equal: [main, << pipeline.git.branch >>]
2626
steps:
2727
- run: circleci-agent step halt
2828
halt_unless_client:
@@ -32,7 +32,7 @@ commands:
3232
or:
3333
- << pipeline.parameters.common >>
3434
- << pipeline.parameters.client >>
35-
- equal: [ main, << pipeline.git.branch >> ]
35+
- equal: [main, << pipeline.git.branch >>]
3636
steps:
3737
- run: circleci-agent step halt
3838

@@ -76,7 +76,7 @@ jobs:
7676
python --version --version >> pre-commit-cache-key.txt
7777
- restore_cache:
7878
keys:
79-
- v1-pc-cache-{{ checksum "pre-commit-cache-key.txt" }}
79+
- v1-pc-cache-{{ checksum "pre-commit-cache-key.txt" }}
8080
- run:
8181
name: Install pre-commit
8282
command: pip install pre-commit
@@ -88,6 +88,29 @@ jobs:
8888
paths:
8989
- ~/.cache/pre-commit
9090

91+
ui_test:
92+
docker:
93+
- image: node:18
94+
resource_class: medium
95+
steps:
96+
- checkout
97+
- restore_cache:
98+
keys:
99+
- v1-nm-cache-{{ checksum "web/client/package-lock.json" }}
100+
- run:
101+
name: Install packages
102+
command: npm --prefix web/client ci
103+
- run:
104+
name: Install Playwright Browsers
105+
command: npm --prefix web/client run playwright:install
106+
- save_cache:
107+
key: v1-nm-cache-{{ checksum "web/client/package-lock.json" }}
108+
paths:
109+
- /root/.npm
110+
- run:
111+
name: Run tests
112+
command: npm --prefix web/client run test
113+
91114
core_integration_tests:
92115
docker:
93116
- image: cimg/python:3.7
@@ -131,7 +154,8 @@ workflows:
131154
- style_and_unit_tests:
132155
matrix:
133156
parameters:
134-
python_version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
157+
python_version:
158+
["3.7", "3.8", "3.9", "3.10", "3.11"]
135159
- core_integration_tests
136160
- airflow_integration_tests:
137161
requires:
@@ -144,3 +168,4 @@ workflows:
144168
main_pr_web_client:
145169
jobs:
146170
- ui_style
171+
- ui_test

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,3 @@ web/client/dist
153153

154154
# Version file
155155
sqlmesh/_version.py
156-
157-
# Autogenerated OpenAPI spec
158-
openapi.json

0 commit comments

Comments
 (0)