jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/380502 )
Change subject: dib: add some spec test ...................................................................... dib: add some spec test Attempts to compile the puppet catalog of the CI image. Clone operations/puppet in the Jenkins job. Assume that operations/puppet.git is available. Pass SPEC_OPTS="--tty" to enforce rspec coloring under Jenkins. Update integration-config-dib-jessie Change-Id: I7ae0d53844e333f4c1e05619d80ddcce1076bc57 --- M Gemfile M Rakefile A dib/puppet/.rspec A dib/puppet/Rakefile A dib/puppet/spec/.gitignore A dib/puppet/spec/hosts/ci_jessie_wikimedia_spec.rb M jjb/integration.yaml 7 files changed, 57 insertions(+), 5 deletions(-) Approvals: Hashar: Looks good to me, approved jenkins-bot: Verified diff --git a/Gemfile b/Gemfile index 73c2108..6f98938 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '~> 3.8.5', require: false gem 'puppet-lint', '2.0.2' gem 'puppetlabs_spec_helper', '< 2.0.0', require: false +gem 'rspec-puppet', '~> 2.6.0' # Puppet 3.7 fails on ruby 2.2+ # https://tickets.puppetlabs.com/browse/PUP-3796 diff --git a/Rakefile b/Rakefile index e091966..d500198 100644 --- a/Rakefile +++ b/Rakefile @@ -8,8 +8,15 @@ config.log_format = '%{path}:%{line} %{KIND} %{message} (%{check})' end +desc 'Run spec for dib/puppet' +task :dib_spec do + Dir.chdir 'dib/puppet' do + fail unless system('rake spec') + end +end + desc 'Run all build/tests commands (CI entry point)' -task test: [:syntax, :lint] +task test: [:syntax, :lint, :dib_spec] desc 'Show the help' task :help do diff --git a/dib/puppet/.rspec b/dib/puppet/.rspec new file mode 100644 index 0000000..9d52c56 --- /dev/null +++ b/dib/puppet/.rspec @@ -0,0 +1,2 @@ +--color +--format doc diff --git a/dib/puppet/Rakefile b/dib/puppet/Rakefile new file mode 100644 index 0000000..cd3d379 --- /dev/null +++ b/dib/puppet/Rakefile @@ -0,0 +1 @@ +require 'puppetlabs_spec_helper/rake_tasks' diff --git a/dib/puppet/spec/.gitignore b/dib/puppet/spec/.gitignore new file mode 100644 index 0000000..76163ab --- /dev/null +++ b/dib/puppet/spec/.gitignore @@ -0,0 +1 @@ +/fixtures diff --git a/dib/puppet/spec/hosts/ci_jessie_wikimedia_spec.rb b/dib/puppet/spec/hosts/ci_jessie_wikimedia_spec.rb new file mode 100644 index 0000000..6cb5a2d --- /dev/null +++ b/dib/puppet/spec/hosts/ci_jessie_wikimedia_spec.rb @@ -0,0 +1,23 @@ +require 'rspec-puppet' +require 'puppetlabs_spec_helper/puppet_spec_helper' + +RSpec.configure do |c| + c.manifest = File.expand_path(File.join(__dir__, '..', '..', 'ciimage.pp')) + if ENV['PUPPET_DIR'] + c.module_path = File.expand_path( + File.join( ENV['PUPPET_DIR'], 'modules')) + else + c.module_path = File.expand_path( + File.join( + __dir__, '../../../../../../operations/puppet/modules')) + end +end + +describe 'ci-jessie-wikimedia' do + let(:facts) { { + :initsystem => 'systemd', + :lsbdistrelease => 'Jessie', + :lsbdistid => 'Debian', + } } + it { should compile } +end diff --git a/jjb/integration.yaml b/jjb/integration.yaml index 17a4e32..ac9abd9 100644 --- a/jjb/integration.yaml +++ b/jjb/integration.yaml @@ -192,10 +192,27 @@ - zuul builders: - castor-load - - run-tox: - venv: dib - - bundle-nodepool: - command: rake test + - shell: | + zuul-cloner --color \ + --cache-dir /srv/git \ + https://gerrit.wikimedia.org/r/p \ + integration/config + - shell: | + mkdir -p log + set -o pipefail + cd integration/config + TOX_TESTENV_PASSENV=PY_COLORS PY_COLORS=1 tox -v -e dib | tee "$WORKSPACE/log/tox-dib.log" + # rspec tests require operations/puppet.git + - shell: | + zuul-cloner --color \ + --cache-dir /srv/git \ + --branch production \ + https://gerrit.wikimedia.org/r/p \ + operations/puppet + - shell: | + cd integration/config + bundle install --clean + PUPPET_DIR="$WORKSPACE"/operations/puppet SPEC_OPTS="--tty" bundle exec rake test publishers: - archive-log-dir - archive-tox-logs -- To view, visit https://gerrit.wikimedia.org/r/380502 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7ae0d53844e333f4c1e05619d80ddcce1076bc57 Gerrit-PatchSet: 11 Gerrit-Project: integration/config Gerrit-Branch: master Gerrit-Owner: Hashar <[email protected]> Gerrit-Reviewer: Hashar <[email protected]> Gerrit-Reviewer: Paladox <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
