File tree Expand file tree Collapse file tree 3 files changed +26
-1
lines changed
cookbooks/aws-parallelcluster-shared/spec Expand file tree Collapse file tree 3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,6 @@ Procfile
7070#############
7171Berksfile
7272Berksfile.lock
73- cookbooks/*
7473tmp
7574
7675# Cookbooks #
Original file line number Diff line number Diff line change 44include Chef ::Mixin ::ShellOut
55
66RSpec . configure do |c |
7+ c . before ( :suite ) do
8+ # Copy third-party cookbooks to cookbooks directory for ChefSpec tests
9+ require 'fileutils'
10+ third_party_path = File . expand_path ( '../../third-party' , __dir__ )
11+ cookbooks_path = File . expand_path ( '../..' , __dir__ )
12+ if Dir . exist? ( third_party_path )
13+ Dir . glob ( File . join ( third_party_path , '*' ) ) . each do |cookbook |
14+ next unless File . directory? ( cookbook )
15+ FileUtils . cp_r ( cookbook , cookbooks_path )
16+ end
17+ end
18+ end
19+
720 c . before ( :each ) do
821 allow ( File ) . to receive ( :exist? ) . and_call_original
922 allow ( Dir ) . to receive ( :exist? ) . and_call_original
Original file line number Diff line number Diff line change @@ -9,13 +9,26 @@ provisioner:
99 environments_path : test/environments
1010 client_rb :
1111 environment : kitchen
12+ cookbook_path :
13+ - /opt/kitchen/cookbooks
14+ - /opt/kitchen/cookbooks/third-party
1215 attributes :
1316 kitchen : true
1417 cluster :
1518 # right now tests depend on this parameter: we will try to remove the dependency later
1619 region : us-east-1
1720
1821lifecycle :
22+ pre_create :
23+ - remote : |
24+ for cookbook in /opt/kitchen/cookbooks/third-party/*; do
25+ if [ -d "$cookbook" ]; then
26+ cookbook_name=$(basename "$cookbook")
27+ if [ ! -e "/opt/kitchen/cookbooks/$cookbook_name" ]; then
28+ cp -r "$cookbook" "/opt/kitchen/cookbooks/"
29+ fi
30+ fi
31+ done
1932 <% %w(pre post).each do |prefix| % >
2033 <% %w(create converge verify destroy).each do |phase| % >
2134 <% op = "# {prefix}_#{phase}" % >
You can’t perform that action at this time.
0 commit comments