jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/401545 )
Change subject: Compile the base puppet catalog on CI
......................................................................
Compile the base puppet catalog on CI
Add rspec-puppet tasks at the root of the repository so one can easily
compile the catalogues.
First for a dummy host that has no role applied, and if successful for
each roles. That is done serially which is quite slow.
Add the fast :compile_host task to the default commands being run by CI.
It is fast enough.
Bug: T183570
X-Notable-Event: Happy-New-Gregorian-Year
Depends-On: Iedfd61c022f39d32f6d803a39579bb5d121537ed
Change-Id: I4ca7a2b80d7b0ffb8b3fcef40c498b8c5dfc1ba0
---
M Rakefile
M puppet/spec/spec_helper.rb
2 files changed, 16 insertions(+), 1 deletion(-)
Approvals:
BryanDavis: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Rakefile b/Rakefile
index fcb34f7..6bb1eff 100644
--- a/Rakefile
+++ b/Rakefile
@@ -39,12 +39,25 @@
RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = '-I tests/spec --default-path tests'
end
+
+desc 'Compile default host Puppet catalog'
+RSpec::Core::RakeTask.new(:compile_host) do |t|
+ t.rspec_opts = '--format doc -I puppet/spec --default-path puppet --pattern
spec/hosts/\*_spec.rb'
+end
+desc 'Compile Puppet roles'
+RSpec::Core::RakeTask.new(:compile_roles) do |t|
+ t.rspec_opts = '-I puppet/spec --default-path puppet --exclude-pattern
spec/hosts/\*_spec.rb'
+end
+# Compile host first since it is fairly fast
+desc 'Compile puppet catalogs'
+task compile: [:compile_host, :compile_roles]
+
RuboCop::RakeTask.new(:rubocop)
task default: [:test]
desc 'Run all build/tests commands (CI entry point)'
-task test: [:clean, :syntax, :spec, :rubocop, :cucumber, :lint, :doc]
+task test: [:clean, :syntax, :spec, :rubocop, :cucumber, :lint, :doc,
:compile_host]
desc 'Generate all documentations'
task :doc do
diff --git a/puppet/spec/spec_helper.rb b/puppet/spec/spec_helper.rb
index ee86e07..a6e487d 100644
--- a/puppet/spec/spec_helper.rb
+++ b/puppet/spec/spec_helper.rb
@@ -1,4 +1,5 @@
require 'rspec-puppet'
+require 'fileutils'
def puppet_path
File.expand_path(File.join(__FILE__, '../..'))
@@ -14,6 +15,7 @@
conf = File.read(File.join(puppet_path, 'hiera.yaml'))
conf.gsub!(%r{/vagrant/puppet}, puppet_path)
+ FileUtils.mkdir_p(fixture_path)
fixture = File.join(fixture_path, 'hiera.yaml')
File.write(fixture, conf)
--
To view, visit https://gerrit.wikimedia.org/r/401545
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I4ca7a2b80d7b0ffb8b3fcef40c498b8c5dfc1ba0
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: stretch-migration
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: BryanDavis <[email protected]>
Gerrit-Reviewer: Dduvall <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits