Skip to content

Commit

Permalink
Remove unneccessary stash
Browse files Browse the repository at this point in the history
Signed-off-by: Zelin Hao <[email protected]>
  • Loading branch information
zelinh committed Jan 7, 2025
1 parent c041911 commit d9e1e0e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 28 deletions.
21 changes: 10 additions & 11 deletions jenkins/opensearch/smoke-test.jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,24 @@ pipeline {
agent { label AGENT_LABEL }
steps {
script {
downloadBuildManifest(
url: BUILD_MANIFEST_URL,
path: BUILD_MANIFEST
)

def buildManifestObj = lib.jenkins.BuildManifest.new(readYaml(file: BUILD_MANIFEST))
def testManifestObj = lib.jenkins.TestManifest.new(readYaml(file: "manifests/${TEST_MANIFEST}"))
currentBuild.description = "$TEST_MANIFEST, $version, $architecture, $platform, $buildId, $distribution"

// Stash the current working directory files, aka opensearch-build repo
stash includes: '**', name: "smoketest-opensearch-$BUILD_NUMBER"

timeout(time: 1, unit: 'HOURS') {
node(AGENT_LABEL) {
docker.withRegistry('https://public.ecr.aws/') {
docker.image(docker_images["$distribution"]).inside(docker_args["$distribution"]) {
try {
stage("Smoke_tests") {
unstash "smoketest-opensearch-$BUILD_NUMBER"
checkout scm
sleep 20
downloadBuildManifest(
url: BUILD_MANIFEST_URL,
path: BUILD_MANIFEST
)

def buildManifestObj = lib.jenkins.BuildManifest.new(readYaml(file: BUILD_MANIFEST))
def testManifestObj = lib.jenkins.TestManifest.new(readYaml(file: "manifests/${TEST_MANIFEST}"))

sh('rm -rf test-results')
runSmokeTestScript(
jobName: "$BUILD_JOB_NAME",
Expand Down
2 changes: 1 addition & 1 deletion tests/jenkins/TestSmokeTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TestSmokeTest extends BuildPipelineTest {
def jobName = "dummy_job"
def testManifest = "tests/jenkins/data/opensearch-2.19.0-test.yml"
def buildManifest = "tests/jenkins/data/opensearch-2.19.0-build.yml"
def buildManifestUrl = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.0/10545/linux/x64/tar/dist/opensearch/opensearch-2.19.0-linux-x64.tar.gz"
def buildManifestUrl = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.0/10545/linux/x64/tar/builds/opensearch/manifest.yml"
def agentLabel = "Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host"

binding.setVariable('env', ['BUILD_NUMBER': '234', 'PUBLIC_ARTIFACT_URL': 'DUMMY_PUBLIC_ARTIFACT_URL', 'JOB_NAME': 'dummy_job', 'DOCKER_AGENT':[image:'opensearchstaging/ci-runner:ci-runner-centos7-v1', args:'-e JAVA_HOME=/opt/java/openjdk-11']])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
smoke-test.echo(Executing on agent [label:Jenkins-Agent-AL2023-X64-M54xlarge-Docker-Host])
smoke-test.script(groovy.lang.Closure)
smoke-test.fileExists(manifests/tests/jenkins/data/opensearch-2.19.0-test.yml)
smoke-test.downloadBuildManifest({url=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.0/10545/linux/x64/tar/dist/opensearch/opensearch-2.19.0-linux-x64.tar.gz, path=tests/jenkins/data/opensearch-2.19.0-build.yml})
smoke-test.downloadBuildManifest({url=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.0/10545/linux/x64/tar/builds/opensearch/manifest.yml, path=tests/jenkins/data/opensearch-2.19.0-build.yml})
downloadBuildManifest.legacySCM(groovy.lang.Closure)
downloadBuildManifest.library({identifier=jenkins@main, retriever=null})
downloadBuildManifest.sh(mkdir -p $(dirname "tests/jenkins/data/opensearch-2.19.0-build.yml"))
downloadBuildManifest.sh(touch tests/jenkins/data/opensearch-2.19.0-build.yml)
downloadBuildManifest.sh(curl -sSL --retry 5 https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.0/10545/linux/x64/tar/dist/opensearch/opensearch-2.19.0-linux-x64.tar.gz --output tests/jenkins/data/opensearch-2.19.0-build.yml)
downloadBuildManifest.sh(curl -sSL --retry 5 https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.0/10545/linux/x64/tar/builds/opensearch/manifest.yml --output tests/jenkins/data/opensearch-2.19.0-build.yml)
downloadBuildManifest.readYaml({file=tests/jenkins/data/opensearch-2.19.0-build.yml})
BuildManifest.asBoolean()
smoke-test.readYaml({file=tests/jenkins/data/opensearch-2.19.0-build.yml})
Expand All @@ -30,22 +30,21 @@
smoke-test.stage(smoke-test, groovy.lang.Closure)
smoke-test.echo(Executing on agent [label:Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host])
smoke-test.script(groovy.lang.Closure)
smoke-test.downloadBuildManifest({url=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.0/10545/linux/x64/tar/dist/opensearch/opensearch-2.19.0-linux-x64.tar.gz, path=tests/jenkins/data/opensearch-2.19.0-build.yml})
downloadBuildManifest.legacySCM(groovy.lang.Closure)
downloadBuildManifest.library({identifier=jenkins@main, retriever=null})
downloadBuildManifest.sh(mkdir -p $(dirname "tests/jenkins/data/opensearch-2.19.0-build.yml"))
downloadBuildManifest.sh(touch tests/jenkins/data/opensearch-2.19.0-build.yml)
downloadBuildManifest.sh(curl -sSL --retry 5 https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.0/10545/linux/x64/tar/dist/opensearch/opensearch-2.19.0-linux-x64.tar.gz --output tests/jenkins/data/opensearch-2.19.0-build.yml)
downloadBuildManifest.readYaml({file=tests/jenkins/data/opensearch-2.19.0-build.yml})
BuildManifest.asBoolean()
smoke-test.readYaml({file=tests/jenkins/data/opensearch-2.19.0-build.yml})
BuildManifest.asBoolean()
smoke-test.readYaml({file=manifests/tests/jenkins/data/opensearch-2.19.0-test.yml})
TestManifest.asBoolean()
smoke-test.stash({includes=**, name=smoketest-opensearch-234})
smoke-test.timeout({time=1, unit=HOURS}, groovy.lang.Closure)
smoke-test.node(Jenkins-Agent-AL2-X64-C54xlarge-Docker-Host, groovy.lang.Closure)
smoke-test.unstash(smoketest-opensearch-234)
smoke-test.checkout(groovy.lang.Closure)
smoke-test.downloadBuildManifest({url=https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.0/10545/linux/x64/tar/builds/opensearch/manifest.yml, path=tests/jenkins/data/opensearch-2.19.0-build.yml})
downloadBuildManifest.legacySCM(groovy.lang.Closure)
downloadBuildManifest.library({identifier=jenkins@main, retriever=null})
downloadBuildManifest.sh(mkdir -p $(dirname "tests/jenkins/data/opensearch-2.19.0-build.yml"))
downloadBuildManifest.sh(touch tests/jenkins/data/opensearch-2.19.0-build.yml)
downloadBuildManifest.sh(curl -sSL --retry 5 https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/2.19.0/10545/linux/x64/tar/builds/opensearch/manifest.yml --output tests/jenkins/data/opensearch-2.19.0-build.yml)
downloadBuildManifest.readYaml({file=tests/jenkins/data/opensearch-2.19.0-build.yml})
BuildManifest.asBoolean()
smoke-test.readYaml({file=tests/jenkins/data/opensearch-2.19.0-build.yml})
BuildManifest.asBoolean()
smoke-test.readYaml({file=manifests/tests/jenkins/data/opensearch-2.19.0-test.yml})
TestManifest.asBoolean()
smoke-test.sh(rm -rf test-results)
smoke-test.runSmokeTestScript({jobName=dummy_job, buildManifest=tests/jenkins/data/opensearch-2.19.0-build.yml, testManifest=manifests/tests/jenkins/data/opensearch-2.19.0-test.yml, buildId=10545})
runSmokeTestScript.legacySCM(groovy.lang.Closure)
Expand Down

0 comments on commit d9e1e0e

Please sign in to comment.