Reputation: 1
I setup bluemix devops pipeline with DevOps insights Gate node included. Unit test result (mocha format) and coverage result (istanbul format) have been uploaded in test jobs (using grunt-idra3 npm plugin as same as the tutorial did ⇒github url).
However, my gate job is still failed, though unit test is showing 100% pass.
Much appreciated if someone can help me.
All unit test passed, but still "decision for Unit Test" is red failed⇒
Detail of policy & rules : policy "Standard Mocha Test Policy"
Rule-1: Functional verification test, Rule type: Functional verification test, Results file format: xUnit, Percent Passes: 100%
Rule-2: Istanbul Coverage Rule, Rule type: Code Coverage, Result file format: istanbul, Minimum code coverage required: 80%
Rule-3: Mocha Unit Test Rule, Rule type: Unit Test, Results file format: xUnit, Percent Passes: 100%
Upvotes: 0
Views: 139
Reputation: 1
After spending almost 3 weeks on this, finally I get DevOps Gate Job all green. Thanks @Vijay Aggarwal, and everyone else who helped on this issue.
Here is actually what happened and how it is solved finally.
[Root Cause]
DevOps Rules are "Result Format Sensitive" too, so people must be careful in choosing "reporter" for Mocha or Istanbul. In my case, I defined the gulp file as follows, but incorrectly set result type to "mocha" in Policy Rule definition.
gulp.task("test", ["pre-test"], function() {
return gulp.src(["./test/**/*.js"], {read: false})
.pipe(mocha({
reporter: "mocha-junit-reporter",
reporterOptions: {
mochaFile: './testResult/testResult-summary.xml'
}
}));
[How it is solved]
Screenshot when DevOps Gate is finally passed
Upvotes: 0
Reputation: 11
There seems to be a mismatch between the format specified in Rule (xUnit) and the format of the actual test results (Mocha).
Please update the rule to select "Mocha" format for Unit Tests. Then rerun the gate.
Upvotes: 1