-
Notifications
You must be signed in to change notification settings - Fork 119
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
[Buildkite] Add pipeline to test with Elastic serverless daily #1807
Conversation
55a3292
to
0183caa
Compare
Move workspace and tmp folder vars to pre-command hook Use path to elastic-package binary in pre-exit hook. PATH variable does not keep the value from the pipeline step.
bf0fe3d
to
96cbd80
Compare
Triggered serverless pipeline: https://buildkite.com/elastic/elastic-package/builds/2999 |
7cb77a5
to
6469336
Compare
@@ -68,13 +71,15 @@ if [ "${PACKAGE_TEST_TYPE:-other}" == "with-logstash" ]; then | |||
echo "stack.logstash_enabled: true" >> ~/.elastic-package/profiles/logstash/config.yml | |||
fi | |||
|
|||
# Update the stack | |||
elastic-package stack update -v | |||
if [[ "${SERVERLESS}" != "true" ]]; then |
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.
When testing with Serverless, Elastic stack is just started once at the beginning of the pipeline step. That's why here it is skipped.
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.
Could we also add a comment here mentioning this?
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.
Or maybe we can extract the common logic to check packages, and follow the same approach as in serverless in all targets? For a future refactor in any case.
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.
Added a comment for now in this script, here and also in the cleanup
function.
if [[ "${BUILDKITE_PULL_REQUEST}" != "false" ]]; then | ||
echo "--- install gh cli" | ||
with_github_cli | ||
|
||
add_pr_comment "${BUILDKITE_PULL_REQUEST}" "${BUILDKITE_BUILD_URL}" | ||
fi |
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.
Add a comment in case it is triggered with a Github comment.
Example:
#1807 (comment)
@@ -78,57 +73,37 @@ if [[ "${TARGET}" == "" ]]; then | |||
exit 1 | |||
fi | |||
|
|||
google_cloud_auth_safe_logs() { |
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.
Moved these functions to .buildkite/scripts/tooling.sh
.buildkite/pipeline.serverless.yml
Outdated
cpu: "8" | ||
memory: "4G" | ||
|
||
- label: ":go: :linux: Run unit tests" |
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.
Skipped in this pipeline windows tests. They should already be run by the PR pipeline or by the push to the main branch.
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.
Umm, and do we need any unit tests here? 🤔 We could run only the integration tests for serverless.
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.
Ok, I'll remove this too 👍
These unit tests are going to be run in each PR , so it's not needed.
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.
Do you mean to remove also the step related to make check-static
? @jsoriano
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.
Yep, we could also remove this step if we are not going to use them to block the execution of integration tests.
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 would keep check-static
step, that will ensure that elastic-package
can be compiled without errors.
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.
Yep, we could also remove this step if we are not going to use them to block the execution of integration tests.
The script that starts the Elastic serverless project already performs a make install
command https://github.com/elastic/elastic-package/pull/1807/files#diff-6b482aae5cb3ce434c95fe0f9238d6c8ed14a602031d6473ae03373f78ea937fR52
If there is any error there, that script should fail. So there should not be needed to keep check-static
step.
I'll remove that step too.
"build_on_comment": true, | ||
"trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:test)\\W+(?:serverless))$", | ||
"always_trigger_comment_regex": "^(?:(?:buildkite\\W+)?(?:test)\\W+(?:serverless))$", |
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.
Allow to trigger this pipeline on demand by adding a comment in the Pull Request.
.buildkite/pipeline.serverless.yml
Outdated
cpu: "8" | ||
memory: "4G" | ||
|
||
- label: ":go: :linux: Run unit tests" |
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.
Umm, and do we need any unit tests here? 🤔 We could run only the integration tests for serverless.
.buildkite/pipeline.serverless.yml
Outdated
memory: "4G" | ||
|
||
- wait: ~ | ||
continue_on_failure: true |
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.
Or if we keep the static and unit tests, maybe we can use them to gate if we continue with integration tests? So if static or unit tests fail, we fail fast and don't continue with the integration tests.
continue_on_failure: true | |
continue_on_failure: false |
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.
It is required to set continue_on_failure
as true, in order to process the XML files from JUnit in the last step.
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.
Would it be possible to process the junit files for unit tests without executing the step with integration tests?
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.
Not sure if there would be any issue with that.
It could be added a new step to just process the junit files from those two steps.
But we would need to keep the latest step to process the junit files from the integration steps, and that would re-process those junit files.
In any case, as discussed in the other thread, both static and unit tests/steps have been removed from the pipeline.
echo "Waiting time to avoid getaddrinfo ENOTFOUND errors..." | ||
sleep 120 | ||
echo "Done." |
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.
Could we do some active wait here?
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 based on the script run in the integrations repository. At least a few months ago, there were some errors even if elastic-package does an active wait to report as initialized the project.
Probably, we could try here in this pipeline to remove this sleep
and check if it works. WDYT @jsoriano ?
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.
As you prefer, we can also leave this for a future change.
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.
Ok. so then I'll keep it for now, and we can test to remove it later.
.buildkite/scripts/tooling.sh
Outdated
# Currently, if STACK_VERSION is not defined, for serverless it will be | ||
# used as Elastic stack version (for agents) the default version in elastic-package |
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.
Nit. Move this comment closer to elastic-package stack up
?
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.
Done.
@@ -68,13 +71,15 @@ if [ "${PACKAGE_TEST_TYPE:-other}" == "with-logstash" ]; then | |||
echo "stack.logstash_enabled: true" >> ~/.elastic-package/profiles/logstash/config.yml | |||
fi | |||
|
|||
# Update the stack | |||
elastic-package stack update -v | |||
if [[ "${SERVERLESS}" != "true" ]]; then |
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.
Could we also add a comment here mentioning this?
@@ -68,13 +71,15 @@ if [ "${PACKAGE_TEST_TYPE:-other}" == "with-logstash" ]; then | |||
echo "stack.logstash_enabled: true" >> ~/.elastic-package/profiles/logstash/config.yml | |||
fi | |||
|
|||
# Update the stack | |||
elastic-package stack update -v | |||
if [[ "${SERVERLESS}" != "true" ]]; then |
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.
Or maybe we can extract the common logic to check packages, and follow the same approach as in serverless in all targets? For a future refactor in any case.
💚 Build Succeeded
History
cc @mrodm |
Closes #1656
Add a new pipeline to test
elastic-package
using the Elastic tack from a Serverless project (by default observability project). For that:test/packages/parallel
test serverless
: to be validated once this PR is mergedExample of build running Serverless step: