From d9e1e0e64abf5bf96eae1c332d6466b92fe3bdd6 Mon Sep 17 00:00:00 2001 From: Zelin Hao Date: Tue, 7 Jan 2025 13:38:13 -0800 Subject: [PATCH] Remove unneccessary stash Signed-off-by: Zelin Hao --- jenkins/opensearch/smoke-test.jenkinsfile | 21 ++++++------- tests/jenkins/TestSmokeTest.groovy | 2 +- .../opensearch/smoke-test.jenkinsfile.txt | 31 +++++++++---------- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/jenkins/opensearch/smoke-test.jenkinsfile b/jenkins/opensearch/smoke-test.jenkinsfile index 77bfd13b0a..3ec64256ef 100644 --- a/jenkins/opensearch/smoke-test.jenkinsfile +++ b/jenkins/opensearch/smoke-test.jenkinsfile @@ -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", diff --git a/tests/jenkins/TestSmokeTest.groovy b/tests/jenkins/TestSmokeTest.groovy index 80ed53c5d3..de90df50ac 100644 --- a/tests/jenkins/TestSmokeTest.groovy +++ b/tests/jenkins/TestSmokeTest.groovy @@ -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']]) diff --git a/tests/jenkins/jenkinsjob-regression-files/opensearch/smoke-test.jenkinsfile.txt b/tests/jenkins/jenkinsjob-regression-files/opensearch/smoke-test.jenkinsfile.txt index 6f58aed97c..8d66db2b40 100644 --- a/tests/jenkins/jenkinsjob-regression-files/opensearch/smoke-test.jenkinsfile.txt +++ b/tests/jenkins/jenkinsjob-regression-files/opensearch/smoke-test.jenkinsfile.txt @@ -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}) @@ -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)