Skip to content

Commit 2ad454f

Browse files
committed
Fix tests suite
1 parent 870e1ec commit 2ad454f

File tree

2 files changed

+55
-63
lines changed

2 files changed

+55
-63
lines changed

.github/workflows/sqlx.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ jobs:
244244
command: test
245245
args: >
246246
--no-default-features
247-
--features any,postgres,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
247+
--features any,postgres,macros,migrate,all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
248248
env:
249249
DATABASE_URL: postgres://postgres@localhost:5432/sqlx?sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt&sslkey=.%2Ftests%2Fkeys%2Fclient.key&sslcert=.%2Ftests%2Fcerts%2Fclient.crt
250250
# FIXME: needed to disable `ltree` tests in Postgres 9.6
@@ -316,7 +316,7 @@ jobs:
316316
command: test
317317
args: >
318318
--no-default-features
319-
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
319+
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
320320
env:
321321
DATABASE_URL: mysql://root@localhost:3306/sqlx?sslmode=verify_ca&ssl-ca=.%2Ftests%2Fcerts%2Fca.crt&ssl-key=.%2Ftests%2Fkeys%2Fclient.key&ssl-cert=.%2Ftests%2Fcerts%2Fclient.crt
322322

@@ -372,6 +372,6 @@ jobs:
372372
command: test
373373
args: >
374374
--no-default-features
375-
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
375+
--features any,mysql,macros,migrate,all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
376376
env:
377377
DATABASE_URL: mysql://root@localhost:3306/sqlx?sslmode=verify_ca&ssl-ca=.%2Ftests%2Fcerts%2Fca.crt&ssl-key=.%2Ftests%2Fkeys%2Fclient.key&ssl-cert=.%2Ftests%2Fcerts%2Fclient.crt

tests/x.py

