...
Code Block | ||
---|---|---|
| ||
def call( def ENVIRONMENTNAME ) { try { mettleci properties config // Configure Properties mettleci remote execute "config/cleanup_unittest.sh" // Cleanup results #of Uploadprevious unit tests mettleci remote upload // Unit test specs specifications and data mkdir # Configure Properties #// Create unit test report dir try { mettleci unittest test # // Run Unit Tests } # Download unit test reports finally { // Whether the above is successfult or not... mettleci remote download # Publish Unit Test results # Cleanup // }Download unit test reports catch(e) { if (exists # Cleanup'unittest-reports/**/*.xml') { junit testResults 'unittest-reports/**/*.xml' // throwPublish eUnit Test results # Propagate error for downstream error processing} } } |
Note that this Custom Step makes used of Jenkins' JUnit plugin.