...
Code Block | ||
---|---|---|
| ||
def call( def ENVIRONMENTNAME ) { try { mettleci properties config mettleci remote upload // Configure Properties mettleci remote execute "config/cleanup_unittest.sh" // UploadCleanup results unitof testprevious specsunit tests mettleci remote upload mettleci properties config // ConfigureUnit Propertiestest specifications and data mkdir // Create unit test report dir try { mettleci unittest test // Run Unit Tests } mettleci remote downloadfinally { mettleci remote download // Download unit test reports junitif testResults(exists 'unittest-reports/**/*.xml') { // Publish Unit Test results junit mettleci remote execute "config/cleanup_unittest.sh" // Cleanup } catch(e) { mettleci remote execute "config/cleanup_unittest.sh" testResults 'unittest-reports/**/*.xml' // CleanupPublish Unit Test results throw e // Propagate error for downstream error handling } } } |
Note that this Custom Step makes used of Jenkins' JUnit plugin.
...