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

Test suite does not run correctly on JRuby #722

Closed
benlangfeld opened this issue Jul 4, 2012 · 5 comments
Closed

Test suite does not run correctly on JRuby #722

benlangfeld opened this issue Jul 4, 2012 · 5 comments

Comments

@benlangfeld
Copy link
Contributor

Every time I report a nokogiri jruby bug, I have to include a test case outside of the nokogiri test suite because I cannot get it to run properly:

{11:51}[jruby-1.6.7.2]~/code/nokogiri@master✗✗✗ ben% be rake test
install -c tmp/java/nokogiri/nokogiri.jar lib/nokogiri/nokogiri.jar
/Users/ben/Developer/.rvm/rubies/jruby-1.6.7.2/bin/jruby -w -I.:lib:bin:test:. -e 'require "rubygems"; require "minitest/autorun"; require "test/test_convert_xpath.rb"; require "test/test_css_cache.rb"; require "test/test_encoding_handler.rb"; require "test/test_memory_leak.rb"; require "test/test_nokogiri.rb"; require "test/test_reader.rb"; require "test/test_soap4r_sax.rb"; require "test/test_xslt_transforms.rb"; require "test/css/test_nthiness.rb"; require "test/css/test_parser.rb"; require "test/css/test_tokenizer.rb"; require "test/css/test_xpath_visitor.rb"; require "test/decorators/test_slop.rb"; require "test/html/test_builder.rb"; require "test/html/test_document.rb"; require "test/html/test_document_encoding.rb"; require "test/html/test_document_fragment.rb"; require "test/html/test_element_description.rb"; require "test/html/test_named_characters.rb"; require "test/html/test_node.rb"; require "test/html/test_node_encoding.rb"; require "test/html/sax/test_parser.rb"; require "test/html/sax/test_parser_context.rb"; require "test/xml/test_attr.rb"; require "test/xml/test_attribute_decl.rb"; require "test/xml/test_builder.rb"; require "test/xml/test_c14n.rb"; require "test/xml/test_cdata.rb"; require "test/xml/test_comment.rb"; require "test/xml/test_document.rb"; require "test/xml/test_document_encoding.rb"; require "test/xml/test_document_fragment.rb"; require "test/xml/test_dtd.rb"; require "test/xml/test_dtd_encoding.rb"; require "test/xml/test_element_content.rb"; require "test/xml/test_element_decl.rb"; require "test/xml/test_entity_decl.rb"; require "test/xml/test_entity_reference.rb"; require "test/xml/test_namespace.rb"; require "test/xml/test_node.rb"; require "test/xml/test_node_attributes.rb"; require "test/xml/test_node_encoding.rb"; require "test/xml/test_node_inheritance.rb"; require "test/xml/test_node_reparenting.rb"; require "test/xml/test_node_set.rb"; require "test/xml/test_parse_options.rb"; require "test/xml/test_processing_instruction.rb"; require "test/xml/test_reader_encoding.rb"; require "test/xml/test_relax_ng.rb"; require "test/xml/test_schema.rb"; require "test/xml/test_syntax_error.rb"; require "test/xml/test_text.rb"; require "test/xml/test_unparented_node.rb"; require "test/xml/test_xinclude.rb"; require "test/xml/test_xpath.rb"; require "test/xml/node/test_save_options.rb"; require "test/xml/node/test_subclass.rb"; require "test/xml/sax/test_parser.rb"; require "test/xml/sax/test_parser_context.rb"; require "test/xml/sax/test_push_parser.rb"; require "test/xslt/test_custom_functions.rb"; require "test/xslt/test_exception_handling.rb"' -- 
/Users/ben/code/nokogiri/lib/nokogiri/css.rb:3 warning: global variable `$-w' not initialized
/Users/ben/code/nokogiri/test/helper.rb:10: version info: {"warnings"=>[], "nokogiri"=>"1.5.5", "ruby"=>{"version"=>"1.9.2", "platform"=>"java", "description"=>"jruby 1.6.7.2 (ruby-1.9.2-p312) (2012-05-01 26e08ba) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_33) [darwin-x86_64-java]", "engine"=>"jruby", "jruby"=>"1.6.7.2"}}
Run options: --seed 15016

# Running tests:

........................................................................................................................................................dyld: lazy symbol binding failed: Symbol not found: _rb_catch
  Referenced from: /Users/ben/code/nokogiri/vendor/jruby/1.9/gems/racc-1.4.8/lib/racc/cparse.bundle
  Expected in: flat namespace

dyld: Symbol not found: _rb_catch
  Referenced from: /Users/ben/code/nokogiri/vendor/jruby/1.9/gems/racc-1.4.8/lib/racc/cparse.bundle
  Expected in: flat namespace

rake aborted!
Command failed with status (133): [/Users/ben/Developer/.rvm/rubies/jruby-1.6...]

Tasks: TOP => test
(See full trace by running task with --trace)
bundle exec rake test  46.20s user 1.89s system 234% cpu 20.518 total

{11:46}[ruby-1.9.3]~/code/nokogiri@master✗✗✗ ben% be rake test
install -c tmp/x86_64-darwin11.4.0/nokogiri/1.9.3/nokogiri.bundle lib/nokogiri/nokogiri.bundle
/Users/ben/Developer/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -w -I.:lib:bin:test:. -e 'require "rubygems"; require "minitest/autorun"; require "test/css/test_nthiness.rb"; require "test/css/test_parser.rb"; require "test/css/test_tokenizer.rb"; require "test/css/test_xpath_visitor.rb"; require "test/decorators/test_slop.rb"; require "test/html/sax/test_parser.rb"; require "test/html/sax/test_parser_context.rb"; require "test/html/test_builder.rb"; require "test/html/test_document.rb"; require "test/html/test_document_encoding.rb"; require "test/html/test_document_fragment.rb"; require "test/html/test_element_description.rb"; require "test/html/test_named_characters.rb"; require "test/html/test_node.rb"; require "test/html/test_node_encoding.rb"; require "test/test_convert_xpath.rb"; require "test/test_css_cache.rb"; require "test/test_encoding_handler.rb"; require "test/test_memory_leak.rb"; require "test/test_nokogiri.rb"; require "test/test_reader.rb"; require "test/test_soap4r_sax.rb"; require "test/test_xslt_transforms.rb"; require "test/xml/node/test_save_options.rb"; require "test/xml/node/test_subclass.rb"; require "test/xml/sax/test_parser.rb"; require "test/xml/sax/test_parser_context.rb"; require "test/xml/sax/test_push_parser.rb"; require "test/xml/test_attr.rb"; require "test/xml/test_attribute_decl.rb"; require "test/xml/test_builder.rb"; require "test/xml/test_c14n.rb"; require "test/xml/test_cdata.rb"; require "test/xml/test_comment.rb"; require "test/xml/test_document.rb"; require "test/xml/test_document_encoding.rb"; require "test/xml/test_document_fragment.rb"; require "test/xml/test_dtd.rb"; require "test/xml/test_dtd_encoding.rb"; require "test/xml/test_element_content.rb"; require "test/xml/test_element_decl.rb"; require "test/xml/test_entity_decl.rb"; require "test/xml/test_entity_reference.rb"; require "test/xml/test_namespace.rb"; require "test/xml/test_node.rb"; require "test/xml/test_node_attributes.rb"; require "test/xml/test_node_encoding.rb"; require "test/xml/test_node_inheritance.rb"; require "test/xml/test_node_reparenting.rb"; require "test/xml/test_node_set.rb"; require "test/xml/test_parse_options.rb"; require "test/xml/test_processing_instruction.rb"; require "test/xml/test_reader_encoding.rb"; require "test/xml/test_relax_ng.rb"; require "test/xml/test_schema.rb"; require "test/xml/test_syntax_error.rb"; require "test/xml/test_text.rb"; require "test/xml/test_unparented_node.rb"; require "test/xml/test_xinclude.rb"; require "test/xml/test_xpath.rb"; require "test/xslt/test_custom_functions.rb"; require "test/xslt/test_exception_handling.rb"' -- 
/Users/ben/code/nokogiri/test/helper.rb:10: version info: {"warnings"=>[], "nokogiri"=>"1.5.5", "ruby"=>{"version"=>"1.9.3", "platform"=>"x86_64-darwin11.4.0", "description"=>"ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]", "engine"=>"ruby"}, "libxml"=>{"binding"=>"extension", "compiled"=>"2.7.3", "loaded"=>"2.7.3"}}
Run options: --seed 36060

# Running tests:

.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................F...F.........................................................................................................S..................................................................................

Finished tests in 11.303693s, 105.6292 tests/s, 290.3476 assertions/s.

  1) Failure:
test_reader_entity_reference_without_dtdload(Nokogiri::XML::TestReaderEntityReference) [/Users/ben/code/nokogiri/test/xml/test_entity_reference.rb:225]:
Nokogiri::XML::SyntaxError expected but nothing was raised.

  2) Failure:
test_reader_entity_reference_without_dtdload_with_absolute_path(Nokogiri::XML::TestReaderEntityReference) [/Users/ben/code/nokogiri/test/xml/test_entity_reference.rb:225]:
Nokogiri::XML::SyntaxError expected but nothing was raised.

1194 tests, 3282 assertions, 2 failures, 0 errors, 1 skips
rake aborted!
Command failed with status (1): [/Users/ben/Developer/.rvm/rubies/ruby-1.9....]

Tasks: TOP => test
(See full trace by running task with --trace)
bundle exec rake test  11.94s user 0.32s system 93% cpu 13.051 total

When the bugs I report are fixed, no test coverage is actually added to nokogiri, so regressions are fairly likely. If I could get the test suite running, my bug reports could be failing tests as pull requests instead.

Does anyone have any idea how to get these tests running on JRuby?

@jvshahid
Copy link
Member

jvshahid commented Jul 4, 2012

please run 'jruby -S rake test' instead of 'rake test'. Let me know if you have any other issue running the test suite and I'll be happy to assist you.

@benlangfeld
Copy link
Contributor Author

Unfortunately that doesn't help:

{12:00}[jruby-1.6.7.2]~/code/nokogiri@master✗✗✗ ben% be jruby -S rake test
install -c tmp/java/nokogiri/nokogiri.jar lib/nokogiri/nokogiri.jar
/Users/ben/Developer/.rvm/rubies/jruby-1.6.7.2/bin/jruby -w -I.:lib:bin:test:. -e 'require "rubygems"; require "minitest/autorun"; require "test/test_convert_xpath.rb"; require "test/test_css_cache.rb"; require "test/test_encoding_handler.rb"; require "test/test_memory_leak.rb"; require "test/test_nokogiri.rb"; require "test/test_reader.rb"; require "test/test_soap4r_sax.rb"; require "test/test_xslt_transforms.rb"; require "test/css/test_nthiness.rb"; require "test/css/test_parser.rb"; require "test/css/test_tokenizer.rb"; require "test/css/test_xpath_visitor.rb"; require "test/decorators/test_slop.rb"; require "test/html/test_builder.rb"; require "test/html/test_document.rb"; require "test/html/test_document_encoding.rb"; require "test/html/test_document_fragment.rb"; require "test/html/test_element_description.rb"; require "test/html/test_named_characters.rb"; require "test/html/test_node.rb"; require "test/html/test_node_encoding.rb"; require "test/html/sax/test_parser.rb"; require "test/html/sax/test_parser_context.rb"; require "test/xml/test_attr.rb"; require "test/xml/test_attribute_decl.rb"; require "test/xml/test_builder.rb"; require "test/xml/test_c14n.rb"; require "test/xml/test_cdata.rb"; require "test/xml/test_comment.rb"; require "test/xml/test_document.rb"; require "test/xml/test_document_encoding.rb"; require "test/xml/test_document_fragment.rb"; require "test/xml/test_dtd.rb"; require "test/xml/test_dtd_encoding.rb"; require "test/xml/test_element_content.rb"; require "test/xml/test_element_decl.rb"; require "test/xml/test_entity_decl.rb"; require "test/xml/test_entity_reference.rb"; require "test/xml/test_namespace.rb"; require "test/xml/test_node.rb"; require "test/xml/test_node_attributes.rb"; require "test/xml/test_node_encoding.rb"; require "test/xml/test_node_inheritance.rb"; require "test/xml/test_node_reparenting.rb"; require "test/xml/test_node_set.rb"; require "test/xml/test_parse_options.rb"; require "test/xml/test_processing_instruction.rb"; require "test/xml/test_reader_encoding.rb"; require "test/xml/test_relax_ng.rb"; require "test/xml/test_schema.rb"; require "test/xml/test_syntax_error.rb"; require "test/xml/test_text.rb"; require "test/xml/test_unparented_node.rb"; require "test/xml/test_xinclude.rb"; require "test/xml/test_xpath.rb"; require "test/xml/node/test_save_options.rb"; require "test/xml/node/test_subclass.rb"; require "test/xml/sax/test_parser.rb"; require "test/xml/sax/test_parser_context.rb"; require "test/xml/sax/test_push_parser.rb"; require "test/xslt/test_custom_functions.rb"; require "test/xslt/test_exception_handling.rb"' -- 
/Users/ben/code/nokogiri/lib/nokogiri/css.rb:3 warning: global variable `$-w' not initialized
/Users/ben/code/nokogiri/test/helper.rb:10: version info: {"warnings"=>[], "nokogiri"=>"1.5.5", "ruby"=>{"version"=>"1.9.2", "platform"=>"java", "description"=>"jruby 1.6.7.2 (ruby-1.9.2-p312) (2012-05-01 26e08ba) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_33) [darwin-x86_64-java]", "engine"=>"jruby", "jruby"=>"1.6.7.2"}}
Run options: --seed 59217

