forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestOpenSearchDashboardsIntegTest.groovy
59 lines (49 loc) · 2.54 KB
/
TestOpenSearchDashboardsIntegTest.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import jenkins.tests.BuildPipelineTest
import org.junit.Before
import org.junit.Test
import org.yaml.snakeyaml.Yaml
class TestOpenSearchDashboardsIntegTest extends BuildPipelineTest {
@Before
void setUp() {
def jobName = "dummy_job"
def testManifest = "tests/jenkins/data/opensearch-dashboards-1.2.0-test.yml"
def buildId = 215
def buildManifest = "tests/jenkins/data/opensearch-dashboards-1.2.0-build.yml"
def buildManifestUrl = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/1.2.0/${buildId}/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-1.2.0-linux-x64.tar.gz"
def agentLabel = "Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host"
this.registerLibTester(new DetectTestDockerAgentLibTester())
this.registerLibTester(new DownloadBuildManifestLibTester(buildManifestUrl, buildManifest))
this.registerLibTester(new RunIntegTestScriptLibTester(jobName, 'functionalTestDashboards', buildManifest, "manifests/${testManifest}"))
this.registerLibTester(new UploadTestResultsLibTester(buildManifest, jobName))
this.registerLibTester(new PublishNotificationLibTester(
':white_check_mark:',
'Integration Tests Successful',
'',
testManifest,
'jenkins-integ-test-webhook'))
super.setUp()
// Variables
binding.setVariable('TEST_MANIFEST', testManifest)
binding.setVariable('BUILD_MANIFEST_URL', buildManifestUrl)
binding.setVariable('AGENT_LABEL', agentLabel)
binding.setVariable('BUILD_MANIFEST', buildManifest)
binding.setVariable('BUILD_ID', "${buildId}")
def env = binding.getVariable('env')
env['DOCKER_AGENT'] = [image:'opensearchstaging/ci-runner:ci-runner-centos7-v1', args:'-e JAVA_HOME=/opt/java/openjdk-11']
binding.getVariable('currentBuild').upstreamBuilds = [[fullProjectName: jobName]]
helper.registerAllowedMethod('fileExists', [String.class], { args ->
return true;
})
helper.registerAllowedMethod('findFiles', [Map.class], null)
helper.registerAllowedMethod('unstash', [String.class], null)
}
@Test
void integTests_runs_consistently() {
super.testPipeline('jenkins/opensearch-dashboards/integ-test.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/opensearch-dashboards/integ-test.jenkinsfile')
}
}