Skip to content

Conversation

@mrodm
Copy link
Collaborator

@mrodm mrodm commented Oct 3, 2023

Proposed commit message

Add new pipelines to test packages in serverless.
Example of output:

This PR adds a schedule-daily and a integrations-serverless pipelines to test packages with Serverless projects. Tests performed in this script/pipeline:

  • Perform linting and formatting (elastic-package check -v)
  • Try to install the package (elastic-package install)
  • Run all tests except system tests
    • IMPORTANT Pipeline tests do not compare the documents with the sample ones.

This pipeline is different from the one running in Pull Requests:

  • Benchmarks are not triggered/run for now.
  • Coverage reports have not been migrated.
  • All packages are test in the same step using the same Serverless project (Observability or Security). Just one Serverless project is created/started in each step (to test all packages).
    • In Jenkins, using docker-compose locally, there is an step for each package running its own Elastic stack.
  • Artifacts are also saved in an internal bucket as in Jenkins
  • This pipeline does not run system tests
    • They are so time consuming, and to avoid creating more than 200 serverless projects everything is run in the same step.
    • Tests performed:
      • elastic-package check
      • elastic-package install
      • elastic-package test static
      • elastic-package test asset
      • elastic-package test pipeline

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

How to test this PR locally

Related issues

@mrodm mrodm self-assigned this Oct 3, 2023
@mrodm mrodm force-pushed the add_schedule_daily branch from 7733215 to 43d279d Compare October 3, 2023 16:56
@mrodm mrodm force-pushed the add_schedule_daily branch from 43d279d to 554d5a0 Compare October 3, 2023 17:03
@elasticmachine
Copy link

elasticmachine commented Oct 3, 2023

💔 Tests Failed

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-10-26T17:53:07.354+0000

  • Duration: 112 min 59 sec

Test stats 🧪

Test Results
Failed 2
Passed 5055
Skipped 9
Total 5066

Test errors 2

Expand to view the tests failures

Check integrations / entityanalytics_entra_id / entityanalytics_entra_id: check / system test: (elastic-agent logs) – entityanalytics_entra_id.entity
    Expand to view the error details

     null 
    

    Expand to view the stacktrace

     test case failed: one or more errors found while examining elastic-agent.log: [0] found error "Component state changed entity-analytics-default (HEALTHY->DEGRADED): Degraded: pid '280' missed 1 check-in" 
    

Check integrations / sql_input / sql_input: check / system test: mysql – sql_input.
    Expand to view the error details

     null 
    

    Expand to view the stacktrace

     one or more errors found in documents stored in metrics-sql.sql-ep data stream: [0] found error.message in event: could not open connection: testing connection: dial tcp 172.18.0.6:3306: connect: connection refused 
    

Steps errors 4

Expand to view the steps failures

Test integration: dga
  • Took 0 min 6 sec . View more details here
  • Description: eval "$(../../build/elastic-package stack shellinit)" ../../build/elastic-package test -v --report-format xUnit --report-output file --test-coverage
Test integration: entityanalytics_entra_id
  • Took 1 min 22 sec . View more details here
  • Description: eval "$(../../build/elastic-package stack shellinit)" ../../build/elastic-package test -v --report-format xUnit --report-output file --test-coverage
Test integration: sql_input
  • Took 2 min 22 sec . View more details here
  • Description: eval "$(../../build/elastic-package stack shellinit)" ../../build/elastic-package test -v --report-format xUnit --report-output file --test-coverage
Google Storage Download
  • Took 0 min 0 sec . View more details here

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@mrodm mrodm force-pushed the add_schedule_daily branch from 3469da8 to ce9e0f1 Compare October 3, 2023 17:15
@mrodm mrodm force-pushed the add_schedule_daily branch from 9f35c13 to e9af47e Compare October 3, 2023 17:27
@elasticmachine
Copy link

elasticmachine commented Oct 3, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (470/470) 💚
Files 96.163% (802/834) 👍 1.426
Classes 96.163% (802/834) 👍 1.426
Methods 92.11% (7798/8466) 👍 7.261
Lines 88.593% (183950/207635) 👍 2.285
Conditionals 100.0% (0/0) 💚

"pipelineSlug": "integrations",
"allow_org_users": true,
"allowed_repo_permissions": ["admin", "write"],
"allowed_list": ["dependabot[bot]", "mergify[bot]"],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allow dependabot PRs to run buildkite pull requests.

@mrodm mrodm requested a review from jsoriano October 24, 2023 17:28

echo "Checking gsutil command..."
if ! command -v gsutil &> /dev/null ; then
echo "⚠️ gsutil is not installed"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we can add this message to the buildkite annotation, @mrodm WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer just to keep it in the output. I think there is no need to add more information in the annotation for this.

fi

if [ $any_package_failing -eq 1 ] ; then
echo "These packages have failed:"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we can add this message to the buildkite annotation, @mrodm WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed packages are already in one annotation. This is to be also in the log output.

}

is_pr() {
if [ "${BUILDKITE_PULL_REQUEST}" == "false" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if [ "${BUILDKITE_PULL_REQUEST}" == "false" ]; then
if [[ "${BUILDKITE_PULL_REQUEST}" == "false" && "${BUILDKITE_TAG}" == "" ]]; then

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repository is configured to not run builds when pushing tags (catalog.yml) build_tags: false

But to be sure I'll add this (with OR condition):

  • if it is not a PR
  • or, it is a tag
if [[ "${BUILDKITE_PULL_REQUEST}" == "false" || "${BUILDKITE_TAG}" == "" ]]; then

@mrodm mrodm requested a review from sharbuz October 25, 2023 14:06
Copy link
Member

@jsoriano jsoriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mrodm mrodm changed the title [buildkite] Add new Buildkite pipelines to test packages with Serverless WIP [buildkite] Add new Buildkite pipelines to test packages with Serverless Oct 26, 2023
Comment on lines 108 to 113
# env:
# ELASTIC_SLACK_NOTIFICATIONS_ENABLED: 'true'
# # SLACK_NOTIFICATIONS_CHANNEL: '#beats-build' as the current jenkins schedule-daily?
# SLACK_NOTIFICATIONS_CHANNEL: '#ingest-test-notifications' #TODO: will be changed before GO-PROD
# SLACK_NOTIFICATIONS_ALL_BRANCHES: 'true'
# SLACK_NOTIFICATIONS_ON_SUCCESS: 'true'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can enable it and use out test channel for tests: #ingest-test-notifications
WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok! I'll uncomment those lines

Copy link
Contributor

@sharbuz sharbuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks!

@mrodm
Copy link
Collaborator Author

mrodm commented Oct 27, 2023

Merging since failures in the Jenkins CI job are unrelated to this change.

@mrodm mrodm merged commit ab11988 into elastic:main Oct 27, 2023
@mrodm mrodm deleted the add_schedule_daily branch October 27, 2023 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automate tests in CI for serverless packages

4 participants