summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorIonuț Arțăriși <iartarisi@suse.cz>2014-09-30 14:45:34 +0200
committerIonuț Arțăriși <iartarisi@suse.cz>2014-09-30 14:45:50 +0200
commit17eff9523c9e922ca9118956ec6441d07c6b2988 (patch)
treee940444c6645ab1510d2a648469929dad8280142 /Rakefile
parent43553e0e176d2e6e7ce6180d8b726c3dacd86bf0 (diff)
add a Rakefile to structure test runs
Having a Rakefile will allow us to change the actual test commands on our side rather than relying on changes to the openstack-infra repository. This should make it a lot faster to change things, but also easier to test since the jenkins jobs are actually run in this repository, not the openstack-infra one. This commit defines the jobs we previously had defined in Jenkins and uses 'high-level' naming consistently (i.e. lint, style vs. foodcritic, rubocop). There is also a :clean task to help with deleting the files generated by the other jobs. Also changed foodcritic to run on the source cookbook rather than the one installed by berks, see e.g. https://github.com/berkshelf/berkshelf/issues/931#issuecomment-29668369 Change-Id: If366dff9394f416b0704bea89ae50c1c472606bf blueprint: rakefile
Notes
Notes (review): Verified+2: Jenkins Code-Review+2: Justin Shepherd <jshepher@rackspace.com> Workflow+1: Justin Shepherd <jshepher@rackspace.com> Code-Review+2: Mark Vanderwiel <vanderwl@us.ibm.com> Submitted-by: Jenkins Submitted-at: Tue, 07 Oct 2014 15:24:36 +0000 Reviewed-on: https://review.openstack.org/125028 Project: stackforge/cookbook-openstack-block-storage Branch: refs/heads/master
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile33
1 files changed, 33 insertions, 0 deletions
diff --git a/Rakefile b/Rakefile
new file mode 100644
index 0000000..e9952df
--- /dev/null
+++ b/Rakefile
@@ -0,0 +1,33 @@
1task default: ["test"]
2
3task :test => [:lint, :style, :unit]
4
5task :bundler_prep do
6 mkdir_p '.bundle'
7 sh %{bundle install --path=.bundle --jobs 1 --retry 3 --verbose}
8end
9
10task :berks_prep => :bundler_prep do
11 sh %{bundle exec berks vendor}
12end
13
14task :lint => :bundler_prep do
15 sh %{bundle exec foodcritic --epic-fail any --tags ~FC003 --tags ~FC023 .}
16end
17
18task :style => :bundler_prep do
19 sh %{bundle exec rubocop}
20end
21
22task :unit => :berks_prep do
23 sh %{bundle exec rspec --format documentation}
24end
25
26task :clean do
27 rm_rf [
28 '.bundle',
29 'berks-cookbooks',
30 'Gemfile.lock',
31 'Berksfile.lock'
32 ]
33end