Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

This Shared Library hosts a Custom Step which is an example implementation of the Unit Test step of a MettleCI Pipeline.

Here’s the pseudocode for the Shared Library:

def call(
    def ENVIRONMENTNAME
) {
	try {
        mettleci remote upload                                  // Upload unit test specs 
        mettleci properties config                              // Configure Properties
        mkdir                                                   // Create unit test report dir
        mettleci unittest test                                  // Run Unit Tests
        mettleci remote download                                // Download unit test reports
        junit testResults 'unittest-reports/**/*.xml'           // Publish Unit Test results
        mettleci remote execute "config/cleanup_unittest.sh"    // Cleanup
   }
    catch(e) {
        mettleci remote execute "config/cleanup_unittest.sh"    // Cleanup
        throw e                                                 // Propagate error for downstream error handling
    }
}

Note that this Custom Step makes used of Jenkins' JUnit plugin.

  • No labels