Skip to content

Commit

Permalink
[test] try to only skip (pend) spec on CloudBees
Browse files Browse the repository at this point in the history
... spec is actually useful guarding against a regression
~ reverts commit 1fe9e68
see GH-2655
  • Loading branch information
kares committed Jun 11, 2018
1 parent 193d604 commit 3950c09
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions spec/java_integration/utilities/jar_glob_spec.rb
Expand Up @@ -17,7 +17,7 @@ def jar_entries(full_entries)
before :all do
FileUtils.rm "glob_test/glob-test.jar", :force => true
begin
FileUtils.rm_rf "glob_test"
FileUtils.rm_rf 'glob_test'
rescue Errno::ENOENT; end

FileUtils.mkdir_p 'glob_target'
Expand All @@ -32,11 +32,12 @@ def jar_entries(full_entries)
FileUtils.rmdir 'glob_target'
FileUtils.rm "glob-test.jar", :force => true
begin
FileUtils.rm "glob_test/glob-test.jar"
FileUtils.rmdir 'glob_test'
FileUtils.rm "glob_test/glob-test.jar"
FileUtils.rm_f "glob_test/modified-glob-test.jar"
rescue Errno::EACCES => e
puts "Couldn't delete glob_test/glob-test.jar - Windows bug with JarFile holding write-lock after closed"
warn "Couldn't delete glob_test/glob-test.jar - Windows bug with JarFile holding write-lock after closed"
end
FileUtils.rmdir 'glob_test'
end

it "finds the contents inside a jar with Dir.[] in a dir inside the jar" do
Expand Down Expand Up @@ -94,8 +95,8 @@ def jar_entries(full_entries)
end
end

=begin For some reason, mtime does not update on Jenkins on Cloudbees
it "respects jar content filesystem changes" do
pending('Failing@CloudBees') if ENV['JENKINS_HOME'] && ENV['CI']
jar_path = File.join(Dir.pwd, 'glob_test', 'modified-glob-test.jar')
FileUtils.cp 'glob-test.jar', jar_path

Expand All @@ -118,7 +119,6 @@ def jar_entries(full_entries)

expect(after - before).to eq(-2)
end
=end
end

describe 'Dir globs (Dir.glob and Dir.[]) +' do
Expand All @@ -139,9 +139,7 @@ def jar_entries(full_entries)
before do
Dir.mkdir 'spaces test' unless File.exist? 'spaces test'
File.open('spaces_file.rb', 'w') do |file|
file << <<-CODE
$foo_dir = File.expand_path(File.dirname(__FILE__))
CODE
file << "$foo_dir = File.expand_path(File.dirname(__FILE__))\n"
end
`jar -cf test.jar spaces_file.rb`

Expand Down

0 comments on commit 3950c09

Please sign in to comment.