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 all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -6,77 +6,92 @@ language: cpp
# sudo: required and dist: trusty enable usage of Trusty
matrix:
include:
# Salt from scratch
# # Salt from scratch
# - env:
# - SALT_NODE_ID=servo-linux-cross1
# - SALT_FROM_SCRATCH=true
# os: linux
# sudo: required
# dist: trusty
# - env:
# - SALT_NODE_ID=servo-mac1
# - SALT_FROM_SCRATCH=true
# os: osx
# osx_image: xcode7.3
# - env:
# - SALT_NODE_ID=servo-linux1
# - SALT_FROM_SCRATCH=true
# os: linux
# sudo: required
# dist: trusty
# - env:
# - SALT_NODE_ID=servo-master1
# - SALT_FROM_SCRATCH=true
# os: linux
# sudo: required
# dist: trusty
# # Salt from previous configuration
# - env:
# - SALT_NODE_ID=servo-linux-cross1
# - SALT_FROM_SCRATCH=false
# os: linux
# sudo: required
# dist: trusty
# - env:
# - SALT_NODE_ID=servo-mac1
# - SALT_FROM_SCRATCH=false
# os: osx
# osx_image: xcode7.3
# - env:
# - SALT_NODE_ID=servo-linux1
# - SALT_FROM_SCRATCH=false
# os: linux
# sudo: required
# dist: trusty
# - env:
# - SALT_NODE_ID=servo-master1
# - SALT_FROM_SCRATCH=false
# os: linux
# sudo: required
# dist: trusty
# # Salt inside Docker
# - env:
# - SALT_NODE_ID=servo-linux1
# - SALT_FROM_SCRATCH=true
# # ubuntu/14.04
# - SALT_DOCKER_IMAGE=ubuntu@sha256:edf05697d8ea17028a69726b4b450ad48da8b29884cd640fec950c904bfb50ce
# os: linux
# sudo: required
# dist: trusty
# - env:
# - SALT_NODE_ID=servo-linux1
# - SALT_FROM_SCRATCH=true
# # ubuntu/16.04
# - SALT_DOCKER_IMAGE=ubuntu@sha256:f3a61450ae43896c4332bda5e78b453f4a93179045f20c8181043b26b5e79028
# os: linux
# sudo: required
# dist: trusty
# # Not a Salt node, runs test suite instead
# - env:
# - SALT_NODE_ID=test
# os: linux
# sudo: required
# dist: trusty
# Check that mach bootstrap works
- env:
- SALT_NODE_ID=servo-linux-cross1
- SALT_FROM_SCRATCH=true
os: linux
sudo: required
dist: trusty
- env:
- SALT_NODE_ID=servo-mac1
- SALT_FROM_SCRATCH=true
os: osx
osx_image: xcode7.3
- env:
- SALT_NODE_ID=servo-linux1
- SALT_FROM_SCRATCH=true
os: linux
sudo: required
dist: trusty
- env:
- SALT_NODE_ID=servo-master1
- SALT_FROM_SCRATCH=true
os: linux
sudo: required
dist: trusty
# Salt from previous configuration
- env:
- SALT_NODE_ID=servo-linux-cross1
- SALT_FROM_SCRATCH=false
os: linux
sudo: required
dist: trusty
- env:
- SALT_NODE_ID=servo-mac1
- SALT_FROM_SCRATCH=false
os: osx
osx_image: xcode7.3
- env:
- SALT_NODE_ID=servo-linux1
- SALT_FROM_SCRATCH=false
os: linux
sudo: required
dist: trusty
- env:
- SALT_NODE_ID=servo-master1
- SALT_FROM_SCRATCH=false
os: linux
sudo: required
dist: trusty
# Salt inside Docker
- env:
- SALT_NODE_ID=servo-linux1
- SALT_FROM_SCRATCH=true
- SALT_NODE_ID=mach-bootstrap
# ubuntu/14.04
- SALT_DOCKER_IMAGE=ubuntu@sha256:edf05697d8ea17028a69726b4b450ad48da8b29884cd640fec950c904bfb50ce
os: linux
sudo: required
dist: trusty
- env:
- SALT_NODE_ID=servo-linux1
- SALT_FROM_SCRATCH=true
- SALT_NODE_ID=mach-bootstrap
# ubuntu/16.04
- SALT_DOCKER_IMAGE=ubuntu@sha256:f3a61450ae43896c4332bda5e78b453f4a93179045f20c8181043b26b5e79028
os: linux
sudo: required
dist: trusty
# Not a Salt node, runs test suite instead
- env:
- SALT_NODE_ID=test
os: linux
sudo: required
dist: trusty

