forked from opensearch-project/opensearch-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestDataPrepperDistributionArtifacts.groovy
52 lines (36 loc) · 2.03 KB
/
TestDataPrepperDistributionArtifacts.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
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/
import jenkins.tests.BuildPipelineTest
import org.junit.Before
import org.junit.Test
class TestDataPrepperDistributionArtifacts extends BuildPipelineTest {
@Before
void setUp() {
def dummyBuildArtifacts = "tar_dummy_1_artifact_1.0.0.tar.gz tar_dummy_2_artifact_1.0.0.tar.gz"
def artifactsPath = "${this.workspace}/release/archives/linux/build/distributions"
def filenamesForUrls = ['tar_dummy_1_artifact_1.0.0.tar.gz', 'tar_dummy_2_artifact_1.0.0.tar.gz',
'tar_dummy_1_artifact_1.0.0.tar.gz.sig', 'tar_dummy_2_artifact_1.0.0.tar.gz.sig']
def bucketName = 'job-s3-bucket-name'
this.registerLibTester(new SignArtifactsLibTester( '.sig', 'linux', artifactsPath, null, null))
this.registerLibTester(new UploadToS3LibTester( artifactsPath, bucketName, 'data-prepper-distribution-artifacts/0.22.1/51/builds/signed'))
this.registerLibTester(new PrintArtifactDownloadUrlsForStagingLibTester( filenamesForUrls, 'data-prepper-distribution-artifacts/0.22.1/51/builds/signed'))
super.setUp()
// Variables for Data-prepper-Distribution-Artifacts-job
binding.setVariable('VERSION', '0.22.1')
binding.setVariable('BRANCH', 'refs/tags/0.22.1')
binding.setVariable('JOB_BASE_NAME', 'data-prepper-distribution-artifacts')
binding.setVariable('BUILD_NUMBER', '51')
binding.setVariable('ARTIFACT_BUCKET_NAME', bucketName)
helper.registerAllowedMethod('checkout', [Map], {})
helper.addShMock("find ${artifactsPath} | sed -n \"s|^${artifactsPath}/||p\"") { script ->
return [stdout: dummyBuildArtifacts, exitValue: 0]
}
}
@Test
void dataPrepperDistributionArtifacts_builds_consistently() {
super.testPipeline('jenkins/data-prepper/distribution-artifacts.jenkinsfile',
'tests/jenkins/jenkinsjob-regression-files/data-prepper/distribution-artifacts.jenkinsfile')
}
}