Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add mach bootstrap test #631

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

WIP: Test mach bootstrap inside docker

  • Loading branch information
aneeshusa committed May 6, 2017
commit 92b49d6119b79fcd6caf4c4d47c9703ae010403a
@@ -77,9 +77,18 @@ matrix:
os: linux
sudo: required
dist: trusty
# Not a Salt node, checks that mach bootstrap works
# Check that mach bootstrap works
- env:
- SALT_NODE_ID=mach-bootstrap
# ubuntu/14.04
- SALT_DOCKER_IMAGE=ubuntu@sha256:edf05697d8ea17028a69726b4b450ad48da8b29884cd640fec950c904bfb50ce
os: linux
sudo: required
dist: trusty
- env:
- SALT_NODE_ID=mach-bootstrap
# ubuntu/16.04
- SALT_DOCKER_IMAGE=ubuntu@sha256:f3a61450ae43896c4332bda5e78b453f4a93179045f20c8181043b26b5e79028
os: linux
sudo: required
dist: trusty
@@ -46,9 +46,19 @@ run_inside_docker() {
# (without exporting the `SALT_DOCKER_IMAGE` environment variable
# to prevent recursion)
local -r DOCKER_SALT_ROOT="/tmp/salt"

# Use an env file for variables which may or may not be present
local -r DOCKER_ENV_FILE="/tmp/docker-env-file"
printf '' > "${DOCKER_ENV_FILE}"
# macOS bash is too old for `-v`, so use `-n` and default empty instead
if [[ -n "${SALT_FROM_SCRATCH:-}" ]]; then
printf "%s\n" >> "${DOCKER_ENV_FILE}" \
"SALT_FROM_SCRATCH=${SALT_FROM_SCRATCH}"
fi

docker run \
--env-file="${DOCKER_ENV_FILE}" \
--env="SALT_NODE_ID=${SALT_NODE_ID}" \
--env="SALT_FROM_SCRATCH=${SALT_FROM_SCRATCH}" \
--env="TRAVIS_COMMIT=${TRAVIS_COMMIT}" \
--env="TRAVIS_OS_NAME=${TRAVIS_OS_NAME}" \
--volume="$(pwd):${DOCKER_SALT_ROOT}" \
@@ -77,7 +87,11 @@ if (( EUID != 0 )); then
fi


if [[ "${SALT_NODE_ID}" == "test" ]]; then
if [[ -n "${SALT_DOCKER_IMAGE:-}" ]]; then # macOS bash is too old for `-v`
printf "Using %s\n" "$(docker -v)"

run_inside_docker "$@"
elif [[ "${SALT_NODE_ID}" == "test" ]]; then
# Run test suite separately for parallelism
setup_venv
./test.py
@@ -86,6 +100,10 @@ elif [[ "${SALT_NODE_ID}" == "mach-bootstrap" ]]; then
# so that `python-apt` is available
export PATH="/usr/bin:${PATH}"

# Install git (not present by default in Docker)
sudo apt-get update
sudo apt-get -y install git

# Run mach bootstrap test separately from `test` because it installs things
git clone --depth 1 https://github.com/servo/servo.git ../servo

@@ -96,10 +114,6 @@ elif [[ "${SALT_NODE_ID}" == "mach-bootstrap" ]]; then

# Check that the local saltfs tree was used
./test.py servo.bootstrap
elif [[ -n "${SALT_DOCKER_IMAGE:-}" ]]; then # macOS bash is too old for `-v`
printf "Using %s\n" "$(docker -v)"

run_inside_docker "$@"
else
if [[ "${SALT_FROM_SCRATCH}" = "true" ]]; then
run_salt 'scratch'
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.