Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagegroovy
def call(
    def ENVIRONMENTNAME
) {
	try {   mettleci properties config    mettleci remote upload                        // Configure Properties
    mettleci remote  # Upload unit test specs 
   execute "config/cleanup_unittest.sh"    // Cleanup results of previous unit tests
    mettleci remote upload  properties config                              # Configure// PropertiesUnit test specifications and data
    mkdir                                                   #// Create unit test report dir

	try {
        mettleci unittest test                                  #// Run Unit Tests
    }

   mettleci remotefinally download{                                # Download unit test reports         junit testResults 'unittest-reports/**/*.xml' Whether the above is successfult      # Publish Unit Test resultsor not...
        mettleci remote execute "config/cleanup_unittest.sh"download     # Cleanup    }     catch(e) {         mettleci remote execute "config/cleanup_unittest.sh"    # Cleanup// Download unit test reports
        if throw e (exists 'unittest-reports/**/*.xml') {
            junit testResults 'unittest-reports/**/*.xml'   // Publish Unit Test results
                         # Propagate error for downstream error handling}
    }
}

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

...