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

1 error in tests #27

Open
micwoj92 opened this issue Nov 29, 2023 · 6 comments
Open

1 error in tests #27

micwoj92 opened this issue Nov 29, 2023 · 6 comments
Labels

Comments

@micwoj92
Copy link

Hello, I'm trying to run the test suite, but I run into 1 test error.
ruby 3.0.6
nokogiri 1.13.9

Output when running rake:

Loaded suite /usr/lib/ruby/gems/3.0.0/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
Coverage report generated for Unit Tests to /home/micwoj92/Documents/pkg/fog/simplecov-cobertura/tmp/coverage.xml. 6 / 7 LOC (85.71%) covered; 3 / 6 BC (50.00%) covered
E
==============================================================================================================================================================================================================================================
Error: test_format_dtd_validates(CoberturaFormatterTest): NoMethodError: undefined method `validate' for nil:NilClass
/home/micwoj92/Documents/pkg/fog/simplecov-cobertura/test/simplecov-cobertura_test.rb:56:in `test_format_dtd_validates'
     53:     xml = @formatter.format(@result)
     54:     options = Nokogiri::XML::ParseOptions::DTDLOAD
     55:     doc = Nokogiri::XML::Document.parse(xml, nil, nil, options)
  => 56:     assert_empty doc.external_subset.validate(doc)
     57:   end
     58: 
     59:   def test_no_groups
==============================================================================================================================================================================================================================================
Coverage report generated for Unit Tests to /home/micwoj92/Documents/pkg/fog/simplecov-cobertura/tmp/cobertura.xml. 6 / 7 LOC (85.71%) covered; 3 / 6 BC (50.00%) covered
|Coverage report generated for Unit Tests to /home/micwoj92/Documents/pkg/fog/simplecov-cobertura/tmp/coverage.xml. 6 / 7 LOC (85.71%) covered; 3 / 6 BC (50.00%) covered
/Coverage report generated for Unit Tests to /home/micwoj92/Documents/pkg/fog/simplecov-cobertura/tmp/coverage.xml. 6 / 7 LOC (85.71%) covered; 3 / 6 BC (50.00%) covered
-Coverage report generated for Unit Tests to /home/micwoj92/Documents/pkg/fog/simplecov-cobertura/tmp/coverage.xml. 6 / 7 LOC (85.71%) covered; 3 / 6 BC (50.00%) covered
\Coverage report generated for Unit Tests to /tmp/tmp/coverage.xml. 6 / 7 LOC (85.71%) covered; 3 / 6 BC (50.00%) covered
Finished in 0.137903972 seconds.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
7 tests, 66 assertions, 0 failures, 1 errors, 0 pendings, 0 omissions, 0 notifications
85.7143% passed
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
50.76 tests/s, 478.59 assertions/s
rake aborted!
Command failed with status (1)

Tasks: TOP => default => test
(See full trace by running task with --trace)

@okuramasafumi
Copy link
Contributor

I also encounter this error.

https://www.xmlvalidation.com/

I noticed that with this online validation tool, it cannot process the generated output when DTD check is enabled. So maybe it really has some issue, not only about testing.

@jessebs jessebs added the bug label Jan 11, 2024
@jessebs
Copy link
Contributor

jessebs commented Feb 19, 2024

I get a generic error with the xmlvalidation.com link shared above - it's unclear if that has anything to do with the generated XML vs an internal error.

https://www.truugo.com/xml_validator/ does indicate that the xml generated by the failing test validates correctly.

@jessebs
Copy link
Contributor

jessebs commented Feb 19, 2024

xmlib2 appears to have a problem downloading the dtd.

> xmllint coverage.xml --loaddtd --valid
....
error : Unknown IO error
coverage.xml:2: warning: failed to load external entity "http://cobertura.sourceforge.net/xml/coverage-04.dtd
....

Converting to https does not resolve it. Curl doesnt give any indication that things are strange.

Downloading the dtd and replacing the url with the relative path in the xml file gets rid of the error.

This indicates that there isn't a problem with the XML being generated but instead with the way the dtd file is being retrieved.

investigation continuing...

@jessebs
Copy link
Contributor

jessebs commented Feb 19, 2024

My guess is that this is tied to OS updates since it last worked in the build environment. I created a ticket with gnome - lets see if it goes anywhere.

I filed: https://gitlab.gnome.org/GNOME/libxml2/-/issues/693

@jessebs
Copy link
Contributor

jessebs commented Feb 19, 2024

Actually, it appears to do with an HTTPS redirect. http://cobertura.sourceforge.net/xml/coverage-04.dtd redirects to https.

https://gitlab.gnome.org/GNOME/libxml2/-/issues/160

@jessebs
Copy link
Contributor

jessebs commented Feb 19, 2024

..and a nokogiri bug to track it:

sparklemotion/nokogiri#3132

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

When branches are created from issues, their pull requests are automatically linked.

3 participants