rubys / nokogumbo

A Nokogiri interface to the Gumbo HTML5 parser.
Apache License 2.0
186 stars 114 forks source link

test failures with latest nokogiri #186

Closed Apteryks closed 1 year ago

Apteryks commented 1 year ago

Hi,

When using the latest available nokogiri, the test suite fails like:

mkdir -p tmp/x86_64-linux/stage/lib/nokogumbo
install -c tmp/x86_64-linux/nokogumbo/2.7.4/nokogumbo.so lib/nokogumbo/nokogumbo.so
cp tmp/x86_64-linux/nokogumbo/2.7.4/nokogumbo.so tmp/x86_64-linux/stage/lib/nokogumbo/nokogumbo.so
NOTE: nokogumbo: Using Nokogiri::HTML5 provided by Nokogiri. See https://github.com/sparklemotion/nokogiri/issues/2205 for more information.
Run options: --seed 45408

# Running:

........................................................................................................................................................................................................................................................................................................................................................................................ES....E................S....S............E.....................E...............S..S......S.E.S..............S.............................S.......S......................................

Finished in 1.814782s, 309.1280 runs/s, 455.7021 assertions/s.

  1) Error:
TestNokogumbo#test_line_comment:
NameError: uninitialized constant Nokogiri::Gumbo::LINE_SUPPORTED
    /tmp/guix-build-ruby-nokogumbo-2.0.5.drv-0/source/test/test_nokogumbo.rb:304:in `const_get'
    /tmp/guix-build-ruby-nokogumbo-2.0.5.drv-0/source/test/test_nokogumbo.rb:304:in `test_line_comment'

  2) Error:
TestNokogumbo#test_line_text:
NameError: uninitialized constant Nokogiri::Gumbo::LINE_SUPPORTED
    /tmp/guix-build-ruby-nokogumbo-2.0.5.drv-0/source/test/test_nokogumbo.rb:298:in `const_get'
    /tmp/guix-build-ruby-nokogumbo-2.0.5.drv-0/source/test/test_nokogumbo.rb:298:in `test_line_text'

  3) Error:
TestNokogumbo#test_line_cdata:
NameError: uninitialized constant Nokogiri::Gumbo::LINE_SUPPORTED
    /tmp/guix-build-ruby-nokogumbo-2.0.5.drv-0/source/test/test_nokogumbo.rb:322:in `const_get'
    /tmp/guix-build-ruby-nokogumbo-2.0.5.drv-0/source/test/test_nokogumbo.rb:322:in `test_line_cdata'

  4) Error:
TestNokogumbo#test_line_element:
NameError: uninitialized constant Nokogiri::Gumbo::LINE_SUPPORTED
    /tmp/guix-build-ruby-nokogumbo-2.0.5.drv-0/source/test/test_nokogumbo.rb:310:in `const_get'
    /tmp/guix-build-ruby-nokogumbo-2.0.5.drv-0/source/test/test_nokogumbo.rb:310:in `test_line_element'

  5) Error:
TestNokogumbo#test_line_template:
NameError: uninitialized constant Nokogiri::Gumbo::LINE_SUPPORTED
    /tmp/guix-build-ruby-nokogumbo-2.0.5.drv-0/source/test/test_nokogumbo.rb:316:in `const_get'
    /tmp/guix-build-ruby-nokogumbo-2.0.5.drv-0/source/test/test_nokogumbo.rb:316:in `test_line_template'

561 runs, 827 assertions, 0 failures, 5 errors, 10 skips

Replacing unless Nokogumbo.const_get\\(:LINE_SUPPORTED) with true in the test-Nokogumbo.rb files works around the issue.

Thanks!

stevecheckoway commented 1 year ago

@Apteryks Recent versions of Nokogiri include all of the Nokogumbo code. You should be able to stop using Nokogumbo entirely at this point and only use Nokogiri with no loss of functionality.

If, after switching, you're still having issues, file an issue on the Nokogiri issue tracker and someone will take a look.

Apteryks commented 1 year ago

Thanks, that's useful information! Now that you've mentioned it, I've seen it on the project page, eh :-).