Skip to content

Commit

Permalink
add new test type and upgrade ansible version (#74)
Browse files Browse the repository at this point in the history
* add new test type and upgrade ansible version

* fix version

* fix error and support python3 test

* add fix
  • Loading branch information
ahelal authored Nov 11, 2018
1 parent 2079ddd commit ef4e508
Show file tree
Hide file tree
Showing 32 changed files with 532 additions and 253 deletions.
56 changes: 56 additions & 0 deletions .kitchen-cluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---

driver :
name : docker
socket : unix:///var/run/docker.sock
use_sudo : false
privileged : true
volume : /opt/concourseci/worker
provision_command : mkdir -p /run/sshd

verifier :
name : serverspec
remote_exec : false
default_pattern : true
bundler_path : <%= '/opt/hellofresh/kitchen/embedded/bin' if File.exist?('/opt/hellofresh/kitchen/embedded/bin/bundler') %>
rspec_path : <%= '/opt/hellofresh/kitchen/embedded/bin' if File.exist?('/opt/hellofresh/kitchen/embedded/bin/rspec') %>
gemfile : ./test/integration/Gemfile

provisioner :
name : ansible_push
ansible_config : "tests/ansible.cfg"
ansible_playbook_bin : "`avm path v2.7`ansible-playbook"
extra_vars : "@./test/integration/simple/concourse-vars.yml"
raw_arguments : "--extra-vars='ansible_python_interpreter=/usr/bin/python3'"

groups :
concourse-web : ['web-ubuntu1804']
concourse-worker : ['worker-ubuntu1804']
chef_bootstrap_url : nil
use_instance_name : True
idempotency_test : false
diff : True
sudo : True
verbose : "v"

platforms :
- name : "ubuntu1804"
driver_config :
image : ubuntu:18.04
platform : ubuntu

suites:
- name : web
provisioner :
playbook : "test/integration/web/web.yml"
driver_config :
instance_name : "web-ubuntu1804"
hostname : "web-ubuntu1804"

- name : worker
provisioner :
playbook : "test/integration/worker/worker.yml"
driver_config :
hostname : "worker-ubuntu1804"
instance_name : "worker-ubuntu1804"
links : "web-ubuntu1804"
69 changes: 31 additions & 38 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,49 +24,37 @@ provisioner :
idempotency_test : True
diff : True
sudo : True
extra_vars : "@./test/integration/simple/concourse-vars.yml"
#verbose : "vvvvv"

platforms :

- name : "ubuntu1404_24"
### Ubuntu 1404
- name : "ubuntu1404_25"
driver_config :
image : ubuntu:14.04
platform : ubuntu
provisioner :
ansible_playbook_bin : "`avm path v2.4`ansible-playbook"
ansible_playbook_bin : "`avm path v2.5`ansible-playbook"
groups :
concourse-web :
- 'simple-ubuntu1404-24'
- 'simple-ubuntu1404-25'
concourse-worker :
- 'simple-ubuntu1404-24'
- 'worker-ubuntu1404-24'
- 'simple-ubuntu1404-25'
- 'worker-ubuntu1404-25'

- name : "ubuntu1404_26"
- name : "ubuntu1404_27"
driver_config :
image : ubuntu:14.04
platform : ubuntu
provisioner :
ansible_playbook_bin : "`avm path v2.6`ansible-playbook"
groups :
concourse-web :
- 'simple-ubuntu1404-26'
concourse-worker :
- 'simple-ubuntu1404-26'
- 'worker-ubuntu1404-26'

- name : "ubuntu1604_24"
driver_config :
image : ubuntu:16.04
platform : ubuntu
provisioner :
ansible_playbook_bin : "`avm path v2.4`ansible-playbook"
ansible_playbook_bin : "`avm path v2.7`ansible-playbook"
groups :
concourse-web :
- 'simple-ubuntu1604-24'
- 'simple-ubuntu1404-27'
concourse-worker :
- 'simple-ubuntu1604-24'
- 'worker-ubuntu1604-24'

- 'simple-ubuntu1404-27'
- 'worker-ubuntu1404-27'
### Ubuntu 1604
- name : "ubuntu1604_25"
driver_config :
image : ubuntu:16.04
Expand All @@ -93,6 +81,19 @@ platforms :
- 'simple-ubuntu1604-26'
- 'worker-ubuntu1604-26'

- name : "ubuntu1604_27"
driver_config :
image : ubuntu:16.04
platform : ubuntu
provisioner :
ansible_playbook_bin : "`avm path v2.7`ansible-playbook"
groups :
concourse-web :
- 'simple-ubuntu1604-27'
concourse-worker :
- 'simple-ubuntu1604-27'
- 'worker-ubuntu1604-27'
### Ubuntu 1804
- name : "ubuntu1804_25"
driver_config :
image : ubuntu:18.04
Expand All @@ -106,30 +107,22 @@ platforms :
- 'simple-ubuntu1804-25'
- 'worker-ubuntu1804-25'

- name : "ubuntu1804_26"
- name : "ubuntu1804_27"
driver_config :
image : ubuntu:18.04
platform : ubuntu
provisioner :
ansible_playbook_bin : "`avm path v2.6`ansible-playbook"
ansible_playbook_bin : "`avm path v2.7`ansible-playbook"
groups :
concourse-web :
- 'simple-ubuntu1804-26'
- 'simple-ubuntu1804-27'
concourse-worker :
- 'simple-ubuntu1804-26'
- 'worker-ubuntu1804-26'


- 'simple-ubuntu1804-27'
- 'worker-ubuntu1804-27'

suites:
- name : simple
provisioner :
playbook : "test/integration/simple/simple.yml"
driver_config :
hostname : "simple"

# - name : manage
# provisioner :
# playbook : "test/integration/manage/manage.yml"
# driver_config :
# hostname : "manage"
10 changes: 7 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@ services:
- docker

env:
- TEST_COMMAND="bundle exec kitchen test simple-ubuntu1404-26"
- TEST_COMMAND="bundle exec kitchen test simple-ubuntu1604-24"
- TEST_COMMAND="bundle exec kitchen test simple-ubuntu1404-25"
- TEST_COMMAND="bundle exec kitchen test simple-ubuntu1404-27"

- TEST_COMMAND="bundle exec kitchen test simple-ubuntu1604-25"
- TEST_COMMAND="bundle exec kitchen test simple-ubuntu1604-26"
- TEST_COMMAND="bundle exec kitchen test simple-ubuntu1604-27"

- TEST_COMMAND="bundle exec kitchen test simple-ubuntu1804-25"
- TEST_COMMAND="bundle exec kitchen test simple-ubuntu1804-26"
- TEST_COMMAND="bundle exec kitchen test simple-ubuntu1804-27"
- TEST_COMMAND="./test/test-cluster.sh"

before_install:
# Make sure everything's up to date.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ group :development do
gem 'kitchen-ansiblepush'
gem 'kitchen-docker'
gem 'kitchen-verifier-serverspec'
gem 'thor', '0.19.1' # temp fix for issue http://stackoverflow.com/questions/40823526/validate-default-type-an-options-default-must-match-its-type-argumenterror
gem 'thor'
gem 'net-ssh'
gem 'serverspec'
end
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ GEM
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.1)
rspec-expectations (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.8.0)
rspec-its (1.2.0)
Expand All @@ -59,7 +59,7 @@ GEM
rspec-its
specinfra (~> 2.72)
sfl (2.3)
specinfra (2.76.2)
specinfra (2.76.3)
net-scp
net-ssh (>= 2.7)
net-telnet (= 0.1.1)
Expand All @@ -74,8 +74,8 @@ GEM
winrm (~> 2.0)
winrm-elevated (~> 1.0)
winrm-fs (~> 1.1)
thor (0.19.1)
winrm (2.2.3)
thor (0.20.3)
winrm (2.3.0)
builder (>= 2.1.2)
erubis (~> 2.7)
gssapi (~> 1.2)
Expand All @@ -87,7 +87,7 @@ GEM
winrm-elevated (1.1.0)
winrm (~> 2.0)
winrm-fs (~> 1.0)
winrm-fs (1.3.0)
winrm-fs (1.3.1)
erubis (~> 2.7)
logging (>= 1.6.1, < 3.0)
rubyzip (~> 1.1)
Expand All @@ -103,7 +103,7 @@ DEPENDENCIES
net-ssh
serverspec
test-kitchen
thor (= 0.19.1)
thor

