Skip to content

Commit

Permalink
[E2E Tests] fix: set versions ony for PRs (elastic#21608)
Browse files Browse the repository at this point in the history
* fix: set versions ony for PRs

We want to use default versions per branch when running after a merge

* fix: add trailing comma

Co-authored-by: Victor Martinez <[email protected]>

Co-authored-by: Victor Martinez <[email protected]>
  • Loading branch information
mdelapenya and v1v committed Oct 22, 2020
1 parent dbb8f14 commit 9df335e
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions .ci/packaging.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,25 @@ def triggerE2ETests(String suite) {

def branchName = isPR() ? "${env.CHANGE_TARGET}" : "${env.JOB_BASE_NAME}"
def e2eTestsPipeline = "e2e-tests/e2e-testing-mbp/${branchName}"

def parameters = [
booleanParam(name: 'forceSkipGitChecks', value: true),
booleanParam(name: 'forceSkipPresubmit', value: true),
booleanParam(name: 'notifyOnGreenBuilds', value: !isPR()),
string(name: 'runTestsSuites', value: suite),
string(name: 'GITHUB_CHECK_NAME', value: env.GITHUB_CHECK_E2E_TESTS_NAME),
string(name: 'GITHUB_CHECK_REPO', value: env.REPO),
string(name: 'GITHUB_CHECK_SHA1', value: env.GIT_BASE_COMMIT),
]
if (isPR()) {
def version = "pr-${env.CHANGE_ID}"
parameters.push(booleanParam(name: 'USE_CI_SNAPSHOTS', value: true))
parameters.push(string(name: 'ELASTIC_AGENT_VERSION', value: "${version}"))
parameters.push(string(name: 'METRICBEAT_VERSION', value: "${version}"))
}

build(job: "${e2eTestsPipeline}",
parameters: [
booleanParam(name: 'forceSkipGitChecks', value: true),
booleanParam(name: 'forceSkipPresubmit', value: true),
booleanParam(name: 'notifyOnGreenBuilds', value: !isPR()),
booleanParam(name: 'USE_CI_SNAPSHOTS', value: true),
string(name: 'ELASTIC_AGENT_VERSION', value: "pr-${env.CHANGE_ID}"),
string(name: 'METRICBEAT_VERSION', value: "pr-${env.CHANGE_ID}"),
string(name: 'runTestsSuites', value: suite),
string(name: 'GITHUB_CHECK_NAME', value: env.GITHUB_CHECK_E2E_TESTS_NAME),
string(name: 'GITHUB_CHECK_REPO', value: env.REPO),
string(name: 'GITHUB_CHECK_SHA1', value: env.GIT_BASE_COMMIT),
],
parameters: parameters,
propagate: false,
wait: false
)
Expand Down

0 comments on commit 9df335e

Please sign in to comment.