Suitable for use in CI enviroment?

Questions, problems, suggestions, bug reports, and so on.
Post Reply
mlevison
Posts: 1
Joined: 2008-11-14 4:34 pm

Suitable for use in CI enviroment?

Post by mlevison » 2008-11-14 4:41 pm

I've not used JSCoverage myself - I'm just asking a question based on what a colleague said.

1) As it understand it JSCoverage requires that a human being press a button in the browser to generate coverage reports.
2) In addition there appears to be no way to save a report.

Clearly these two limitations limit the utility of JSCoverage as part of automated build (i.e. Continuous Integration).

Is my colleague mistaken? Are there workarounds? Do you think this might addressed in future releases?

Thanks
Mark Levison


--
Cheers
Mark Levison
Blog: http://www.notesfromatooluser.com/
Recent Entries: Agile/Scrum Smells: http://www.notesfromatooluser.com/2008/ ... mells.html
Agile Games for Making Retrospectives Interesting: http://www.notesfromatooluser.com/2008/ ... sting.html

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: Suitable for use in CI enviroment?

Post by Ed » 2008-11-14 5:14 pm

Hello, Mark,

You might want to try compiling the latest code from the Subversion repository - it can save coverage reports to the file system. Probably this can be automated, although the details will depend on what sort of test framework you are using.

Guest

Re: Suitable for use in CI enviroment?

Post by Guest » 2009-04-07 3:09 am

Hi, Did anybody succeed in saving the result as html through scripts. I'm trying to do it with jsunit, if so how ?

Thanks,
Reva.

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: Suitable for use in CI enviroment?

Post by Ed » 2009-04-07 3:22 am

The code for this is now in the latest released version of JSCoverage (version 0.4). You have to use the jscoverage-server program.

Guest

Re: Suitable for use in CI enviroment?

Post by Guest » 2009-04-07 8:55 pm

Hi Ed, Thanks for your response,

1. ran jscoverage-server.exe with --proxy --port=8888 --verbose
2. setup my ie to run as proxy.
3. Turned off browser caching
4. Ran URL - http://127.0.0.1/staticjs/jsunit/testRu ... toRun=true
5. Still get undefined dialogue for doc/exampl-jsunit test.
6. Test runs to completion with green status, but no jscoverage-report directory is found peer to doc directory.
7. jsunit version 2.2, jscoverage version 0.4

Please suggest whats not right ?, let me know if you need any other info.

Thanks,
Reva.

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: Suitable for use in CI enviroment?

Post by Ed » 2009-04-07 10:57 pm

When you run jscoverage-server with the --verbose option, you should get a message printed out to the console for every HTTP request. You should get a bunch of these when you run the JsUnit test suite. Are you getting these messages?

Guest

Re: Suitable for use in CI enviroment?

Post by Guest » 2009-04-10 1:46 pm

Hi,

Yes, I get the message printed out. But still get undefined dialogue box.

- Reva

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: Suitable for use in CI enviroment?

Post by Ed » 2009-04-13 3:22 am

Could you paste the verbose messages here? They might provide some clues.

Guest

Re: Suitable for use in CI enviroment?

Post by Guest » 2009-04-15 6:18 pm

Ant Target

Code: Select all

 <target name="jsunit_coverage">
                <echo message="Starting jscoverage server....."/> 
                <exec executable="jscoverage/jscoverage-server.exe">
                        <arg value="--verbose" />
                        <arg value="--proxy" />
                        <arg value="--port=8888" />
                </exec>
                <echo message="Started jscoverage server....."/> 
                
        </target>              
URL Used
http://localhost/staticjs/jsunit/testRu ... toRun=true
Command Prompt Logs

Code: Select all

jsunit_coverage:
     [echo] Starting jscoverage server.....
     [exec] Starting HTTP server on 127.0.0.1:8888
     [exec] GET http://localhost/staticjs/jsunit/testRunner.html?testPage=http://localhost/staticjs/jscoverage
/doc/example-jsunit/test.html&autoRun=true HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/xbDebug.js HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/jsUnitCore.js HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/jsUnitTestManager.js HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/jsUnitTracer.js HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/jsUnitTestSuite.js HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/main-frame.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/main-loader.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/testContainer.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/main-data.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/main-status.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/main-progress.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/main-counts.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/main-results.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/main-errors.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/testContainerController.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/emptyPage.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/css/jsUnitStyle.css HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/css/jsUnitStyle.css HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/css/jsUnitStyle.css HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/main-counts-runs.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/main-counts-errors.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/main-counts-failures.html HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/css/jsUnitStyle.css HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/css/jsUnitStyle.css HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/css/jsUnitStyle.css HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/css/jsUnitStyle.css HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/css/jsUnitStyle.css HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/jsUnitCore.js HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/images/green.gif HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/app/jsUnitVersionCheck.js HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/images/logo_jsunit.gif HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/images/powerby-transparent.gif HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/images/green.gif HTTP/1.1
     [exec] GET http://localhost/staticjs/jscoverage/doc/example-jsunit/test.html?cacheBuster=1239819312687 HT
TP/1.1
     [exec] GET http://localhost/staticjs/jscoverage/doc/example-jsunit/jsunit/app/jsUnitCore.js HTTP/1.1
     [exec] GET http://localhost/staticjs/jscoverage/doc/example-jsunit/script.js HTTP/1.1
     [exec] GET http://localhost/staticjs/jsunit/images/green.gif HTTP/1.1

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: Suitable for use in CI enviroment?

Post by Ed » 2009-04-16 4:55 am

One thing I notice is that you're using 2 separate copies of jsunit. (The example in doc/example-jsunit contains its own copy of jsunit.) What happens if you run this URL:

Code: Select all

http://localhost/staticjs/jscoverage/doc/example-jsunit/jsunit/testRunner.html?testPage=http://localhost/staticjs/jscoverage/doc/example-jsunit/test.html&autoRun=true

Guest

Re: Suitable for use in CI enviroment?

Post by Guest » 2009-04-17 3:00 pm

Ed,

Using

http://localhost/staticjs/jscoverage/do ... toRun=true

I still get the undefined dialogue box.

- Reva

Ed
Posts: 120
Joined: 2008-10-11 6:52 pm

Re: Suitable for use in CI enviroment?

Post by Ed » 2009-04-19 11:19 pm

Have you tried running the test in any other browsers? They may give more comprehensible error messages.

Post Reply