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
13 changed files
with
2,754 additions
and
16 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,132 @@ | ||
lib = library(identifier: "jenkins@20211118", retriever: legacySCM(scm)) | ||
|
||
pipeline { | ||
agent none | ||
environment { | ||
AWS_ROLE_ARN = "arn:aws:iam::${AWS_ACCOUNT_PUBLIC}:role/opensearch-test" | ||
AWS_ROLE_SESSION_NAME = "jenkins-test-session" | ||
BUILD_MANIFEST = "build-manifest.yml" | ||
INTEG_TEST_JOB_NAME = 'integ-test-opensearch-dashboards' | ||
} | ||
parameters { | ||
string( | ||
defaultValue: '', | ||
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( | ||
defaultValue: '', | ||
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( | ||
defaultValue: '', | ||
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( | ||
defaultValue: '', | ||
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('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}" | ||
) | ||
} | ||
cleanWs disableDeferredWipeout: true, deleteDirs: true | ||
} | ||
} | ||
} | ||
} | ||
|
||
post { | ||
success { | ||
node('Jenkins-Agent-al2-x64-m5xlarge') { | ||
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', | ||
) | ||
|
||
cleanWs( | ||
disableDeferredWipeout: true, | ||
deleteDirs: true | ||
) | ||
} | ||
} | ||
} | ||
failure { | ||
node('Jenkins-Agent-al2-x64-m5xlarge') { | ||
script { | ||
def stashed = lib.jenkins.Messages.new(this).get(['integ-test']) | ||
publishNotification( | ||
icon: ':warning:', | ||
message: 'Failed Integration Tests', | ||
extra: stashed, | ||
credentialsId: 'INTEG_TEST_WEBHOOK', | ||
) | ||
|
||
cleanWs( | ||
disableDeferredWipeout: true, | ||
deleteDirs: true | ||
) | ||
} | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
--- | ||
schema-version: '1.0' | ||
name: OpenSearch Dashboards | ||
components: | ||
- name: functionalTestDashboards | ||
integ-test: | ||
test-configs: | ||
- with-security | ||
- without-security | ||
schema-version: '1.0' |
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,25 @@ | ||
/* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
*/ | ||
|
||
import jenkins.tests.BuildPipelineTest | ||
import org.junit.Before | ||
import org.junit.Test | ||
|
||
|
||
class TestRunIntegTestScript extends BuildPipelineTest { | ||
|
||
@Test | ||
public void TestRunIntegTestScript() { | ||
super.testPipeline("tests/jenkins/jobs/RunIntegTestScript_Jenkinsfile") | ||
} | ||
|
||
@Test | ||
public void TestRunIntegTestScript_OpenSearch_Dasbhoards() { | ||
super.testPipeline("tests/jenkins/jobs/RunIntegTestScript_OpenSearch_Dashboards_Jenkinsfile") | ||
} | ||
} |
Oops, something went wrong.