# Running tests:

........................................................................................................................................................dyld: lazy symbol binding failed: Symbol not found: _rb_catch
  Referenced from: /Users/ben/code/nokogiri/vendor/jruby/1.9/gems/racc-1.4.8/lib/racc/cparse.bundle
  Expected in: flat namespace

dyld: Symbol not found: _rb_catch
  Referenced from: /Users/ben/code/nokogiri/vendor/jruby/1.9/gems/racc-1.4.8/lib/racc/cparse.bundle
  Expected in: flat namespace

rake aborted!
Command failed with status (133): [/Users/ben/Developer/.rvm/rubies/jruby-1.6...]

Tasks: TOP => test
(See full trace by running task with --trace)
bundle exec jruby -S rake test  39.28s user 1.47s system 233% cpu 17.473 total

@jvshahid
Copy link
Member

jvshahid commented Jul 4, 2012

it should work without 'bundle exec'

@benlangfeld
Copy link
Contributor Author

Enabling shared gems in .bundle/config it does indeed now work. Am I to expect 4 failures, 3 errors, 11 skips?

@jvshahid
Copy link
Member

jvshahid commented Jul 4, 2012

currently we have some failures and errors regarding encoding when the test suite runs in 1.9 mode, some of which are fixed on a branch but not merged to master yet. if you run jruby in 1.8 mode you shouldn't see any failures/errors.

i'm closing the ticket, since it's not a bug. please post any further questions regarding building/testing on the mailing list since you'll have a better chance of getting your question answered.

Thanks again for your efforts.

@jvshahid jvshahid closed this as completed Jul 4, 2012
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

2 participants