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.
Signed-off-by: Sayali Gaikawad <gaiksaya@amazon.com>
- Loading branch information
Showing
5 changed files
with
300 additions
and
13 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,98 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* 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 | ||
import static com.lesfurets.jenkins.unit.global.lib.LibraryConfiguration.library | ||
import static com.lesfurets.jenkins.unit.global.lib.GitSource.gitSource | ||
import static com.lesfurets.jenkins.unit.MethodCall.callArgsToString | ||
import static org.assertj.core.api.Assertions.assertThat | ||
import static org.hamcrest.CoreMatchers.hasItem | ||
import static org.hamcrest.CoreMatchers.hasItems | ||
import org.yaml.snakeyaml.Yaml | ||
|
||
|
||
class TestReleaseTag extends BuildPipelineTest { | ||
|
||
@Override | ||
@Before | ||
void setUp() { | ||
String releaseVersion = '2.16.0' | ||
|
||
helper.registerSharedLibrary( | ||
library().name('jenkins') | ||
.defaultVersion('1.0.4') | ||
.allowOverride(true) | ||
.implicit(true) | ||
.targetPath('vars') | ||
.retriever(gitSource('https://github.com/opensearch-project/opensearch-build-libraries.git')) | ||
.build() | ||
) | ||
super.setUp() | ||
addParam('VERSION', releaseVersion) | ||
binding.setVariable('GITHUB_BOT_TOKEN_NAME', 'github_bot_token_name') | ||
binding.setVariable('env', [ | ||
'VERSION': releaseVersion, | ||
'OS_DISTRIBUTION_MANIFEST': 'opensearch-2.16.0/manifest.yml', | ||
'OSD_DISTRIBUTION_MANIFEST': 'opensearch-dashboards-2.16.0/manifest.yml' | ||
]) | ||
helper.registerAllowedMethod('readYaml', [Map.class], { args -> | ||
if (args.file == 'opensearch-2.16.0/manifest.yml') { | ||
return new Yaml().load(('tests/jenkins/data/opensearch-dist-2.16.0.yml' as File).text) | ||
} else if (args.file == 'opensearch-dashboards-2.16.0/manifest.yml') { | ||
return new Yaml().load(('tests/jenkins/data/opensearch-dashboards-dist-2.16.0.yml' as File).text) | ||
} | ||
}) | ||
helper.addShMock("git ls-remote --tags https://github.com/opensearch-project/security.git 2.16.0.0 | awk 'NR==1{print \$1}'") { script -> | ||
return [stdout: '30760168263404e628a25fd13a54100d2610810c', exitValue: 0] | ||
} | ||
helper.addShMock("git ls-remote --tags https://github.com/opensearch-project/job-scheduler.git 2.16.0.0 | awk 'NR==1{print \$1}'") { script -> | ||
return [stdout: 'b36f79336db82fd45db5665a5ac2e9368f0a1cdf', exitValue: 0] | ||
} | ||
helper.addShMock("git ls-remote --tags https://github.com/opensearch-project/k-NN.git 2.16.0.0 | awk 'NR==1{print \$1}'") { script -> | ||
return [stdout: 'c8ec49f1e2c9603498ca679727a499dc0b296e26', exitValue: 0] | ||
} | ||
helper.addShMock("git ls-remote --tags https://github.com/opensearch-project/common-utils.git 2.16.0.0 | awk 'NR==1{print \$1}'") { script -> | ||
return [stdout: 'cbc06a5eafe0009edbb2c865d7cd30262d04e502', exitValue: 0] | ||
} | ||
helper.addShMock("git ls-remote --tags https://github.com/opensearch-project/OpenSearch.git 2.16.0 | awk 'NR==1{print \$1}'") { script -> | ||
return [stdout: 'f84a26e76807ea67a69822c37b1a1d89e7177d9b', exitValue: 0] | ||
} | ||
helper.addShMock("git ls-remote --tags https://github.com/opensearch-project/dashboards-visualizations.git 2.16.0.0 | awk 'NR==1{print \$1}'") { script -> | ||
return [stdout: '5e86965658791648fad9d0fc573e470c59cce674', exitValue: 0] | ||
} | ||
helper.addShMock("git ls-remote --tags https://github.com/opensearch-project/OpenSearch-Dashboards.git 2.16.0 | awk 'NR==1{print \$1}'") { script -> | ||
return [stdout: '4b8826e7ffa6562825ca8aad676a8d89983c2d70', exitValue: 0] | ||
} | ||
helper.addShMock("git ls-remote --tags https://github.com/opensearch-project/opensearch-dashboards-functional-test.git 2.16.0 | awk 'NR==1{print \$1}'") { script -> | ||
return [stdout: '7c5e0482b844828cf2aec3b63841bd5d336d5668', exitValue: 0] | ||
} | ||
helper.addShMock("git ls-remote --tags https://github.com/opensearch-project/dashboards-reporting.git 2.16.0.0 | awk 'NR==1{print \$1}'") { script -> | ||
return [stdout: '49057e4f82b0390dc28d0e08009ec5f892d7af1a', exitValue: 0] | ||
} | ||
helper.addShMock("git ls-remote --tags https://github.com/opensearch-project/dashboards-observability.git 2.16.0.0 | awk 'NR==1{print \$1}'") { script -> | ||
return [stdout: '24d368e882ec01ff98e556725b84e332d4ab825e', exitValue: 0] | ||
} | ||
} | ||
@Test | ||
public void checkTagCreation() { | ||
super.testPipeline("jenkins/release-workflows/release-tag.jenkinsfile", | ||
"tests/jenkins/jenkinsjob-regression-files/release-workflows/release-tag.jenkinsfile") | ||
assertJobStatusSuccess() | ||
} | ||
|
||
@Test | ||
public void testManifestLock(){ | ||
runScript('jenkins/release-workflows/release-tag.jenkinsfile') | ||
assertCallStack().contains('release-tag.stage(Lock Manifests to tags, groovy.lang.Closure', | ||
'release-tag.string({name=RELEASE_VERSION, value=2.16.0})', | ||
'release-tag.string({name=MANIFEST_LOCK_ACTION, value=UPDATE_TO_TAGS})', | ||
'release-tag.build({job=release-manifest-commit-lock, wait=true, parameters=[null, null]})') | ||
} | ||
} |
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,35 @@ | ||
--- | ||
schema-version: '1.1' | ||
build: | ||
name: OpenSearch Dashboards | ||
version: 2.16.0 | ||
platform: linux | ||
architecture: x64 | ||
distribution: tar | ||
location: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.16.0/7858/linux/x64/tar/dist/opensearch-dashboards/opensearch-dashboards-2.16.0-linux-x64.tar.gz | ||
id: '7858' | ||
components: | ||
- name: OpenSearch-Dashboards | ||
repository: https://github.com/opensearch-project/OpenSearch-Dashboards.git | ||
ref: 4b8826e7ffa6562825ca8aad676a8d89983c2d70 | ||
commit_id: 4b8826e7ffa6562825ca8aad676a8d89983c2d70 | ||
location: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.16.0/7858/linux/x64/tar/builds/opensearch-dashboards/dist/opensearch-dashboards-min-2.16.0-linux-x64.tar.gz | ||
- name: functionalTestDashboards | ||
repository: https://github.com/opensearch-project/opensearch-dashboards-functional-test.git | ||
ref: '2.16' | ||
commit_id: 7c5e0482b844828cf2aec3b63841bd5d336d5668 | ||
- name: observabilityDashboards | ||
repository: https://github.com/opensearch-project/dashboards-observability.git | ||
ref: 24d368e882ec01ff98e556725b84e332d4ab825e | ||
commit_id: 24d368e882ec01ff98e556725b84e332d4ab825e | ||
location: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.16.0/7858/linux/x64/tar/builds/opensearch-dashboards/plugins/observabilityDashboards-2.16.0.zip | ||
- name: reportsDashboards | ||
repository: https://github.com/opensearch-project/dashboards-reporting.git | ||
ref: 49057e4f82b0390dc28d0e08009ec5f892d7af1a | ||
commit_id: 49057e4f82b0390dc28d0e08009ec5f892d7af1a | ||
location: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.16.0/7858/linux/x64/tar/builds/opensearch-dashboards/plugins/reportsDashboards-2.16.0.zip | ||
- name: ganttChartDashboards | ||
repository: https://github.com/opensearch-project/dashboards-visualizations.git | ||
ref: 5e86965658791648fad9d0fc573e470c59cce674 | ||
commit_id: 5e86965658791648fad9d0fc573e470c59cce674 | ||
location: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch-dashboards/2.16.0/7858/linux/x64/tar/builds/opensearch-dashboards/plugins/ganttChartDashboards-2.16.0.zip | ||
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,35 @@ | ||
--- | ||
schema-version: '1.1' | ||
build: | ||
name: OpenSearch | ||
version: 2.16.0 | ||
platform: linux | ||
architecture: x64 | ||
distribution: tar | ||
location: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.16.0/10154/linux/x64/tar/dist/opensearch/opensearch-2.16.0-linux-x64.tar.gz | ||
id: '10154' | ||
components: | ||
- name: OpenSearch | ||
repository: https://github.com/opensearch-project/OpenSearch.git | ||
ref: f84a26e76807ea67a69822c37b1a1d89e7177d9b | ||
commit_id: f84a26e76807ea67a69822c37b1a1d89e7177d9b | ||
location: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.16.0/10154/linux/x64/tar/builds/opensearch/dist/opensearch-min-2.16.0-linux-x64.tar.gz | ||
- name: common-utils | ||
repository: https://github.com/opensearch-project/common-utils.git | ||
ref: cbc06a5eafe0009edbb2c865d7cd30262d04e502 | ||
commit_id: cbc06a5eafe0009edbb2c865d7cd30262d04e502 | ||
- name: job-scheduler | ||
repository: https://github.com/opensearch-project/job-scheduler.git | ||
ref: b36f79336db82fd45db5665a5ac2e9368f0a1cdf | ||
commit_id: b36f79336db82fd45db5665a5ac2e9368f0a1cdf | ||
location: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.16.0/10154/linux/x64/tar/builds/opensearch/plugins/opensearch-job-scheduler-2.16.0.0.zip | ||
- name: security | ||
repository: https://github.com/opensearch-project/security.git | ||
ref: 30760168263404e628a25fd13a54100d2610810c | ||
commit_id: 30760168263404e628a25fd13a54100d2610810c | ||
location: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.16.0/10154/linux/x64/tar/builds/opensearch/plugins/opensearch-security-2.16.0.0.zip | ||
- name: k-NN | ||
repository: https://github.com/opensearch-project/k-NN.git | ||
ref: c8ec49f1e2c9603498ca679727a499dc0b296e26 | ||
commit_id: c8ec49f1e2c9603498ca679727a499dc0b296e26 | ||
location: https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.16.0/10154/linux/x64/tar/builds/opensearch/plugins/opensearch-knn-2.16.0.0.zip |
Oops, something went wrong.