-
Notifications
You must be signed in to change notification settings - Fork 0
/
kitchen.yml
85 lines (79 loc) · 2.54 KB
/
kitchen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
driver:
name: docker
# Don't bother transferring any build context to Docker
build_context: false
# Don't install Chef
require_chef_omnibus: false
provisioner:
name: ansible_playbook
# Don't use hyphens
hosts: test_kitchen
role_name: starship_rs
ansible_sudo: false
idempotency_test: true
# Don't install via Ansible omnibus
require_ansible_omnibus: false
# Install via OS package manager. This is broken on Focal
require_ansible_repo: true
# Don't install Chef
require_chef_for_busser: false
requirements_path: requirements.yml
requirements_collection_path: requirements.yml
lifecycle:
# Copies the role into each suite dir so that it can be copied to each host.
# kitchen-ansible doesn't support testing an individual role in a repository,
# so we work around that this way.
pre_converge: |
echo "## Preparing role for copying"
rm -rf "test/integration/${KITCHEN_SUITE_NAME}/roles"
mkdir -p "test/integration/${KITCHEN_SUITE_NAME}/roles/starship_rs";
# Don't quote $(ls) or it breaks
for f in $(ls); do
# Avoid infinitely nesting the role or copying language dependencies
if [ "$f" != 'test' ] && [ "${f}" != 'vendor' ] && [ "${f}" != '.venv' ]; then
cp -Rv "${f}" ./test/integration/${KITCHEN_SUITE_NAME}/roles/starship_rs/
fi
done
# Ensure contents are flushed to disk to try and avoid race conditions
sync
# More defensive coding
sleep 1
platforms:
- name: ubuntu-20.04
driver:
# Use a custom Dockerfile to install Ansible ahead of time. This is because
# the existing installation options for Ansible don't seem to support Focal
# properly
dockerfile: test/integration/linux/Dockerfile.erb
provisioner:
require_ansible_repo: false
- name: ubuntu-18.04
provisioner:
# Installs the toml python package
custom_post_install_command: >
sudo apt-get install python-pip --no-install-recommends --yes &&
sudo -H pip install toml
- name: ubuntu-16.04
provisioner:
# Installs the toml python package
custom_post_install_command: >
sudo apt-get install python-pip --no-install-recommends --yes &&
LC_ALL=C LC_CTYPE=C sudo -H pip install toml
- name: macos-10.15
driver:
name: exec
provisioner:
# This tries to install Ansible via Homebrew
require_ansible_repo: false
verifier:
name: inspec
suites:
- name: linux
includes:
- ubuntu-20.04
- ubuntu-16.04
- ubuntu-18.04
- name: darwin
includes:
- macos-10.15