+52-60
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,10 @@ def run(command, comment=None, env=None, service=None, tag=None, args=None, data
127127
# check
128128
#
129129

130-
for runtime in ["async-std", "tokio", "actix"]:
131-
for tls in ["native-tls", "rustls"]:
130+
for runtime in ["async-std", "tokio"]:
131+
for tls in ["native-tls", "rustls", "none"]:
132132
run(
133-
f"cargo c --no-default-features --features all-databases,all-types,offline,macros,runtime-{runtime}-{tls}",
133+
f"cargo c --no-default-features --features all-databases,_unstable-all-types,macros,runtime-{runtime},tls-{tls}",
134134
comment="check with async-std",
135135
tag=f"check_{runtime}_{tls}"
136136
)
@@ -139,10 +139,10 @@ def run(command, comment=None, env=None, service=None, tag=None, args=None, data
139139
# unit test
140140
#
141141

142-
for runtime in ["async-std", "tokio", "actix"]:
143-
for tls in ["native-tls", "rustls"]:
142+
for runtime in ["async-std", "tokio"]:
143+
for tls in ["native-tls", "rustls", "none"]:
144144
run(
145-
f"cargo test --no-default-features --manifest-path sqlx-core/Cargo.toml --features all-databases,all-types,runtime-{runtime}-{tls}",
145+
f"cargo test --no-default-features --manifest-path sqlx-core/Cargo.toml --features json,_rt-{runtime},_tls-{tls}",
146146
comment="unit test core",
147147
tag=f"unit_{runtime}_{tls}"
148148
)
@@ -151,15 +151,15 @@ def run(command, comment=None, env=None, service=None, tag=None, args=None, data
151151
# integration tests
152152
#
153153

154-
for runtime in ["async-std", "tokio", "actix"]:
155-
for tls in ["native-tls", "rustls"]:
154+
for runtime in ["async-std", "tokio"]:
155+
for tls in ["native-tls", "rustls", "none"]:
156156

157157
#
158158
# sqlite
159159
#
160160

161161
run(
162-
f"cargo test --no-default-features --features macros,offline,any,all-types,sqlite,runtime-{runtime}-{tls}",
162+
f"cargo test --no-default-features --features macros,any,_unstable-all-types,sqlite,runtime-{runtime},tls-{tls}",
163163
comment=f"test sqlite",
164164
service="sqlite",
165165
tag=f"sqlite" if runtime == "async-std" else f"sqlite_{runtime}",
@@ -171,87 +171,79 @@ def run(command, comment=None, env=None, service=None, tag=None, args=None, data
171171

172172
for version in ["14", "13", "12", "11", "10"]:
173173
run(
174-
f"cargo test --no-default-features --features macros,offline,any,all-types,postgres,runtime-{runtime}-{tls}",
174+
f"cargo test --no-default-features --features macros,any,_unstable-all-types,postgres,runtime-{runtime},tls-{tls}",
175175
comment=f"test postgres {version}",
176176
service=f"postgres_{version}",
177177
tag=f"postgres_{version}" if runtime == "async-std" else f"postgres_{version}_{runtime}",
178178
)
179179

180-
## +ssl
181-
for version in ["14", "13", "12", "11", "10"]:
182-
run(
183-
f"cargo test --no-default-features --features macros,offline,any,all-types,postgres,runtime-{runtime}-{tls}",
184-
comment=f"test postgres {version} ssl",
185-
database_url_args="sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt",
186-
service=f"postgres_{version}",
187-
tag=f"postgres_{version}_ssl" if runtime == "async-std" else f"postgres_{version}_ssl_{runtime}",
188-
)
189-
190-
## +client-ssl
191-
for version in ["14_client_ssl", "13_client_ssl", "12_client_ssl", "11_client_ssl", "10_client_ssl"]:
192-
run(
193-
f"cargo test --no-default-features --features macros,offline,any,all-types,postgres,runtime-{runtime}-{tls}",
194-
comment=f"test postgres {version} no-password",
195-
database_url_args="sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt&sslkey=.%2Ftests%2Fkeys%2Fclient.key&sslcert=.%2Ftests%2Fcerts%2Fclient.crt",
196-
service=f"postgres_{version}",
197-
tag=f"postgres_{version}_no_password" if runtime == "async-std" else f"postgres_{version}_no_password_{runtime}",
198-
)
180+
if tls != "none":
181+
## +ssl
182+
for version in ["14", "13", "12", "11", "10"]:
183+
run(
184+
f"cargo test --no-default-features --features macros,any,_unstable-all-types,postgres,runtime-{runtime},tls-{tls}",
185+
comment=f"test postgres {version} ssl",
186+
database_url_args="sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt",
187+
service=f"postgres_{version}",
188+
tag=f"postgres_{version}_ssl" if runtime == "async-std" else f"postgres_{version}_ssl_{runtime}",
189+
)
190+
191+
## +client-ssl
192+
for version in ["14_client_ssl", "13_client_ssl", "12_client_ssl", "11_client_ssl", "10_client_ssl"]:
193+
run(
194+
f"cargo test --no-default-features --features macros,any,_unstable-all-types,postgres,runtime-{runtime},tls-{tls}",
195+
comment=f"test postgres {version} no-password",
196+
database_url_args="sslmode=verify-ca&sslrootcert=.%2Ftests%2Fcerts%2Fca.crt&sslkey=.%2Ftests%2Fkeys%2Fclient.key&sslcert=.%2Ftests%2Fcerts%2Fclient.crt",
197+
service=f"postgres_{version}",
198+
tag=f"postgres_{version}_no_password" if runtime == "async-std" else f"postgres_{version}_no_password_{runtime}",
199+
)
199200

200201
#
201202
# mysql
202203
#
203204

204205
for version in ["8", "5_7"]:
205206
run(
206-
f"cargo test --no-default-features --features macros,offline,any,all-types,mysql,runtime-{runtime}-{tls}",
207+
f"cargo test --no-default-features --features macros,any,_unstable-all-types,mysql,runtime-{runtime},tls-{tls}",
207208
comment=f"test mysql {version}",
208209
service=f"mysql_{version}",
209210
tag=f"mysql_{version}" if runtime == "async-std" else f"mysql_{version}_{runtime}",
210211
)
211212

212-
## +client-ssl
213-
for version in ["8_client_ssl", "5_7_client_ssl"]:
214-
run(
215-
f"cargo test --no-default-features --features macros,offline,any,all-types,mysql,runtime-{runtime}-{tls}",
216-
comment=f"test mysql {version} no-password",
217-
database_url_args="sslmode=verify_ca&ssl-ca=.%2Ftests%2Fcerts%2Fca.crt&ssl-key=.%2Ftests%2Fkeys%2Fclient.key&ssl-cert=.%2Ftests%2Fcerts%2Fclient.crt",
218-
service=f"mysql_{version}",
219-
tag=f"mysql_{version}_no_password" if runtime == "async-std" else f"mysql_{version}_no_password_{runtime}",
220-
)
213+
if tls != "none":
214+
## +client-ssl
215+
for version in ["8_client_ssl", "5_7_client_ssl"]:
216+
run(
217+
f"cargo test --no-default-features --features macros,any,_unstable-all-types,mysql,runtime-{runtime},tls-{tls}",
218+
comment=f"test mysql {version} no-password",
219+
database_url_args="sslmode=verify_ca&ssl-ca=.%2Ftests%2Fcerts%2Fca.crt&ssl-key=.%2Ftests%2Fkeys%2Fclient.key&ssl-cert=.%2Ftests%2Fcerts%2Fclient.crt",
220+
service=f"mysql_{version}",
221+
tag=f"mysql_{version}_no_password" if runtime == "async-std" else f"mysql_{version}_no_password_{runtime}",
222+
)
221223

222224
#
223225
# mariadb
224226
#
225227

226228
for version in ["10_6", "10_5", "10_4", "10_3"]:
227229
run(
228-
f"cargo test --no-default-features --features macros,offline,any,all-types,mysql,runtime-{runtime}-{tls}",
230+
f"cargo test --no-default-features --features macros,any,_unstable-all-types,mysql,runtime-{runtime},tls-{tls}",
229231
comment=f"test mariadb {version}",
230232
service=f"mariadb_{version}",
231233
tag=f"mariadb_{version}" if runtime == "async-std" else f"mariadb_{version}_{runtime}",
232234
)
233235

234-
## +client-ssl
235-
for version in ["10_6_client_ssl", "10_5_client_ssl", "10_4_client_ssl", "10_3_client_ssl"]:
236-
run(
237-
f"cargo test --no-default-features --features macros,offline,any,all-types,mysql,runtime-{runtime}-{tls}",
238-
comment=f"test mariadb {version} no-password",
239-
database_url_args="sslmode=verify_ca&ssl-ca=.%2Ftests%2Fcerts%2Fca.crt&ssl-key=.%2Ftests%2Fkeys%2Fclient.key&ssl-cert=.%2Ftests%2Fcerts%2Fclient.crt",
240-
service=f"mariadb_{version}",
241-
tag=f"mariadb_{version}_no_password" if runtime == "async-std" else f"mariadb_{version}_no_password_{runtime}",
242-
)
236+
if tls != "none":
237+
## +client-ssl
238+
for version in ["10_6_client_ssl", "10_5_client_ssl", "10_4_client_ssl", "10_3_client_ssl"]:
239+
run(
240+
f"cargo test --no-default-features --features macros,any,_unstable-all-types,mysql,runtime-{runtime},tls-{tls}",
241+
comment=f"test mariadb {version} no-password",
242+
database_url_args="sslmode=verify_ca&ssl-ca=.%2Ftests%2Fcerts%2Fca.crt&ssl-key=.%2Ftests%2Fkeys%2Fclient.key&ssl-cert=.%2Ftests%2Fcerts%2Fclient.crt",
243+
service=f"mariadb_{version}",
244+
tag=f"mariadb_{version}_no_password" if runtime == "async-std" else f"mariadb_{version}_no_password_{runtime}",
245+
)
243246

244-
#
245-
# mssql
246-
#
247-
248-
for version in ["2019", "2017"]:
249-
run(
250-
f"cargo test --no-default-features --features macros,offline,any,all-types,mssql,runtime-{runtime}-{tls}",
251-
comment=f"test mssql {version}",
252-
service=f"mssql_{version}",
253-
tag=f"mssql_{version}" if runtime == "async-std" else f"mssql_{version}_{runtime}",
254-
)
255247

256248
# TODO: Use [grcov] if available
257249
# ~/.cargo/bin/grcov tests/.cache/target/debug -s sqlx-core/ -t html --llvm --branch -o ./target/debug/coverage

0 commit comments

Comments
 (0)