-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add a new step to run the e2e tests for certain parts of Beats #21100
Changes from 4 commits
8374b73
feebd7b
7954ecd
dbab960
ccfff57
5538991
531833b
ada4771
89fb374
f5d8615
56d8593
f031bc2
7c8bc9c
04b787b
8442279
132de4b
b6e34d2
93ddff7
7be604f
de2445b
1271296
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,6 +118,7 @@ pipeline { | |
deleteDir() | ||
release() | ||
pushCIDockerImages() | ||
runE2ETestForPackages() | ||
} | ||
} | ||
} | ||
|
@@ -209,6 +210,31 @@ def tagAndPush(name){ | |
} | ||
} | ||
|
||
def runE2ETestForPackages(){ | ||
def slackChannel = 'ingest-management' | ||
|
||
catchError(buildResult: 'UNSTABLE', message: 'Unable to run e2e tests', stageResult: 'FAILURE') { | ||
if ("${env.BEATS_FOLDER}" == "filebeat") { | ||
echo('Triggering E2E tests for filebeat-oss. Test suite: helm:filebeat & ingest-manager') | ||
//triggerE2ETests('helm', slackChannel) | ||
triggerE2ETests('ingest-manager', slackChannel) | ||
} else if ("${env.BEATS_FOLDER}" == "metricbeat"){ | ||
echo('Triggering E2E tests for metricbeat-oss. Test suite: helm:metricbeat && ingest-manager && metricbeat') | ||
triggerE2ETests('all', slackChannel) | ||
} else if ("${env.BEATS_FOLDER}" == "x-pack/elastic-agent") { | ||
echo('Triggering E2E tests for elastic-agent. Test suite: ingest-manager') | ||
triggerE2ETests('ingest-manager', slackChannel) | ||
} else if ("${env.BEATS_FOLDER}" == "x-pack/filebeat"){ | ||
echo('Triggering E2E tests for filebeat. Test suite: helm:filebeat & ingest-manager') | ||
//triggerE2ETests('helm', slackChannel) | ||
triggerE2ETests('ingest-manager', slackChannel) | ||
} else if ("${env.BEATS_FOLDER}" == "x-pack/metricbeat"){ | ||
echo('Triggering E2E tests for metricbeat. Test suite: helm:metricbeat && ingest-manager && metricbeat') | ||
triggerE2ETests('all', slackChannel) | ||
} | ||
} | ||
} | ||
|
||
def release(){ | ||
withBeatsEnv(){ | ||
dir("${env.BEATS_FOLDER}") { | ||
|
@@ -218,6 +244,22 @@ def release(){ | |
} | ||
} | ||
|
||
def triggerE2ETests(String suite, String channel) { | ||
build(job: "../../e2e-tests/e2e-testing-mbp/${env.JOB_BASE_NAME}", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @elastic/observablt-robots how do we build the relative path here? I tried with and without the dots, without success. See error here: https://beats-ci.elastic.co/job/Beats/job/packaging/job/PR-21100/6/console There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess thee JOB_BASE_NAME does not match any of the jobs in the MBP: It might work for branches but for testing this PR it might not work since they are different git projects. Maybe you would like to use the target branch env variable (see You can use
mdelapenya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
parameters: [ | ||
booleanParam(name: 'forceSkipGitChecks', value: true), | ||
booleanParam(name: 'forceSkipPresubmit', value: true), | ||
booleanParam(name: 'notifyOnGreenBuilds', value: !isPR()), | ||
booleanParam(name: 'ELASTIC_AGENT_USE_CI_SNAPSHOTS', value: true), | ||
string(name: 'ELASTIC_AGENT_VERSION', value: "pr-${env.CHANGE_ID}"), | ||
string(name: 'runTestsSuite', value: suite), | ||
string(name: 'SLACK_CHANNEL', value: channel), | ||
], | ||
propagate: false, | ||
wait: false | ||
) | ||
} | ||
|
||
def withMacOSEnv(Closure body){ | ||
withEnvMask( vars: [ | ||
[var: "KEYCHAIN_PASS", password: getVaultSecret(secret: "secret/jenkins-ci/macos-codesign-keychain").data.password], | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are running the tests too early. Let me explain: as we are building different projects in parallel (i.e. metricbeat and filebeat) it could be possible that if the filebeat build is faster, then it reaches the e2e tests stage when the filebeat one has not created its artifacts. Therefore the e2e tests could potentially fail.
I could see it valid to run the e2e tests right after the release stage, so we ensure all artifacts are there. On the other hand, the tests won't be run until the slowest build hadn't finished.
As we discussed, it could be great to decide what to build in an earlier stage, something like prepareBuildContext or similar, where we calculate what to build to be tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the step pushCIDockerImages() is finish the packages are generated and deployed, I not get your concern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, the
pushCIDockerImages
method is executed per BEATS_FOLDER, so in the context ofBEATS_FOLDER=filebeat
it will push the images for filebeat, only. And maybe we want to test the metricbeat ones too (i.e. elastic-agent starting both processes)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is part of the dependencies of the elastic agent, What are the conditions that define if we have to test Filebeat, Metricbeat, or both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If those are direct dependencies then
beats/Jenkinsfile
Lines 1364 to 1381 in d2a8922
Otherwise, where those dependencies are defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think they are defined yet. I did a best effort here: elastic/e2e-testing#309 (comment)