forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Execute the integ-test workflow for OpenSearch Dashboards including tests. As opposed to OpenSearch, we need an image with the appropriate libraries so we pass the image but it does not have the wget so the steps were broken to access the build manifest. Hardcoding the OpenSearch build id for now until this get resolves: opensearch-project#1492 ARM tests will fail still until this is resolved: opensearch-project#1381 Issue partially resolved: opensearch-project#704 Signed-off-by: Kawika Avilla <[email protected]>
- Loading branch information
Showing
15 changed files
with
2,839 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
lib = library(identifier: "jenkins@20211118", retriever: legacySCM(scm)) | ||
|
||
pipeline { | ||
options { | ||
timeout(time: 3, unit: 'HOURS') | ||
} | ||
agent none | ||
environment { | ||
BUILD_MANIFEST = "build-manifest.yml" | ||
INTEG_TEST_JOB_NAME = 'integ-test-opensearch-dashboards' | ||
} | ||
parameters { | ||
string( | ||
name: 'TEST_MANIFEST', | ||
description: 'Test manifest under the manifests folder, e.g. manifests/2.0.0/opensearch-dashboards-2.0.0-test.yml.', | ||
trim: true | ||
) | ||
string( | ||
name: 'BUILD_MANIFEST_URL', | ||
description: 'The build manifest URL, e.g. https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.0.0/98/linux/x64/builds/opensearch-dashboards/manifest.yml.', | ||
trim: true | ||
) | ||
string( | ||
name: 'AGENT_LABEL', | ||
description: 'The agent label where the tests should be executed, e.g. Jenkins-Agent-al2-x64-c54xlarge-Docker-Host.', | ||
trim: true | ||
) | ||
string( | ||
name: 'AGENT_IMAGE', | ||
description: 'The agent label where the tests should be executed, e.g. opensearchstaging/ci-runner:centos7-x64-arm64-jdkmulti-node10.24.1-cypress6.9.1-20211028.', | ||
trim: true | ||
) | ||
} | ||
stages { | ||
stage('verify-parameters') { | ||
steps { | ||
script { | ||
if (AGENT_LABEL == '') { | ||
currentBuild.result = 'ABORTED' | ||
error("Integration Tests failed to start. Missing parameter: AGENT_LABEL.") | ||
} | ||
if (AGENT_IMAGE == '') { | ||
currentBuild.result = 'ABORTED' | ||
error("Integration Tests failed to start. Missing parameter: AGENT_IMAGE.") | ||
} | ||
} | ||
} | ||
} | ||
stage('download-manifest') { | ||
agent { | ||
node { | ||
label AGENT_LABEL | ||
} | ||
} | ||
steps { | ||
script { | ||
def buildManifestObj = downloadBuildManifest( | ||
url: BUILD_MANIFEST_URL, | ||
path: BUILD_MANIFEST | ||
) | ||
String buildId = buildManifestObj.getArtifactBuildId() | ||
env.BUILD_ID = buildId | ||
|
||
stash name: BUILD_MANIFEST, includes: BUILD_MANIFEST | ||
} | ||
} | ||
} | ||
stage('integ-test') { | ||
agent { | ||
docker { | ||
label AGENT_LABEL | ||
image AGENT_IMAGE | ||
alwaysPull true | ||
} | ||
} | ||
steps { | ||
script { | ||
unstash BUILD_MANIFEST | ||
echo "BUILD_MANIFEST: ${BUILD_MANIFEST}" | ||
echo "BUILD_ID: ${BUILD_ID}" | ||
|
||
runIntegTestScript( | ||
jobName: JOB_NAME, | ||
buildManifest: BUILD_MANIFEST, | ||
testManifest: TEST_MANIFEST, | ||
buildId: BUILD_ID | ||
) | ||
} | ||
} | ||
post { | ||
always { | ||
script { | ||
uploadTestResults( | ||
buildManifestFileName: BUILD_MANIFEST, | ||
jobName: INTEG_TEST_JOB_NAME, | ||
buildNumber: BUILD_ID | ||
) | ||
} | ||
postCleanup() | ||
} | ||
} | ||
} | ||
} | ||
|
||
post { | ||
success { | ||
node(AGENT_LABEL) { | ||
script { | ||
def stashed = lib.jenkins.Messages.new(this).get(['integ-test']) | ||
publishNotification( | ||
icon: ':white_check_mark:', | ||
message: 'Integration Tests Successful', | ||
extra: stashed, | ||
credentialsId: 'INTEG_TEST_WEBHOOK', | ||
) | ||
|
||
postCleanup() | ||
} | ||
} | ||
} | ||
failure { | ||
node(AGENT_LABEL) { | ||
script { | ||
def stashed = lib.jenkins.Messages.new(this).get(['integ-test']) | ||
publishNotification( | ||
icon: ':warning:', | ||
message: 'Failed Integration Tests', | ||
extra: stashed, | ||
credentialsId: 'INTEG_TEST_WEBHOOK', | ||
) | ||
|
||
postCleanup() | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.