ReSpec errors and Continuous Integration

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

ReSpec errors and Continuous Integration

Dominique Hazael-Massieux-2
Hi,

I've modified a bit respec2html.js, the phantomjs script that allows to
build the HTML output of a respec from the command line:
https://github.com/w3c/respec/pull/357

These modifications make it usable as a way to "validate" the
correctness of a ReSpec document: when errors or warnings are emitted
during the generation of the final HTML output, they can be printed out
(using the -e and -w command lines parameters).

These changes makes it also possible to use respec2html.js in a
continuous integration environment where any "build" error triggers an
alert.

I have in particular started to see how to use this in the context of
Travis CI (http://travis-ci.org), a popular continuous integration tool
plugged into GitHub.

To set up Travis CI, you need a configuration file (named .travis.yml)
to indicate what the "build" process consists of; the
following .travis.yml does the trick for respec2html.js:
        language: python
        install: git clone https://github.com/w3c/respec.git
        script: phantomjs --ignore-ssl-errors=true --ssl-protocol=tlsv1
        respec/tools/respec2html.js -e -w
        respecsourcefiletobechecked.html output.html
       
(I picked python as the environment language, but in this case, it's not
really needed)

I have tested it on my fork of the getUserMedia spec, and it worked:
https://travis-ci.org/dontcallmedom/mediacapture-main/builds/40003971

I'll be looking into integrating this with our main repo for that spec
and other specs from my groups.

I've also been looking at at applying a similar mechanism for automatic
WebIDL syntax verification (via the WebIDL checker
https://github.com/dontcallmedom/webidl-checker/) as you can maybe guess
from the build output linked above.

Dom



Reply | Threaded
Open this post in threaded view
|

Re: ReSpec errors and Continuous Integration

Shane McCarron
I had a thought about this whole thing.... I bet we could incorporate automatic linkchecking and pubrules checking as well.  Specrebus is coming along nicely.  I realize that this isn't necessarily something people always want, but as a document gets toward publication just knowing what areas need attention could be a real boon.

On Wednesday, November 5, 2014, Dominique Hazael-Massieux <[hidden email]> wrote:
Hi,

I've modified a bit respec2html.js, the phantomjs script that allows to
build the HTML output of a respec from the command line:
https://github.com/w3c/respec/pull/357

These modifications make it usable as a way to "validate" the
correctness of a ReSpec document: when errors or warnings are emitted
during the generation of the final HTML output, they can be printed out
(using the -e and -w command lines parameters).

These changes makes it also possible to use respec2html.js in a
continuous integration environment where any "build" error triggers an
alert.

I have in particular started to see how to use this in the context of
Travis CI (http://travis-ci.org), a popular continuous integration tool
plugged into GitHub.

To set up Travis CI, you need a configuration file (named .travis.yml)
to indicate what the "build" process consists of; the
following .travis.yml does the trick for respec2html.js:
        language: python
        install: git clone https://github.com/w3c/respec.git
        script: phantomjs --ignore-ssl-errors=true --ssl-protocol=tlsv1
        respec/tools/respec2html.js -e -w
        respecsourcefiletobechecked.html output.html

(I picked python as the environment language, but in this case, it's not
really needed)

I have tested it on my fork of the getUserMedia spec, and it worked:
https://travis-ci.org/dontcallmedom/mediacapture-main/builds/40003971

I'll be looking into integrating this with our main repo for that spec
and other specs from my groups.

I've also been looking at at applying a similar mechanism for automatic
WebIDL syntax verification (via the WebIDL checker
https://github.com/dontcallmedom/webidl-checker/) as you can maybe guess
from the build output linked above.

Dom





--
Shane McCarron
Managing Director, Applied Testing and Technology, Inc.

Reply | Threaded
Open this post in threaded view
|

Re: ReSpec errors and Continuous Integration

Kostiainen, Anssi
In reply to this post by Dominique Hazael-Massieux-2
Hi Dom,

> On 05 Nov 2014, at 11:37, Dominique Hazael-Massieux <[hidden email]> wrote:
>
> I've modified a bit respec2html.js, the phantomjs script that allows to
> build the HTML output of a respec from the command line:
> https://github.com/w3c/respec/pull/357
>
> These modifications make it usable as a way to "validate" the
> correctness of a ReSpec document: when errors or warnings are emitted
> during the generation of the final HTML output, they can be printed out
> (using the -e and -w command lines parameters).
>
> These changes makes it also possible to use respec2html.js in a
> continuous integration environment where any "build" error triggers an
> alert.

I'm happy to see respec2html.js used in more places and get improvements from contributors :-) Initially it was an effort to scratch my own itch of making the snapshot generation from the CLI easier, but it seems like a good fit for CI too.

Thanks,

-Anssi
Reply | Threaded
Open this post in threaded view
|

Re: ReSpec errors and Continuous Integration

Dominique Hazael-Massieux-2
In reply to this post by Shane McCarron
Le mardi 11 novembre 2014 à 07:06 -0600, Shane McCarron a écrit :
> I had a thought about this whole thing.... I bet we could incorporate
> automatic linkchecking and pubrules checking as well.

That was part of my evil plan, indeed; I have the code for applying
linkchecking in Travis now; it's a bit convoluted, but it works.

I'll need to start working on a better way to document, import and
maintain these spec CI rules.

Dom



Reply | Threaded
Open this post in threaded view
|

Re: ReSpec errors and Continuous Integration

Shane McCarron
BTW I have made the linkchecker changes to do JSON.  Nearly complete.  Might make it easier to do the integration.

On Thursday, November 27, 2014, Dominique Hazael-Massieux <[hidden email]> wrote:
Le mardi 11 novembre 2014 à 07:06 -0600, Shane McCarron a écrit :
> I had a thought about this whole thing.... I bet we could incorporate
> automatic linkchecking and pubrules checking as well.

That was part of my evil plan, indeed; I have the code for applying
linkchecking in Travis now; it's a bit convoluted, but it works.

I'll need to start working on a better way to document, import and
maintain these spec CI rules.

Dom



--
Shane McCarron
Managing Director, Applied Testing and Technology, Inc.