Skip to content
This repository was archived by the owner on Oct 17, 2021. It is now read-only.

Add support for Travis-CI integration #25

Merged
merged 8 commits into from
May 15, 2014

Conversation

florentx
Copy link
Contributor

@florentx florentx commented May 4, 2014

It gives basic support for continuous integration.

This is tested, and the build passes: https://travis-ci.org/florentx/asciidoc/builds/24401205

@michel-kraemer
Copy link
Contributor

+1 looks good to me.

Thanks a lot! This PR will be very valuable, in particular it will allow us to check future pull requests automatically. We just need to enable the Travis hook in the projects settings after the PR has been merged.

Cheers,
Michel

@michel-kraemer
Copy link
Contributor

Just one question. The log file of the 2.6 build contains several error messages (related to syntax errors) but it does not fail. Is this supposed to happen?

@florentx
Copy link
Contributor Author

florentx commented May 5, 2014

Hello Michel, I noticed these errors and other limitations as well.
But I thought it would be easier to review the PR if I keep it small and focused.

I did further research about these warnings, and I found that the test suite is a bit too indulgent:

  • if some dependency is missing, errors are printed but test is marked PASSED
  • if a filter spawns a subprocess and it crashes (like it is the case for 2.6 here), test is marked PASSED
  • if a test source or a backend is missing, the test is SKIPPED but the exit code is 0
  • if a macro or anything else returns a warning, the warning is silenced, and result is PASSED

I've started to address all these points in a separate branch compat26 of my repo, and I will propose a PR soon.

Then I discovered a last limitation: doing tests/testasciidoc.py update then tests/testasciidoc.py run with the same revision is slow and dumb: it controls that the output is identical when running asciidoc twice.
This is the intended behavior as explained here: http://asciidoc.org/testasciidoc.html#_rationale
It is acceptable when running the tests manually while developing new features but it's not compatible with the continuous integration approach.
We need to think more about this.

I see 2 solutions so far:

  • running tests/testasciidoc.py update and committing the result
  • or computing an MD5SUMS file of the expected output, storing it in the tests/data directory, and implementing a new flag tests/testasciidoc.py run --compare-md5 which could be used for Travis-CI.

I will open a separate issue for it.

@florentx
Copy link
Contributor Author

florentx commented May 5, 2014

This is the current state for the compat26 branch: florentx/asciidoc@with-travis...compat26

@@ -255,3 +255,6 @@ def execute(self, infile, outfile=None, backend=None):
import doctest
options = doctest.NORMALIZE_WHITESPACE + doctest.ELLIPSIS
doctest.testmod(optionflags=options)
test_result = doctest.testmod(optionflags=options)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are calling doctest.testmod() twice here. Is this intended? If so, why?

Michel

@michel-kraemer
Copy link
Contributor

I like this PR and we can merge it. I just have a very minor comment (see my previous inline comment).

Cheers,
Michel

@florentx
Copy link
Contributor Author

I've updated the patch, thank you for your review

michel-kraemer added a commit that referenced this pull request May 15, 2014
Add support for Travis-CI integration
@michel-kraemer michel-kraemer merged commit 56a8bfa into asciidoc-py:master May 15, 2014
@elextr
Copy link
Contributor

elextr commented May 15, 2014

@michel-kraemer have you set up a travis account and the asciidoc github repository so that travis will work? http://docs.travis-ci.com/user/getting-started/

@michel-kraemer
Copy link
Contributor

I'm on it...

@elextr
Copy link
Contributor

elextr commented May 15, 2014

Ok, I was just gonna say it would be appropriate to add a status icon to the readme (although only if its green ;-)

@florentx
Copy link
Contributor Author

Great 👍

@florentx florentx deleted the with-travis branch May 15, 2014 11:24
@michel-kraemer
Copy link
Contributor

OK. Seems to work:
https://travis-ci.org/asciidoc/asciidoc

I just added the status icon to the README file.

Cheers,
Michel

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

Successfully merging this pull request may close these issues.

3 participants