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

Add test for mach bootstrap

This will ensure that Salt changes or refactors don't
break the important `./mach bootstrap` use case.

Make sure to test that bootstrap actually uses the local saltfs tree,
and doesn't just pull down saltfs via gitfs.

Use a new Travis node instead of the existing test node
to avoid any side effects caused by the bootstrapper,
and for added parallelism.
  • Loading branch information
aneeshusa committed May 6, 2017
commit d06e5e12a779a1c224ba2b503b77ec2e109e5332
@@ -77,6 +77,12 @@ matrix:
os: linux
sudo: required
dist: trusty
# Not a Salt node, checks that mach bootstrap works
- env:
- SALT_NODE_ID=mach-bootstrap
os: linux
sudo: required
dist: trusty

script: .travis/dispatch.sh

@@ -81,6 +81,21 @@ if [[ "${SALT_NODE_ID}" == "test" ]]; then
# Run test suite separately for parallelism
setup_venv
./test.py
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 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
elif [[ -n "${SALT_DOCKER_IMAGE:-}" ]]; then # macOS bash is too old for `-v`
printf "Using %s\n" "$(docker -v)"

@@ -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|
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.