BUNDLED WITH
1.16.0
1 change: 0 additions & 1 deletion tasks/common_nix.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---


- name: common | Combine dictionary options (web)
set_fact:
concourse_web_options_combined: '{{ concourse_web_options_default | combine(concourse_web_options) | combine(concourse_facts_local_users) | combine(concourse_facts_main_users) }}'
Expand Down
14 changes: 7 additions & 7 deletions test/ansible-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ set -e

AVM_VERSION="v1.0.0"

export ANSIBLE_VERSIONS_1="2.4.5"
export ANSIBLE_VERSIONS_1="2.5.11"
export INSTALL_TYPE_1="pip"
export ANSIBLE_LABEL_1="v2.4"
export ANSIBLE_LABEL_1="v2.5"

export ANSIBLE_VERSIONS_2="2.5.10"
export ANSIBLE_VERSIONS_2="2.6.7"
export INSTALL_TYPE_2="pip"
export ANSIBLE_LABEL_2="v2.5"
export ANSIBLE_LABEL_2="v2.6"

export ANSIBLE_VERSIONS_3="2.6.6"
export ANSIBLE_VERSIONS_3="2.7.1"
export INSTALL_TYPE_3="pip"
export ANSIBLE_LABEL_3="v2.6"
export ANSIBLE_LABEL_3="v2.7"

# Whats the default version
export ANSIBLE_DEFAULT_VERSION="v2.4"
export ANSIBLE_DEFAULT_VERSION="v2.5"

## Create a temp dir to download avm
avm_dir="$(mktemp -d 2> /dev/null || mktemp -d -t 'mytmpdir')"
Expand Down
2 changes: 1 addition & 1 deletion test/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ callback_whitelist = changes
pipelining=True

## SSH Args
control_path = %(directory)s/%%h-%%r
control_path=%(directory)s/ansible-ssh-%%h-%%p-%%r
Loading

0 comments on commit ef4e508

Please sign in to comment.