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

Reuse tests from asciidoctor? #79

Closed
raghur opened this issue Apr 17, 2018 · 5 comments
Closed

Reuse tests from asciidoctor? #79

raghur opened this issue Apr 17, 2018 · 5 comments

Comments

@raghur
Copy link
Contributor

raghur commented Apr 17, 2018

What do you think about reusing tests from asciidoctor to check for compatibility? asciidoctor seems to have a rich set of tests.
While the tests are in ruby/rspec etc (I know very little of ruby myself) - but a quick pass at their tests seems to indicate that the tests go through a helper here

https://github.com/asciidoctor/asciidoctor/blob/master/test/test_helper.rb#L179

If libasciidoc had a cli exposing methods to parse document fragments, then in theory, it should be a simple matter to make the tests work.

Thoughts?

@xcoulon
Copy link
Member

xcoulon commented Apr 18, 2018

hello @raghur and thanks for suggesting this. Actually, I've been working on a CLI that is still a in a WIP here: #78, but I guess that could be a start. For now, I have to admin that I've been using asciidoctor to produce the expected output of all the tests in the rendering/html5 package, in order to verify that the output of libasciidoc is conform to the asciidoctor "spec".

@raghur
Copy link
Contributor Author

raghur commented Apr 18, 2018

So I asked the question on the asciidoctor repo and their advice is to consider only the feature tests. I think it'll still be interesting to try and see how many tests fail. It'd also serve as a quantifiable way to measure completeness and I think it might help people (like me ;)) who want to contribute if there's a set failing tests that they need to make pass to build out a asciidoc feature.

So is there anything holding up the pr #78? I'd be willing to help - but I'm quite new to Go (though not totally new)

@xcoulon
Copy link
Member

xcoulon commented Apr 18, 2018

@raghur well, for instance, I would like to add a few tests on the command. But you could probably get started before that, by pulling the code from the branch.

@raghur
Copy link
Contributor Author

raghur commented Apr 26, 2018

@xcoulon so I'm now able to run asciidoctor ruby tests with libasciidoc in a very hacky way :)... it's also noisy and imperfect - but you can see a log here for text_test.rb

https://pastebin.com/Nu1yQh5S

@xcoulon
Copy link
Member

xcoulon commented May 1, 2018

@raghur this is interesting! I wonder if there's a way to provide some sort of "coverage" or percentage of compliance with the asciidoctor tests ? Ideally by category (eg, passthrough, etc.), so it would help triaging the remaining work to do.

@xcoulon xcoulon added this to the backlog milestone Jul 8, 2018
moorereason added a commit to moorereason/libasciidoc that referenced this issue Oct 18, 2018
Create a basic framework for adding test fixtures. The workflow is to
add .adoc files to the fixtures folder with corresponding .html files to
act as the "golden" HTML output. Include files are in the includes
sub-folder so as to differentiate them from the main fixture files.

Failed tests show a diff against the golden output.

Tests are currently hidden behind a "fixtures" build tag. Use
"-tags=fixtures" when running tests to activate.

The existing test fixtures are mostly taken from the asciidoctor test
fixtures. The golden files were generated with asciidoctor v1.5.7.1
using the "-s" option.

Updates bytesparadise#79
@xcoulon xcoulon modified the milestones: backlog, v0.1 Oct 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants