diff --git a/README.adoc b/README.adoc index 38a24e273..37d57863c 100644 --- a/README.adoc +++ b/README.adoc @@ -357,6 +357,22 @@ pct: "default" *Please note that a blank metadata file will result in an error* +=== runBenchmarks + +Runs JMH benchmarks and archives benchmark reports on `highmem` nodes. + +Supported parameters: + +`artifacts`:: +(Optional) If `artifacts` is not null, invokes `archiveArtifacts` with the given string value. + + +===== Example +[source, groovy] +---- +runBenchmarks('jmh-report.json') +---- + === Design documents for runATH and runPCT The design and some more details about the runATH and runPCT steps can be found link:https://wiki.jenkins.io/display/JENKINS/runATH+and+runPCT+step+design[here] diff --git a/vars/runBenchmarks.groovy b/vars/runBenchmarks.groovy new file mode 100644 index 000000000..4805400de --- /dev/null +++ b/vars/runBenchmarks.groovy @@ -0,0 +1,30 @@ +#!/usr/bin/env groovy + +/** + * Run JMH benchmarks and archives results + * @param artifacts archive these JMH reports + * @since TODO + */ +def call(String artifacts = null) { + lock('runBenchmarks') { + node('highmem') { + + stage('Checkout repo') { + infra.checkout() + } + + stage('Run Benchmarks') { + List mvnOptions = ['test', '-Dbenchmark'] + infra.runMaven(mvnOptions) + } + + stage('Archive reports') { + if (artifacts != null) { + archiveArtifacts artifacts: artifacts + } else { + echo 'No artifacts to archive, skipping...' + } + } + } + } +} diff --git a/vars/runBenchmarks.txt b/vars/runBenchmarks.txt new file mode 100644 index 000000000..ad9e3d1ac --- /dev/null +++ b/vars/runBenchmarks.txt @@ -0,0 +1,22 @@ +

+ Runs JMH benchmarks and archives benchmark reports on highmem nodes. +

+

+ Supported Parameters: +

+ +
+
artifacts
+
+ (Optional) If artifacts is not null, invokes archiveArtifacts + with the given string value. +
+
+ +

+ Example: +

+ +
+    runBenchmarks('jmh-report.json')
+