script: .travis/dispatch.sh

@@ -45,10 +45,20 @@ run_inside_docker() {
# Reexec this script inside docker
# (without exporting the `SALT_DOCKER_IMAGE` environment variable
# to prevent recursion)
local -r DOCKER_SALT_ROOT="/tmp/salt"
local -r DOCKER_SALT_ROOT="/tmp/saltfs"

# 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,16 +87,35 @@ 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
elif [[ -n "${SALT_DOCKER_IMAGE:-}" ]]; then # macOS bash is too old for `-v`
printf "Using %s\n" "$(docker -v)"
elif [[ "${SALT_NODE_ID}" == "mach-bootstrap" ]]; then
# Use system Python 2, not one of the supplemental ones Travis installs,
# so that `python-apt` is available
export PATH="/usr/bin:${PATH}"

run_inside_docker "$@"
# Install basic deps (not present by default in Docker)
${SUDO} apt-get update
${SUDO} apt-get -y install git python-apt python-dev python-pip python-virtualenv

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

# mach is intolerant of being run from other directories
cd ../servo
SERVO_SALTFS_ROOT="../saltfs" ./mach bootstrap --force
cd ../saltfs

# Check that the local saltfs tree was used
./test.py servo.bootstrap
else
if [ "${SALT_FROM_SCRATCH}" = "true" ]; then
if [[ "${SALT_FROM_SCRATCH}" = "true" ]]; then
run_salt 'scratch'
else
git fetch origin master:master
@@ -46,7 +46,7 @@ Vagrant.configure(2) do |config|
os_and_version = node['os'] + version
puts "OS #{os_and_version} is not yet supported"
end
elsif node_config[:id] != 'test'
elsif node_config[:id].start_with? 'servo-'
node_config
end
end.compact.uniq.each do |node|
@@ -18,7 +18,7 @@ python3:
{% endif %}
{% endif %}

{% if grains['os'] == 'Ubuntu' %}
{% if grains['os_family'] == 'Debian' %}
python2-dev:
pkg.installed:
- pkgs:
@@ -28,7 +28,7 @@ python2-dev:
pip:
pkg.installed:
- pkgs:
{% if grains['os'] in ['CentOS', 'Fedora', 'Ubuntu'] %}
{% if grains['os'] in ['CentOS', 'Fedora', 'Ubuntu', 'Debian'] %}
- python-pip
{% elif grains['os'] == 'MacOS' %}
- python # pip is included with python in homebrew
@@ -16,7 +16,7 @@ servo-dependencies:
- openssl
- pkg-config
- yasm
{% elif grains['os'] == 'Ubuntu' %}
{% elif grains['os_family'] == 'Debian' %}
- autoconf2.13
- curl
- freeglut3-dev
No changes.
@@ -0,0 +1,13 @@
import json

from tests.util import Failure, Success


def run():
with open('.servo/salt/etc/salt/minion') as config_file:
config = json.load(config_file)
ok = config['fileserver_backend'] == ['roots']
if ok:
return Success("mach bootstrap ran with the local saltfs tree")
else:
return Failure("mach bootstrap created bad config:", config)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.