Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied when recreate coverage files using jruby 9.0.3 #25

Open
dsulimchuk opened this issue Nov 10, 2015 · 4 comments
Open

Comments

@dsulimchuk
Copy link

Hello
when first time you run plsql-spec run --coverage - it's OK, when second - there is an error

> plsql-spec run --html --coverage                                                                                                                                                                                  
Running all specs from spec/                                                                                                                                                                                        
Errno::EACCES: Permission denied - coverage/coverage.css                                                                                                                                                            
                    initialize at org/jruby/RubyFile.java:348                                                                                                                                                       
                          open at org/jruby/RubyIO.java:1123                                                                                                                                                        
            block in copy_file at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:1402                                                                                                                           
                          open at org/jruby/RubyIO.java:1125                                                                                                                                                        
                     copy_file at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:1401                                                                                                                           
                     copy_file at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:485                                                                                                                            
                   block in cp at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:402                                                                                                                            
     block in fu_each_src_dest at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:1580                                                                                                                           
             fu_each_src_dest0 at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:1596                                                                                                                           
              fu_each_src_dest at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:1578                                                                                                                           
                            cp at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:401                                                                                                                            
  block in create_static_files at C:/ruby/jruby-9.0.3.0/lib/ruby/gems/shared/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage.rb:178                                                                                   
                          each at org/jruby/RubyArray.java:1560                                                                                                                                                     
           create_static_files at C:/ruby/jruby-9.0.3.0/lib/ruby/gems/shared/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage.rb:177                                                                                   
                        report at C:/ruby/jruby-9.0.3.0/lib/ruby/gems/shared/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage.rb:75                                                                                    
                        report at C:/ruby/jruby-9.0.3.0/lib/ruby/gems/shared/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage.rb:66                                                                                    
               block in (root) at C:/Users/Dmitrii.Sulimchuk/Desktop/_REPO/ccm-ssm-all/ssm-database/test/spec/spec_helper.rb:45                                                                                     
                          each at org/jruby/RubyArray.java:1560                                                                                                                                                     
               block in (root) at C:/Users/Dmitrii.Sulimchuk/Desktop/_REPO/ccm-ssm-all/ssm-database/test/spec/spec_helper.rb:38                                                                                     
