Skip to content

Commit

Permalink
Test fix (#66)
Browse files Browse the repository at this point in the history
* use last 3 version of ansible only

* upgrade ansible push and fix kitchen.yml

* fix default version

* fix avm path

* change order of tests

* debug travis

* Fix fly version issue
  • Loading branch information
ahelal authored May 1, 2018
1 parent a40d722 commit 279651c
Show file tree
Hide file tree
Showing 12 changed files with 105 additions and 100 deletions.
85 changes: 25 additions & 60 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,110 +22,75 @@ provisioner :
idempotency_test : True
diff : True
sudo : True
#verbose : "vvvv"
verbose : "vvvv"

platforms :

- name : "ubuntu1404_20"
- name : "ubuntu1404_23"
driver_config :
image : ubuntu:14.04
platform : ubuntu

provisioner :
ansible_playbook_bin : "`avm path v2.0`ansible-playbook"
# Hash of other groups
ansible_playbook_bin : "`avm path v2.3`ansible-playbook"
groups :
concourse-web :
- 'simple-ubuntu1404-20'
- 'simple-ubuntu1404-23'
concourse-worker :
- 'simple-ubuntu1404-20'
- 'worker-ubuntu1404-20'
- 'simple-ubuntu1404-23'
- 'worker-ubuntu1404-23'

- name : "ubuntu1404_24"
- name : "ubuntu1404_25"
driver_config :
image : ubuntu:14.04
platform : ubuntu

provisioner :
ansible_playbook_bin : "`avm path v2.4`ansible-playbook"
# Hash of other groups
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'

- name : "ubuntu1604_20"
driver_config :
image : ubuntu:16.04
platform : ubuntu
provisioner :
ansible_playbook_bin : "`avm path v2.0`ansible-playbook"
# Hash of other groups
groups :
concourse-web :
- 'simple-ubuntu1604-20'
concourse-worker :
- 'simple-ubuntu1604-20'
- 'worker-ubuntu1604-20'

- name : "ubuntu1604_21"
driver_config :
image : ubuntu:16.04
platform : ubuntu
provisioner :
ansible_playbook_bin : "`avm path v2.1`ansible-playbook"
# Hash of other groups
groups :
concourse-web :
- 'simple-ubuntu1604-21'
concourse-worker :
- 'simple-ubuntu1604-21'
- 'worker-ubuntu1604-21'

- name : "ubuntu1604_22"
driver_config :
image : ubuntu:16.04
platform : ubuntu
provisioner :
ansible_playbook_bin : "`avm path v2.2`ansible-playbook"
# Hash of other groups
groups :
concourse-web :
- 'simple-ubuntu1604-22'
concourse-worker :
- 'simple-ubuntu1604-22'
- 'worker-ubuntu1604-22'
- 'simple-ubuntu1404-25'
- 'worker-ubuntu1404-25'

- name : "ubuntu1604_23"
driver_config :
image : ubuntu:16.04
platform : ubuntu
provisioner :
ansible_playbook_bin : "`avm path v2.3`ansible-playbook"
# Hash of other groups
groups :
concourse-web :
- 'simple-ubuntu1604-23'
concourse-worker :
- 'simple-ubuntu1604-23'
- 'worker-ubuntu1604-23'

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

- name : "ubuntu1604_25"
driver_config :
image : ubuntu:16.04
platform : ubuntu
provisioner :
ansible_playbook_bin : "`avm path v2.5`ansible-playbook"
groups :
concourse-web :
- 'simple-ubuntu1604-25'
concourse-worker :
- 'simple-ubuntu1604-25'
- 'worker-ubuntu1604-25'

suites:
- name : simple
provisioner :
Expand Down
8 changes: 3 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ services:
- docker

env:
- TEST_COMMAND="bundle exec kitchen test ubuntu1404-20"
- TEST_COMMAND="bundle exec kitchen test ubuntu1404-24"
- TEST_COMMAND="bundle exec kitchen test ubuntu1604-20"
- TEST_COMMAND="bundle exec kitchen test ubuntu1604-21"
- TEST_COMMAND="bundle exec kitchen test ubuntu1604-22"
- TEST_COMMAND="bundle exec kitchen test ubuntu1404-23"
- TEST_COMMAND="bundle exec kitchen test ubuntu1404-25"
- TEST_COMMAND="bundle exec kitchen test ubuntu1604-23"
- TEST_COMMAND="bundle exec kitchen test ubuntu1604-24"
- TEST_COMMAND="bundle exec kitchen test ubuntu1604-25"

before_install:
# Make sure everything's up to date.
Expand Down
59 changes: 45 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
GEM
remote: https://rubygems.org/
specs:
artifactory (2.8.2)
builder (3.2.3)
diff-lcs (1.3)
kitchen-ansiblepush (0.8.0)
erubis (2.7.0)
ffi (1.9.23)
gssapi (1.2.0)
ffi (>= 1.0.1)
gyoku (1.3.1)
builder (>= 2.1.2)
httpclient (2.8.3)
kitchen-ansiblepush (0.9.1)
test-kitchen (~> 1.4)
kitchen-docker (2.6.0)
test-kitchen (>= 1.0.0)
kitchen-verifier-serverspec (0.6.10)
net-ssh (>= 3)
test-kitchen (~> 1.4)
mixlib-install (2.1.12)
artifactory
little-plugger (1.1.4)
logging (2.2.2)
little-plugger (~> 1.1)
multi_json (~> 1.10)
mixlib-install (3.9.3)
mixlib-shellout
mixlib-versioning
thor
mixlib-shellout (2.2.7)
mixlib-shellout (2.3.2)
mixlib-versioning (1.2.2)
multi_json (1.12.2)
multi_json (1.13.1)
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (4.2.0)
net-ssh-gateway (1.3.0)
net-ssh (>= 2.6.5)
net-telnet (0.1.1)
nori (2.6.0)
rspec (3.7.0)
rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0)
rspec-mocks (~> 3.7.0)
rspec-core (3.7.0)
rspec-core (3.7.1)
rspec-support (~> 3.7.0)
rspec-expectations (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
Expand All @@ -39,28 +50,48 @@ GEM
rspec-mocks (3.7.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.7.0)
rspec-support (3.7.0)
safe_yaml (1.0.4)
serverspec (2.41.2)
rspec-support (3.7.1)
rubyntlm (0.6.2)
rubyzip (1.2.1)
serverspec (2.41.3)
multi_json
rspec (~> 3.0)
rspec-its
specinfra (~> 2.72)
sfl (2.3)
specinfra (2.72.0)
specinfra (2.73.3)
net-scp
net-ssh (>= 2.7, < 5.0)
net-telnet
sfl
test-kitchen (1.16.0)
mixlib-install (>= 1.2, < 3.0)
test-kitchen (1.21.1)
mixlib-install (~> 3.6)
mixlib-shellout (>= 1.2, < 3.0)
net-scp (~> 1.1)
net-ssh (>= 2.9, < 5.0)
net-ssh-gateway (~> 1.2)
safe_yaml (~> 1.0)
thor (~> 0.19, < 0.19.2)
winrm (~> 2.0)
winrm-elevated (~> 1.0)
winrm-fs (~> 1.1)
thor (0.19.1)
winrm (2.2.3)
builder (>= 2.1.2)
erubis (~> 2.7)
gssapi (~> 1.2)
gyoku (~> 1.0)
httpclient (~> 2.2, >= 2.2.0.2)
logging (>= 1.6.1, < 3.0)
nori (~> 2.0)
rubyntlm (~> 0.6.0, >= 0.6.1)
winrm-elevated (1.1.0)
winrm (~> 2.0)
winrm-fs (~> 1.0)
winrm-fs (1.2.0)
erubis (~> 2.7)
logging (>= 1.6.1, < 3.0)
rubyzip (~> 1.1)
winrm (~> 2.0)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Please look at [configuration section](https://github.com/ahelal/ansible-concour

## Requirements

* Ansible 2.0 or higher
* Ansible 2.3 or higher
* PostgreSQL I recommend [ansible postgresql role](https://github.com/ANXS/postgresql)

Supported platforms:
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# Concourse version
concourseci_version : "v3.10.0"
concourseci_version : "v3.13.0"

## Dir structure
concourseci_base_dir : "/opt/concourseci"
Expand Down
12 changes: 9 additions & 3 deletions tasks/manage/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
---

- name: manage | main | Download fly
- name: manage | main | Download fly binary
get_url:
url: "{{ concourseci_manage_url }}/api/v1/cli?arch=amd64&platform={{ ansible_system | lower }}"
dest: "{{ concourseci_bin_dir }}/fly"
dest: "{{ concourseci_bin_dir }}/fly-{{ concourseci_version }}"
mode: 0755

- include: teams.yml
- name: manage | main | Link fly binary
file:
src: "{{ concourseci_bin_dir }}/fly-{{ concourseci_version }}"
dest: "{{ concourseci_bin_dir }}/fly"
state: link

- include: teams.yml
21 changes: 7 additions & 14 deletions test/ansible-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,21 @@
set -e

AVM_VERSION="v1.0.0"
export ANSIBLE_VERSIONS_0="2.0.2.0"
export INSTALL_TYPE_0="pip"
export ANSIBLE_LABEL_0="v2.0"

export ANSIBLE_VERSIONS_1="2.1.6.0"
export ANSIBLE_VERSIONS_1="2.3.3.0"
export INSTALL_TYPE_1="pip"
export ANSIBLE_LABEL_1="v2.1"
export ANSIBLE_LABEL_1="v2.3"

export ANSIBLE_VERSIONS_2="2.2.3.0"
export ANSIBLE_VERSIONS_2="2.4.4.0"
export INSTALL_TYPE_2="pip"
export ANSIBLE_LABEL_2="v2.2"
export ANSIBLE_LABEL_2="v2.4"

export ANSIBLE_VERSIONS_3="2.3.2.0"
export ANSIBLE_VERSIONS_3="2.5.2"
export INSTALL_TYPE_3="pip"
export ANSIBLE_LABEL_3="v2.3"

export ANSIBLE_VERSIONS_4="2.4.2.0"
export INSTALL_TYPE_4="pip"
export ANSIBLE_LABEL_4="v2.4"
export ANSIBLE_LABEL_3="v2.5"

# Whats the default version
export ANSIBLE_DEFAULT_VERSION="v2.0"
export ANSIBLE_DEFAULT_VERSION="v2.3"

## Create a temp dir to download avm
avm_dir="$(mktemp -d 2> /dev/null || mktemp -d -t 'mytmpdir')"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,35 @@
fly = '/usr/local/bin/fly -t kitchen'
builds = "#{fly} builds"




describe 'simple_success job' do
describe command("#{builds} | grep simple_success") do
it 'simple_success are in the builds' do
puts "#################################"
puts "#{subject.stdout}"
puts "#################################"
expect(subject.stdout).to match('simple_success')
expect(subject.exit_status).to eq(0)
end
end

describe command("#{builds} | grep simple_success | head -1 | awk '{ print $4 }'") do
it 'simple_success pipelines should be succeeded' do
it 'simple_success pipeline should succeed' do
puts "#################################"
puts "#{subject.stdout}"
puts "#################################"
expect(subject.stdout).to match('succeeded')
expect(subject.exit_status).to eq(0)
end
end

describe command("#{fly} watch -b $(#{builds} | grep simple_success | head -1 | awk '{ print $1 }')") do
it 'simple_success pipelines log should have "I WILL SUCCESSED"' do
it 'simple_success pipeline log should have "I WILL SUCCESSED"' do
puts "#################################"
puts "#{subject.stdout}"
puts "#################################"
expect(subject.stdout).to match('I WILL SUCCESSED')
expect(subject.exit_status).to eq(0)
end
Expand Down

0 comments on commit 279651c

Please sign in to comment.