I've set up a CCNet Server with MSBuild and MSTest.
Afterwards I've created a Test Project with some Unit Tests.
The Build is sucessfull, but two of the Unit Tests do fail (on purpose).
I receive an Email that the Build was not successfull (even only the Unit Tests failed).
Is it possible to send a seperated Email (if only the Unit Tests fail) or change the contend of the Email so I can see that only the Unit Tests failed and not the Build itsself?
I look forward to your answer,
with kind regards
Sandor D.
I've appended my ccnet.config with the following code:
<email>
...
<xslFiles>
<xslFile>xsl\header.xsl</xslFile>
<xslFile>xsl\modifications.xsl</xslFile>
<xslFile>xsl\compile-msbuild.xsl</xslFile>
<xslFile>xsl\unittests.xsl</xslFile>
<xslFile>xsl\MsTestReport2008.xsl</xslFile>
<xslFile>xsl\MsTestSummary.xsl</xslFile>
</xslFiles>
</email>
So now I get an output of the passed and failed unit tests in the report email.
Related
I am using cucumber-js for making e2e test. Once it failed, it's hard to debug due to ambiguous context of runtime. So I would like to have the ability to console log or take screenshot of what's going on when the testcase failed. Does cucumber support that and how can I do that in Cucumberjs
Scenario 1:
Given I got state A
When I do B <- fail here
Then I see C
// How can I run a logic when a step failed?
I have a Azure DevOps release pipeline which contains 10+ stages (environments). Each release stage will run a set of test cases for example, BVT Test Stage, Performance Test Stage, etc.
Now, I would like to automatically query the test results from each of the test stage, by REST API.
I can use "Runs" API to query the test runs for this release; I can use "Release" API to query the release stages including their stage names.
But the problem is, I am not able to link the test result from the test run back to the release stage.
For example, I have release stages like "BVT Test", "Performance Test", etc. But the test result from test run is something like "VSTest_TestResults_2234523"
Thanks!
how to get release stage's test results?
Try with below api:
GET https://vstmr.dev.azure.com/{org name}/{project name}/_apis/testresults/resultdetailsbyrelease?releaseId={release id}&releaseEnvId={environment id}&api-version=5.2-preview.1
To get the test result of one specific environment, you must provide the environment id, along with its corresponding release id.
Each test run has a member points to the release's environmentId.
$stageName = $stageTable[$($oneRun.release.environmentId)]
I have a NodeJS module that uses express and sequelize basically.
I have automated tests for it that use mocha, mock-require, supertest and nyc
This test suite used to run fine, and suddenly on a CI pipeline run, the suite started failing, and I only see this in the logs:
Process finished with exit code -1066598273 (0xC06D007F)
Anyone have any idea what this could be? I made no changes in the code whatsoever
When I run unit tests via Ospec for Mithril, I can see if tests fail locally in the console.
What I'm looking for is a solution that will not allow a following Node.js build script to execute if one or more of the tests fail.
I don't want code to be pushed up to another environment/lane if the unit tests aren't passing.
I don't see how to accomplish this in the docs.
In Node, I'm running ospec && someBuildProcess.
The answer might be a Node.js thing, but I'm at a loss for what to look for now.
ospec calls process.exit(1) if any tests fail, and the command string you posted should work. I just verified it locally with the following setup:
https://gist.github.com/tivac/d90c07592e70395639c63dd5100b50a6
ospec runs, fails, and the echo command never gets called.
Can you post some more details about your setup?
I have CruiseControl.NET setup to send out an email if there is a compile error and when the error has been fixed:
<notifications>
<notificationType>Change</notificationType>
</notifications>
However this also sends out an email if the source code repository can't be reached. This is expected since the server is restarted every night.
How can I limit the alert emails to compile errors only?
this also sends out an email if the source code repository can't be reached
You can use the sourceControlErrorHandling tag (action to take when a source control error occurs)
<maxSourceControlRetries>3</maxSourceControlRetries>
<sourceControlErrorHandling>ReportOnRetryAmount</sourceControlErrorHandling>
Setting ReportOnRetryAmount to a high value will lower your exception build email.
Reference: 'Project Configuration Block' documentation.
http://www.cruisecontrolnet.org/projects/ccnet/wiki/Project_Configuration_Block
I don't think CC.NET is able to distinguish a "usual" build failure from source code unavailability. The notification type can be one of the following: {'Always', 'Change', 'Failed', 'Success', 'Fixed', 'Exception'}. I'm not sure I can tell the difference between Failed and Exception - probably, the first is a build failure, including unit test failure, etc., while the other one refers to the CC.NET own code failure.
Anyway, if I were you, I would do one of the following:
experiment with notification types (just in case)
make sure the build process is not triggered when the server is restarting, e.g. if you configured nightly builds, you can schedule those to run after the server restarts