diff --git a/.travis.yml b/.travis.yml index 8570889..8252502 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,22 +1,28 @@ --- -notifications: - webhooks: https://galaxy.ansible.com/api/v1/notifications/ -language: python -python: "2.7" +sudo: required +language: ruby +cache: bundler +dist: trusty -env: - - ANSIBLE_VERSION=latest - - ANSIBLE_VERSION=1.9.4 +services: + - docker before_install: - - sudo apt-get update -qq - - sudo apt-get install -qq python-apt python-pycurl -install: - - if [ "$ANSIBLE_VERSION" = "latest" ]; then pip install ansible; else pip install ansible==$ANSIBLE_VERSION; fi - - echo -e 'localhost ansible_connection=local' > spec/inventory - - echo -e '[defaults]\nroles_path = ../\nhostfile = ./spec/inventory' > ansible.cfg + - gem --version + - bundle version -script: - - ansible-playbook --syntax-check spec/travis.yml - - ansible-playbook --sudo -v --diff spec/travis.yml - - ansible-playbook --sudo -v --diff spec/travis.yml --extra-vars "network_ipv6_enable=true ssh_allow_root_with_key=true ssh_client_password_login=true ssh_client_cbc_required=true ssh_server_weak_hmac=true ssh_client_weak_kex=true sftp_enabled=true" +matrix: + include: + # verify lint and unit + - rvm: 2.3.1 + gemfile: Gemfile + bundler_args: "--without integration guard tools" + # integration tests + - rvm: 2.3.1 + bundler_args: "--without guard tools" + script: bundle exec rake test:integration OS='centos oracle' + gemfile: Gemfile + - rvm: 2.3.1 + bundler_args: "--without guard tools" + script: bundle exec rake test:integration OS='ubuntu debian' +gemfile: Gemfil diff --git a/Rakefile b/Rakefile index 02c5821..c3f5ceb 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,9 @@ #!/usr/bin/env rake # encoding: utf-8 +require 'foodcritic' +require 'rspec/core/rake_task' + # Automatically generate a changelog for this project. Only loaded if # the necessary gem is installed. begin @@ -9,3 +12,10 @@ begin rescue LoadError puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks' end + +desc 'Run integration tests' +task :integration do + concurrency = ENV['CONCURRENCY'] || 1 + os = ENV['OS'] || '' + sh('sh', '-c', "bundle exec kitchen test -c #{concurrency} #{os}") +end