Hashar has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/337858 )

Change subject: Use puppet-syntax gem for syntax checking
......................................................................

Use puppet-syntax gem for syntax checking

The puppet-syntax gem lets one validate puppet manifests, erb temlates
and hiera yaml file.  That lets one easily validate locally before
sending a patch for review and would let us remove the Wikimedia Jenkins
job erblint-HEAD and pplint-HEAD.

Add the gem puppetlabs_spec_helper which provides rake tasks wrapping
around puppet-syntax. Flag it with require: false, there is no need to
have bundler to always require it, it is sufficient to just require it
in the Rakefile.

The puppetlabs_spec_helper provides:

    rake syntax             # Syntax check Puppet manifests and templates
    rake syntax:hiera       # Syntax check Hiera config files
    rake syntax:manifests   # Syntax check Puppet manifests
    rake syntax:templates   # Syntax check Puppet templates

Make the 'syntax' task a prerequisites of the 'test' task in order to
have CI to run it for us.

Note: the submodules are validated, though they each have their own
validation as well and overall it is probably a good idea to make sure
they have proper puppet manifests.

Bug: T154894
Change-Id: I29de3b2b49db245a46b1acdc862701f6b872a54d
---
M Gemfile
M Gemfile.lock
M Rakefile
3 files changed, 17 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vagrant 
refs/changes/58/337858/1

diff --git a/Gemfile b/Gemfile
index c9b59fd..5d2bc32 100644
--- a/Gemfile
+++ b/Gemfile
@@ -8,6 +8,7 @@
   gem 'rubocop', '~> 0.35.1', require: false
   gem 'puppet-lint', '1.1.0'
   gem 'puppet', '~> 3.7.0'
+  gem 'puppetlabs_spec_helper', '< 2.0.0', require: false
   gem 'puppet-strings', '~> 1.0.0'
   # Puppet 3.7 fails on ruby 2.2+
   # https://tickets.puppetlabs.com/browse/PUP-3796
diff --git a/Gemfile.lock b/Gemfile.lock
index 95a9b5f..013d460 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -77,9 +77,12 @@
     logging (1.8.2)
       little-plugger (>= 1.1.3)
       multi_json (>= 1.8.4)
+    metaclass (0.0.4)
     method_source (0.8.2)
     mime-types (2.99.2)
     mini_portile (0.6.0)
+    mocha (1.2.1)
+      metaclass (~> 0.0.1)
     multi_json (1.12.1)
     multi_test (0.1.2)
     net-scp (1.1.2)
@@ -108,6 +111,14 @@
     puppet-lint (1.1.0)
     puppet-strings (1.0.0)
       yard (~> 0.9.5)
+    puppet-syntax (2.3.0)
+      rake
+    puppetlabs_spec_helper (1.1.1)
+      mocha
+      puppet-lint
+      puppet-syntax
+      rake
+      rspec-puppet
     rainbow (2.1.0)
     rake (10.4.2)
     rb-fsevent (0.9.7)
@@ -131,6 +142,8 @@
     rspec-mocks (3.5.0)
       diff-lcs (>= 1.2.0, < 2.0)
       rspec-support (~> 3.5.0)
+    rspec-puppet (2.5.0)
+      rspec
     rspec-support (3.5.0)
     rubocop (0.35.1)
       astrolabe (~> 1.3)
@@ -177,6 +190,7 @@
   puppet (~> 3.7.0)
   puppet-lint (= 1.1.0)
   puppet-strings (~> 1.0.0)
+  puppetlabs_spec_helper (< 2.0.0)
   rake (~> 10.4.2)
   rspec (~> 3.1, >= 3.1.0)
   rubocop (~> 0.35.1)
diff --git a/Rakefile b/Rakefile
index fea4ce9..2bec87d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -11,6 +11,7 @@
 require 'cucumber'
 require 'cucumber/rake/task'
 require 'puppet-lint/tasks/puppet-lint'
+require 'puppet-syntax/tasks/puppet-syntax'
 require 'puppet-strings/tasks/generate'
 require 'rspec/core/rake_task'
 require 'rubocop/rake_task'
@@ -34,7 +35,7 @@
 task default: [:test]
 
 desc 'Run all build/tests commands (CI entry point)'
-task test: [:spec, :rubocop, :cucumber, :lint, :doc]
+task test: [:syntax, :spec, :rubocop, :cucumber, :lint, :doc]
 
 desc 'Generate all documentations'
 task :doc do

-- 
To view, visit https://gerrit.wikimedia.org/r/337858
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29de3b2b49db245a46b1acdc862701f6b872a54d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vagrant
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to