From 9400a81cb05a65bcbed7968e848db2a93bcb2b95 Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Sat, 18 Jul 2020 03:18:25 -0700 Subject: [PATCH] test: switch tests/x.py to use host rustc for running tests --- tests/Dockerfile | 4 ---- tests/docker-compose.yml | 12 ------------ tests/x.py | 29 ++++++----------------------- 3 files changed, 6 insertions(+), 39 deletions(-) delete mode 100644 tests/Dockerfile diff --git a/tests/Dockerfile b/tests/Dockerfile deleted file mode 100644 index 72141dcc..00000000 --- a/tests/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM rust:stretch - -RUN rustup toolchain install nightly-2020-05-30 && \ - rustup default nightly-2020-05-30 diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 8a3f0c41..10d8662e 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -1,18 +1,6 @@ version: "3" services: - sqlx: - build: "." - volumes: - - "../:/home/rust/src" - - "$HOME/.cargo/registry:/usr/local/cargo/registry" - working_dir: "/home/rust/src" - environment: - CARGO_TARGET_DIR: "/home/rust/src/tests/target" - CARGO_INCREMENTAL: "0" - RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort" - RUSTDOCFLAGS: "-Cpanic=abort" - # # MySQL 5.6.x, 5.7.x, 8.x # https://www.mysql.com/support/supportedplatforms/database.html diff --git a/tests/x.py b/tests/x.py index 401e4842..f9e83f5b 100755 --- a/tests/x.py +++ b/tests/x.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + import subprocess import os import sys @@ -42,12 +44,6 @@ def run(command, comment=None, env=None, service=None, tag=None, args=None): if comment is not None: print(f"\x1b[2m # {comment}\x1b[0m") - environ = [] - if env is not None: - for name, value in env.items(): - print(f"\x1b[93m $ {name}={value}\x1b[0m") - environ.append(f"-e{name}={value}") - if service is not None: start(service) @@ -64,25 +60,12 @@ def run(command, comment=None, env=None, service=None, tag=None, args=None): print(f"\x1b[93m $ {command} {' '.join(command_args)}\x1b[0m") - # try and rebind the user by id - # this only matters on *nix - - try: - user = ["--user", f"{os.getuid()}:{os.getgid()}"] - except: # noqa - user = [] - res = subprocess.run( [ - "docker-compose", - "run", - *user, - "--rm", - *environ, - "sqlx", *command.split(" "), *command_args ], + env=env, cwd=os.path.dirname(__file__), ) @@ -102,19 +85,19 @@ for path in glob(os.path.join(os.path.dirname(__file__), "target/**/*.gc*"), rec run("cargo c", comment="check with a default set of features", tag="check") run( - "cargo c --no-default-features --features runtime-async-std,all-databases,all-types", + "cargo c --no-default-features --features runtime-async-std,all-databases,all-types,offline,macros", comment="check with async-std", tag="check_async_std" ) run( - "cargo c --no-default-features --features runtime-tokio,all-databases,all-types", + "cargo c --no-default-features --features runtime-tokio,all-databases,all-types,offline,macros", comment="check with tokio", tag="check_tokio" ) run( - "cargo c --no-default-features --features runtime-actix,all-databases,all-types", + "cargo c --no-default-features --features runtime-actix,all-databases,all-types,offline,macros", comment="check with actix", tag="check_actix" )