Meteor application has built with 'meteor build' command and then deployed. After deployment application runs using plain node command 'node bundle/main.js'.
Running nyc using command 'nyc node main.js' only give the partial results from the meteor generate files.
Code coverage result
Is there anyway to get the full code coverage results? I am only interested to get result about javascript files.
Related
I created a CLI application and I would like to debug it using the VSCode debugger in the real world. For example, if I wanted to debug create-react-app and step through the code as I'm running it on the command line, is that possible?
We run a CI environment with Jenkins and the Project using ExtJS 5.1.1.
I try using Chutzpah test runner, using mocha framework JavaScript unit test.
With JavaScript test without ExtJS 5.1.1 testing run successfully.
But JavaScript with reference ext-all.js, there are no success. We have time out error in Blanket.js (error blanket_mocha.js line 5141) testing are not succeed and coverage.xml won't generate.
I'm looking for other way how run JavaScript test (ExtJS) in Jenkins with mocha framework and have code coverage report generate.
We already have Grunt run in Jenkins to do JavaScript combine and minify.
Is this possible to using Grunt to run mocha test and generate coverage.xml in Jenkins?
Please help me out if there is some other way to achieve the same thing. Any suggestion are highly appreciated.
I have a couple of projects that use Karma to run Jasmine unit tests. We're using npm for package management and Grunt for building our JavaScript projects and executing their unit test tasks. After committing, these projects are built automatically via Jenkins jobs.
On Windows, my projects build successfully. When Jenkins runs the builds on Linux, however, I randomly will see unit test failures that seem to be caused by a previous version of my file being referenced.
For example, I have a class that previously called:
alert('Cannot retrieve report with the following url: report');
It was recently changed to call:
alert('There was an error trying to retrieve report with ID: 123');
When I run my unit tests locally on Windows, every test runs successfully. When Jenkins runs them on Linux, the tests fail with this output:
Expected spy alert to have been called with [ 'There was an error
trying to retrieve report with ID: 123' ] but actual calls were [
'Cannot retrieve report with the following url: report' ]
It seems that somewhere the old version of my file is being referenced. Is it possible that somewhere something (Jenkins, a Node module, etc.) is caching my files?
I've verified that my Jenkins workspace contains the correct versions of the files for which the unit tests are failing. I've also removed any tildes from my package.json and used npm shrinkwrap to ensure that I have full control of my dependencies. I've wiped my workspace several times and created multiple jobs, but I can't seem to rid myself of this problem.
I'm trying to get sonar to produce code coverage reports and unit test results. I'm running my unit tests with JS Test Driver and using maven to send the results to sonar which is installed on an internal server machine.
I've managed to get the unit test results to show up, but when I look at the source for the individual test files in sonar I get:
"Could not find source for unit test: Chrome_280150095_Windows.ButtonTest in any of test directories"
Additionally the code coverage results do not appear although they are being generated. I have a feeling it's because the jsTestDriver.conf-coverage.dat file contains paths to code from the machine I'm running jstestdriver from, not the machine I'm using to host sonar.
Can I only run mvn sonar:sonar on a machine with sonar installed locally or can I do it remotely like I'm trying? Where will sonar pick up the source classes from?
I'm very new to sonar so forgive me if I'm doing something totally wrong!
Here are the various files involed:
pom: http://pastebin.com/N21rbZZ3
maven settings profile for sonar: http://pastebin.com/HZfPMF0f
mvn sonar:sonar output: http://pastebin.com/WvPf1Axf
jsTestDriver.conf-coverage.dat: http://pastebin.com/pYYx20A9
TEST-Chrome_280150095_Windows.ButtonTest.xml: http://pastebin.com/f97EHtYE
Thanks!
Properties such as "sonar.sources" and "sonar.tests" are not taken into account while triggering the analysis with Maven. See http://docs.codehaus.org/display/SONAR/Analysis+Parameters. Hence your issue regarding source code of tests that is not found. This behavior will eventually changed when the following ticket is implemented: http://jira.codehaus.org/browse/SONAR-4536. Meanwhile, you should use the SonarQube Runner to trigger the analysis.
I have a project that I am setting up through teamcity for CI.
The project itself is a nodejs application and it includes test written in mocha, which we cover through jscoverage. In the build configuration I'm setting up I have 3 build steps
which occur on checkin.
call jscoverage.exe against the folders in my project that I'm
covering.
call mocha to run the test against the jscovered files from step 1
and output to the html-cov reporter
move the generated coverage.html report into a public web directory
to browse later.
The build currently fails on step 2:
mocha" is not present in directory C:\NodeJS\MeasuresAPI
I've made sure to include mocha and all my node packages in the system environment paths and I am able to access them in the command prompt, but TeamCity doesnt appear to see them.
for the jscoverage.exe, I had to include the full path. With mocha, I tried including the path to my node global installation where mocha installed to but it gives me an error:
"..\node_modules\mocha\bin\mocha" (in directory "C:\NodeJS\MeasuresAPI"): CreateProcess error=193, %1 is not a valid Win32 application
Anyone had any experience with Teamcity and Mocha and how to get them to play nice?
or any ideas for continuous integration with a nodejs, mocha stack?
Yes , this happened to me too, when I was setting up TeamCity to run mocha on Windows Server. The solution was to call mocha by specifying path to the mocha.cmd bat file. For example , if you have folder C:\mocha and you have executed
npm install mocha
in that directory , than path to the bat file will be
C:\mocha\node_modules.bin\mocha.cmd
And you can tell Teamcity to execute mocha command by giving it next instruction :
C:\mocha\node_modules.bin\mocha --ui tdd --reporter html-cov test\measureDBTests.js > coverage.html