Skip to content

Commit

Permalink
Run the linux rust tests shard in docker to ensure an environment wit…
Browse files Browse the repository at this point in the history
…h the relevant python.

[ci skip-jvm-tests]
  • Loading branch information
stuhood committed Apr 24, 2020
1 parent 61b28e3 commit be78faf
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
13 changes: 8 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1967,8 +1967,12 @@ jobs:
- '3.6'
- '3.7'
script:
- ./build-support/bin/ci.py --rust-tests
- ./build-support/bin/release.sh -f
- docker build --rm -t travis_ci --build-arg "BASE_IMAGE=pantsbuild/centos6:latest"
--build-arg "TRAVIS_USER=$(id -un)" --build-arg "TRAVIS_UID=$(id -u)" --build-arg
"TRAVIS_GROUP=$(id -gn)" --build-arg "TRAVIS_GID=$(id -g)" build-support/docker/travis_ci/
- docker run --rm -t -v "${HOME}:/travis/home" -v "${TRAVIS_BUILD_DIR}:/travis/workdir"
travis_ci:latest sh -c "./build-support/bin/ci.py --rust-tests && ./build-support/bin/release.sh
-f"
stage: Test Pants
sudo: required
- before_cache:
Expand Down Expand Up @@ -2001,9 +2005,8 @@ jobs:
name: Rust tests - OSX
os: osx
osx_image: xcode8
script:
- ./build-support/bin/ci.py --rust-tests
- ./build-support/bin/release.sh -f
script: ./build-support/bin/ci.py --rust-tests && ./build-support/bin/release.sh
-f
stage: Test Pants
- addons:
apt:
Expand Down
18 changes: 13 additions & 5 deletions build-support/bin/generate_travis_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -653,23 +653,30 @@ def integration_tests_v2(python_version: PythonVersion) -> Dict:
# Rust tests
# -------------------------------------------------------------------------


# NB: We also build `fs_util` in this shard to leverage having had compiled the engine. This
# requires setting PREPARE_DEPLOY=1.
_RUST_TESTS_CMD = "./build-support/bin/ci.py --rust-tests && ./build-support/bin/release.sh -f"


_RUST_TESTS_BASE: Dict = {
**CACHE_NATIVE_ENGINE,
"stage": Stage.test.value,
"before_script": ["ulimit -c unlimited", "ulimit -n 8192"],
# NB: We also build `fs_util` in this shard to leverage having had compiled the engine. This
# requires setting PREPARE_DEPLOY=1.
"script": ["./build-support/bin/ci.py --rust-tests", "./build-support/bin/release.sh -f"],
"if": SKIP_RUST_CONDITION,
}


def rust_tests_linux() -> Dict:
def rust_tests_linux(python_version: PythonVersion) -> Dict:
return {
**_RUST_TESTS_BASE,
**linux_fuse_shard(),
"name": "Rust tests - Linux",
"env": ["CACHE_NAME=rust_tests.linux", "PREPARE_DEPLOY=1"],
"script": [
docker_build_travis_ci_image(python_version=python_version),
docker_run_travis_ci_image(_RUST_TESTS_CMD),
],
}


Expand Down Expand Up @@ -703,6 +710,7 @@ def rust_tests_osx() -> Dict:
"CACHE_NAME=rust_tests.osx",
"PREPARE_DEPLOY=1",
],
"script": _RUST_TESTS_CMD,
}


Expand Down Expand Up @@ -882,7 +890,7 @@ def main() -> None:
*integration_tests_v1(PythonVersion.py36),
*integration_tests_v1(PythonVersion.py36, use_pantsd=True),
*integration_tests_v1(PythonVersion.py37),
rust_tests_linux(),
rust_tests_linux(PythonVersion.py36),
rust_tests_osx(),
build_wheels_linux(),
build_wheels_osx(),
Expand Down

0 comments on commit be78faf

Please sign in to comment.