(fixtures): Fix cloud module reference (need to be a symlink)
In order to run rspec tests on the current branch/patchset, cloud module (in fixtures directory) need to be a symlink on the working directory, otherwise the rspec test use master branch of cloud module. Refs: #724
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -5,3 +5,5 @@ Gemfile.lock
 | 
			
		||||
.vendor
 | 
			
		||||
doc/
 | 
			
		||||
.yardoc
 | 
			
		||||
.librarian/
 | 
			
		||||
.tmp/
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										22
									
								
								Rakefile
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								Rakefile
									
									
									
									
									
								
							@@ -58,19 +58,23 @@ namespace :module do
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Rake::Task[:spec_prep].clear
 | 
			
		||||
desc "Create the fixtures directory"
 | 
			
		||||
desc 'Create the fixtures directory'
 | 
			
		||||
task :spec_prep do
 | 
			
		||||
  FileUtils::mkdir_p("spec/fixtures/modules")
 | 
			
		||||
  FileUtils::mkdir_p("spec/fixtures/manifests")
 | 
			
		||||
  FileUtils::touch("spec/fixtures/manifests/site.pp")
 | 
			
		||||
  sh "librarian-puppet install --path=spec/fixtures/modules"
 | 
			
		||||
  FileUtils::mkdir_p('spec/fixtures/modules')
 | 
			
		||||
  FileUtils::mkdir_p('spec/fixtures/manifests')
 | 
			
		||||
  FileUtils::touch('spec/fixtures/manifests/site.pp')
 | 
			
		||||
  sh 'librarian-puppet install --path=spec/fixtures/modules'
 | 
			
		||||
  if File.exists?('spec/fixtures/modules/cloud')
 | 
			
		||||
    FileUtils::rm_rf('spec/fixtures/modules/cloud')
 | 
			
		||||
    FileUtils::ln_s(TDIR, 'spec/fixtures/modules/cloud')
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
Rake::Task[:spec_clean].clear
 | 
			
		||||
desc "Clean up the fixtures directory"
 | 
			
		||||
desc 'Clean up the fixtures directory'
 | 
			
		||||
task :spec_clean do
 | 
			
		||||
  sh "librarian-puppet clean --path=spec/fixtures/modules"
 | 
			
		||||
  if File.zero?("spec/fixtures/manifests/site.pp")
 | 
			
		||||
    FileUtils::rm_f("spec/fixtures/manifests/site.pp")
 | 
			
		||||
  sh 'librarian-puppet clean --path=spec/fixtures/modules'
 | 
			
		||||
  if File.zero?('spec/fixtures/manifests/site.pp')
 | 
			
		||||
    FileUtils::rm_f('spec/fixtures/manifests/site.pp')
 | 
			
		||||
  end
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user