-
Notifications
You must be signed in to change notification settings - Fork 240
248 lines (219 loc) Β· 8.64 KB
/
test-schema-engine.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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
name: "SE: integration tests"
on:
push:
branches:
- main
pull_request:
paths-ignore:
- ".github/**"
- "!.github/workflows/test-schema-engine.yml"
- ".buildkite/**"
- "*.md"
- "LICENSE"
- "CODEOWNERS"
- "renovate.json"
# Specific
- "query-engine/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-mongodb-schema-connector:
name: "${{ matrix.database.name }}"
strategy:
fail-fast: false
matrix:
database:
- name: "mongodb42"
url: "mongodb://prisma:prisma@localhost:27016/?authSource=admin&retryWrites=true"
- name: "mongodb44"
url: "mongodb://prisma:prisma@localhost:27017/?authSource=admin&retryWrites=true"
- name: "mongodb5"
url: "mongodb://prisma:prisma@localhost:27018/?authSource=admin&retryWrites=true"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@nextest
- name: Login to Docker Hub
uses: docker/login-action@v3
continue-on-error: true
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Start ${{ matrix.database.name }}"
run: make start-${{ matrix.database.name }}-single
- run: cargo nextest run -p mongodb-schema-connector
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
test-linux:
name: "${{ matrix.database.name }}"
strategy:
fail-fast: false
matrix:
database:
- name: mssql_2017
url: "sqlserver://localhost:1434;database=master;user=SA;password=<YourStrong@Passw0rd>;trustServerCertificate=true;socket_timeout=60;isolationLevel=READ UNCOMMITTED"
- name: mssql_2019
url: "sqlserver://localhost:1433;database=master;user=SA;password=<YourStrong@Passw0rd>;trustServerCertificate=true;socket_timeout=60;isolationLevel=READ UNCOMMITTED"
- name: mssql_2022
url: "sqlserver://localhost:1435;database=master;user=SA;password=<YourStrong@Passw0rd>;trustServerCertificate=true;socket_timeout=60;isolationLevel=READ UNCOMMITTED"
- name: mysql_5_6
url: "mysql://root:prisma@localhost:3309"
- name: mysql_5_7
url: "mysql://root:prisma@localhost:3306"
- name: mysql_8
url: "mysql://root:prisma@localhost:3307"
- name: mysql_mariadb
url: "mysql://root:prisma@localhost:3308"
- name: postgres9
url: "postgresql://postgres:prisma@localhost:5431"
- name: postgres10
url: "postgresql://postgres:prisma@localhost:5432"
- name: postgres11
url: "postgresql://postgres:prisma@localhost:5433"
- name: postgres12
url: "postgresql://postgres:prisma@localhost:5434"
- name: postgres13
url: "postgresql://postgres:prisma@localhost:5435"
- name: postgres14
url: "postgresql://postgres:prisma@localhost:5437"
- name: postgres15
url: "postgresql://postgres:prisma@localhost:5438"
- name: postgres16
url: "postgresql://postgres:prisma@localhost:5439"
- name: cockroach_23_1
url: "postgresql://prisma@localhost:26260"
- name: cockroach_22_2
url: "postgresql://prisma@localhost:26259"
- name: cockroach_22_1_0
url: "postgresql://prisma@localhost:26257"
- name: sqlite
url: sqlite
- name: vitess_8_0
url: "mysql://root:prisma@localhost:33807/test"
shadow_database_url: "mysql://root:prisma@localhost:33808/shadow"
is_vitess: true
single_threaded: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@nextest
- name: Login to Docker Hub
uses: docker/login-action@v3
continue-on-error: true
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
if: "${{ env.DOCKERHUB_USERNAME != '' && env.DOCKERHUB_TOKEN != '' }}"
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Start ${{ matrix.database.name }}"
run: make start-${{ matrix.database.name }}
- run: cargo nextest run -p sql-introspection-tests
if: ${{ !matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
- run: cargo nextest run -p sql-schema-describer
if: ${{ !matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
- run: cargo nextest run -p sql-migration-tests
if: ${{ !matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
- run: cargo nextest run -p schema-engine-cli
if: ${{ !matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
#
# Vitess tests
#
- run: cargo nextest run -p sql-introspection-tests --test-threads=1
if: ${{ matrix.database.is_vitess }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
TEST_SHADOW_DATABASE_URL: ${{ matrix.database.shadow_database_url }}
- run: cargo nextest run -p sql-migration-tests --test-threads=1
if: ${{ matrix.database.is_vitess }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
TEST_SHADOW_DATABASE_URL: ${{ matrix.database.shadow_database_url }}
RUST_LOG: debug
- run: cargo nextest run -p schema-engine-cli --test-threads=1
if: ${{ matrix.database.is_vitess }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
TEST_SHADOW_DATABASE_URL: ${{ matrix.database.shadow_database_url }}
#
# Single threaded tests (excluding Vitess)
#
- run: cargo nextest run -p sql-schema-describer --test-threads=1
if: ${{ !matrix.database.is_vitess && matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
- run: cargo nextest run -p sql-introspection-tests --test-threads=1
if: ${{ !matrix.database.is_vitess && matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
- run: cargo nextest run -p sql-migration-tests --test-threads=1
if: ${{ !matrix.database.is_vitess && matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
RUST_LOG: debug
- run: cargo nextest run -p schema-engine-cli --test-threads=1
if: ${{ !matrix.database.is_vitess && matrix.database.single_threaded }}
env:
CLICOLOR_FORCE: 1
TEST_DATABASE_URL: ${{ matrix.database.url }}
test-windows:
strategy:
fail-fast: false
matrix:
db:
- name: "mysql-lts"
url: "mysql://root@localhost:3306?connect_timeout=20&socket_timeout=60"
- name: "mariadb"
url: "mysql://root@localhost:3306?connect_timeout=20&socket_timeout=60"
rust:
- stable
os:
- windows-latest
runs-on: ${{ matrix.os }}
name: "${{ matrix.db.name }} on Windows"
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: taiki-e/install-action@nextest
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.rust }}-${{ hashFiles('**/Cargo.lock') }}
- name: Install ${{ matrix.db.name }}
run: |
iwr -useb 'https://raw.githubusercontent.com/scoopinstaller/install/master/install.ps1' -outfile 'install.ps1'
.\install.ps1 -RunAsAdmin
scoop install sudo
scoop install ${{ matrix.db.name }}
sudo mysqld --install
sudo sc start MySQL
- name: Run tests
run: cargo nextest run -p sql-migration-tests
env:
TEST_DATABASE_URL: ${{ matrix.db.url }}