D, [2015-11-10T14:16:40.651000 #12928] DEBUG -- get_new_empty_subs: empty_subs =====> 111111158                                                                                                                     
D, [2015-11-10T14:16:40.754000 #12928] DEBUG -- subs_serv_hist_count_records: select count(*) cnt from subscriber_service_histories t where t.subs_id = 111111158 and t.serv_serv_id = 2  =====> {:cnt=>0}          
D, [2015-11-10T14:16:40.789000 #12928] DEBUG -- get_new_empty_subs: empty_subs =====> 111111158                                                                                                                     
D, [2015-11-10T14:16:40.823000 #12928] DEBUG -- subs_serv_hist_count_records: select count(*) cnt from subscriber_service_histories t where t.subs_id = 111111158 and t.serv_serv_id = 2  =====> {:cnt=>0}          
D, [2015-11-10T14:16:40.856000 #12928] DEBUG -- get_new_empty_subs: empty_subs =====> 111111158                                                                                                                     
D, [2015-11-10T14:16:40.891000 #12928] DEBUG -- subs_serv_hist_count_records: select count(*) cnt from subscriber_service_histories t where t.subs_id = 111111158 and t.serv_serv_id = 2  =====> {:cnt=>0}          
D, [2015-11-10T14:16:40.932000 #12928] DEBUG -- get_new_empty_subs: empty_subs =====> 111111158                                                                                                                     
D, [2015-11-10T14:16:40.972000 #12928] DEBUG -- subs_serv_hist_count_records: select count(*) cnt from subscriber_service_histories t where t.subs_id = 111111158 and t.serv_serv_id = 2  =====> {:cnt=>0}          
D, [2015-11-10T14:16:40.982000 #12928] DEBUG -- : #<Thread:0x68746f22>plsql.ssm_services_pkg.serviceActivate 111111158 and 2                                                                                        
D, [2015-11-10T14:16:41.991000 #12928] DEBUG -- : #<Thread:0x1bd25e9>plsql(:second_connection).ssm_services_pkg.serviceActivate 111111158 and 2                                                                     
D, [2015-11-10T14:16:42.035000 #12928] DEBUG -- : delete 111111158 and 2                                                                                                                                            
D, [2015-11-10T14:16:42.099000 #12928] DEBUG -- get_new_empty_subs: empty_subs =====> 111111158                                                                                                                     
D, [2015-11-10T14:16:42.107000 #12928] DEBUG -- subs_serv_hist_count_records: select count(*) cnt from subscriber_service_histories t where t.subs_id = 111111158 and t.serv_serv_id = 0  =====> {:cnt=>0}          
D, [2015-11-10T14:16:42.114000 #12928] DEBUG -- subs_serv_hist_count_records: select count(*) cnt from subscriber_service_histories t where t.subs_id = 111111158 and t.serv_serv_id = 0  =====> {:cnt=>1}          
D, [2015-11-10T14:16:42.123000 #12928] DEBUG -- subs_serv_hist_count_records: select count(*) cnt from subscriber_service_histories t where t.subs_id = 111111158 and t.serv_serv_id = 0  =====> {:cnt=>2}          
D, [2015-11-10T14:16:42.125000 #12928] DEBUG -- subs_serv_hist_count_records: select count(*) cnt from subscriber_service_histories t where t.subs_id = 111111158 and t.serv_serv_id = 0 and t.end_date < t.start_da
te =====> {:cnt=>1}                                                                                                                                                                                                 
Test results in test-results.html                                                                                                                                                                                   
Coverage report in coverage/index.html                                                                                                                                                                              
Failing tests!                                                                                                                                                                                                      
@jgebal
Copy link
Contributor

jgebal commented Nov 12, 2015

What OS version you are running? What is the Java version and JRuby version?
What are the privileges on the project folder "...ssm-database/test" (who has the full rights)?

@dsulimchuk
Copy link
Author

Hello! I'v using Windows7 Enterprise x64

$ jruby -v
jruby 9.0.3.0 (2.2.2) 2015-10-21 633c9aa Java HotSpot(TM) 64-Bit Server VM 25.60-b23 on 1.8.0_60-b27 +jit [Windows 7-amd64]

look at logs using jruby 9.0.3:

dmitrii.sulimchuk@WKS-15092 C:\Users\Dmitrii.Sulimchuk\Desktop\_REPO\ccm-ssm-all\ssm-database\test
> ls -al
total 24
drwx------+ 1 dmitrii.sulimchuk mkpasswd    0 Nov 12 14:16 .
drwx------+ 1 dmitrii.sulimchuk mkpasswd    0 Nov 12 10:38 ..
-rwx------+ 1 dmitrii.sulimchuk mkpasswd  746 Nov 12 10:09 .gitignore
-rwx------+ 1 dmitrii.sulimchuk mkpasswd 1965 Nov 11 12:31 README.md
-rwx------+ 1 dmitrii.sulimchuk mkpasswd  602 Nov 11 10:00 database-test.iml
drwx------+ 1 dmitrii.sulimchuk mkpasswd    0 Nov 11 15:27 spec

dmitrii.sulimchuk@WKS-15092 C:\Users\Dmitrii.Sulimchuk\Desktop\_REPO\ccm-ssm-all\ssm-database\test
> plsql-spec run --coverage
Running all specs from spec/

Finished in 8.26 seconds (files took 2.3 seconds to load)
33 examples, 0 failures

Coverage report in coverage/index.html

dmitrii.sulimchuk@WKS-15092 C:\Users\Dmitrii.Sulimchuk\Desktop\_REPO\ccm-ssm-all\ssm-database\test
> ls -al
total 28
drwx------+ 1 dmitrii.sulimchuk mkpasswd    0 Nov 12 14:17 .
drwx------+ 1 dmitrii.sulimchuk mkpasswd    0 Nov 12 10:38 ..
-rwx------+ 1 dmitrii.sulimchuk mkpasswd  746 Nov 12 10:09 .gitignore
-rwx------+ 1 dmitrii.sulimchuk mkpasswd 1965 Nov 11 12:31 README.md
drwx------+ 1 dmitrii.sulimchuk mkpasswd    0 Nov 12 14:17 coverage
-rwx------+ 1 dmitrii.sulimchuk mkpasswd  602 Nov 11 10:00 database-test.iml
drwx------+ 1 dmitrii.sulimchuk mkpasswd    0 Nov 11 15:27 spec

dmitrii.sulimchuk@WKS-15092 C:\Users\Dmitrii.Sulimchuk\Desktop\_REPO\ccm-ssm-all\ssm-database\test
> plsql-spec run --coverage
Running all specs from spec/
Errno::EACCES: Permission denied - coverage/coverage.css
                    initialize at org/jruby/RubyFile.java:348
                          open at org/jruby/RubyIO.java:1123
            block in copy_file at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:1402
                          open at org/jruby/RubyIO.java:1125
                     copy_file at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:1401
                     copy_file at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:485
                   block in cp at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:402
     block in fu_each_src_dest at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:1580
             fu_each_src_dest0 at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:1596
              fu_each_src_dest at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:1578
                            cp at C:/ruby/jruby-9.0.3.0/lib/ruby/stdlib/fileutils.rb:401
  block in create_static_files at C:/ruby/jruby-9.0.3.0/lib/ruby/gems/shared/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage.rb:178
                          each at org/jruby/RubyArray.java:1560
           create_static_files at C:/ruby/jruby-9.0.3.0/lib/ruby/gems/shared/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage.rb:177
                        report at C:/ruby/jruby-9.0.3.0/lib/ruby/gems/shared/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage.rb:75
                        report at C:/ruby/jruby-9.0.3.0/lib/ruby/gems/shared/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage.rb:66
               block in (root) at C:/Users/Dmitrii.Sulimchuk/Desktop/_REPO/ccm-ssm-all/ssm-database/test/spec/spec_helper.rb:45
                          each at org/jruby/RubyArray.java:1560
               block in (root) at C:/Users/Dmitrii.Sulimchuk/Desktop/_REPO/ccm-ssm-all/ssm-database/test/spec/spec_helper.rb:38

Finished in 7.85 seconds (files took 2.1 seconds to load)
33 examples, 0 failures

Coverage report in coverage/index.html
Failing tests!

@jgebal
Copy link
Contributor

jgebal commented Nov 12, 2015

I did some investigation and was unable to reproduce the issue with JRuby 9.0.3.0 running on Ubuntu 14.10
user@user-VirtualBox:~/RubymineProjects/rspec-oracle-tdd-workshop$ jruby -v
jruby 9.0.3.0 (2.2.2) 2015-10-21 633c9aa OpenJDK 64-Bit Server VM 24.79-b02 on 1.7.0_79-b14 +jit [linux-amd64]

It works fine with standard Ruby 1.9+ and 2+

Google says there are some issues with file operations for JRuby in Java.
The workaround/solution would be to try to remove the directory or at least files before they are populated. Seems like overwrite does not work properly sometimes.
@javornikolov - let me know what you think

@javornikolov
Copy link
Collaborator

@dsulimchuk

What happens if you try to manually copy and overwrite the file:

cp C:/ruby/jruby-9.0.3.0/lib/ruby/gems/shared/gems/ruby-plsql-spec-0.4.0/lib/plsql/coverage/coverage.css coverage/coverage.css

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants