Skip to content
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

Add more helpers to pipeline/testing package #19405

Merged
merged 1 commit into from
Jun 30, 2020

Conversation

urso
Copy link

@urso urso commented Jun 25, 2020

  • Enhancement

What does this PR do?

The pipeline/testing package provides some helpers for mocking/faking a
beat.Pipeline or beat.Client. This change adds some more helpers that
can be reused throughout beats.

Why is it important?

I introduced these helpers in the Filebeat v2 input refactoring, to share some common helpers based on the existing ones.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
    - [ ] I have added tests that prove my fix is effective or that my feature works
    - [ ] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Related issues

@urso urso added review libbeat Team:Services (Deprecated) Label for the former Integrations-Services team labels Jun 25, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jun 25, 2020
@urso urso mentioned this pull request Jun 25, 2020
3 tasks
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jun 25, 2020

❕ Build Aborted

Either there was a build timeout or someone aborted the build.'}

Pipeline View Test View Changes Artifacts

Expand to view the summary

Build stats

  • Build Cause: [Branch indexing]

  • Start Time: 2020-06-29T17:28:25.009+0000

  • Duration: 124 min 42 sec

Test stats 🧪

Test Results
Failed 3
Passed 8563
Skipped 1540
Total 10106

Test errors

Expand to view the tests failures

  • Name: Build and Test / Auditbeat oss Mac OS X / TestEventReader – file_integrity

    • Age: 1
    • Duration: 1.23
    • Error Details: Failed
  • Name: Build and Test / Auditbeat oss Mac OS X / TestEventReader/created – file_integrity

    • Age: 1
    • Duration: 1.14
    • Error Details: Failed
  • Name: Build and Test / Auditbeat oss Mac OS X / TestRaces – file_integrity

    • Age: 1
    • Duration: 1.9
    • Error Details: Failed

Steps errors

Expand to view the steps failures

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 1 min 27 sec

    • Start Time: 2020-06-29T19:20:36.965+0000

    • log

  • Name: Notifies GitHub of the status of a Pull Request

    • Description:

    • Duration: 9 min 35 sec

    • Start Time: 2020-06-29T19:22:05.410+0000

    • log

  • Name: Mage build unitTest

    • Description: mage build unitTest

    • Duration: 4 min 8 sec

    • Start Time: 2020-06-29T19:17:56.397+0000

    • log

  • Name: Notifies GitHub of the status of a Pull Request

    • Description:

    • Duration: 8 min 21 sec

    • Start Time: 2020-06-29T19:22:19.623+0000

    • log

  • Name: Notifies GitHub of the status of a Pull Request

    • Description:

    • Duration: 4 min 0 sec

    • Start Time: 2020-06-29T19:26:40.585+0000

    • log

  • Name: Notifies GitHub of the status of a Pull Request

    • Description:

    • Duration: 4 min 49 sec

    • Start Time: 2020-06-29T19:26:51.535+0000

    • log

  • Name: Report to Codecov

    • Description: curl -sSLo codecov https://codecov.io/bash for i in auditbeat filebeat heartbeat libbeat metricbeat packetbeat winlogbeat journalbeat do FILE="${i}/build/coverage/full.cov" if [ -f "${FILE}" ]; then bash codecov -f "${FILE}" fi done

    • Duration: 1 min 27 sec

    • Start Time: 2020-06-29T19:26:33.711+0000

    • log

  • Name: Notifies GitHub of the status of a Pull Request

    • Description:

    • Duration: 3 min 39 sec

    • Start Time: 2020-06-29T19:28:02.183+0000

    • log

Log output

Expand to view the last 100 lines of log output

[2020-06-29T19:31:36.210Z] 	at org.jenkinsci.plugins.workflow.cps.SandboxContinuable.run0(SandboxContinuable.java:51)
[2020-06-29T19:31:36.210Z] 	at org.jenkinsci.plugins.workflow.cps.CpsThread.runNextChunk(CpsThread.java:185)
[2020-06-29T19:31:36.210Z] 	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:400)
[2020-06-29T19:31:36.210Z] 	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$400(CpsThreadGroup.java:96)
[2020-06-29T19:31:36.210Z] 	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:312)
[2020-06-29T19:31:36.210Z] 	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:276)
[2020-06-29T19:31:36.210Z] 	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:67)
[2020-06-29T19:31:36.210Z] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2020-06-29T19:31:36.210Z] 	at hudson.remoting.SingleLaneExecutorService$1.run(SingleLaneExecutorService.java:131)
[2020-06-29T19:31:36.210Z] 	at jenkins.util.ContextResettingExecutorService$1.run(ContextResettingExecutorService.java:28)
[2020-06-29T19:31:36.210Z] 	at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:59)
[2020-06-29T19:31:36.210Z] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[2020-06-29T19:31:36.210Z] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2020-06-29T19:31:36.210Z] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2020-06-29T19:31:36.210Z] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2020-06-29T19:31:36.210Z] 	at java.lang.Thread.run(Thread.java:748)
[2020-06-29T19:31:36.210Z] 
[2020-06-29T19:31:36.343Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Dockerlogbeat
[2020-06-29T19:31:36.692Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Journalbeat-oss
[2020-06-29T19:31:36.873Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-06-29T19:31:37.042Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Functionbeat-x-pack
[2020-06-29T19:31:37.210Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Elastic-Agent-x-pack-Windows
[2020-06-29T19:31:37.420Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-OSS-Unit-tests
[2020-06-29T19:31:37.592Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Auditbeat-x-pack
[2020-06-29T19:31:37.741Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-crosscompile
[2020-06-29T19:31:37.883Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Heartbeat-oss
[2020-06-29T19:31:38.040Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Auditbeat-oss-Windows
[2020-06-29T19:31:38.172Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Libbeat-x-pack
[2020-06-29T19:31:38.315Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Auditbeat-x-pack-Windows
[2020-06-29T19:31:38.434Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Winlogbeat-Windows-x-pack
[2020-06-29T19:31:38.574Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Filebeat-Windows
[2020-06-29T19:31:38.696Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Auditbeat-oss-Linux
[2020-06-29T19:31:38.822Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Filebeat-x-pack-Windows
[2020-06-29T19:31:38.943Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Packetbeat-oss
[2020-06-29T19:31:39.124Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Filebeat-x-pack
[2020-06-29T19:31:39.321Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-x-pack-Windows
[2020-06-29T19:31:39.513Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-Windows
[2020-06-29T19:31:39.689Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Generators-Beat-Linux
[2020-06-29T19:31:39.839Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Filebeat-oss
[2020-06-29T19:31:40.050Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-Python-integration-tests
[2020-06-29T19:31:40.288Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests
[2020-06-29T19:31:40.542Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Libbeat-oss
[2020-06-29T19:31:40.724Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Libbeat-crosscompile
[2020-06-29T19:31:40.966Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Libbeat-stress-tests
[2020-06-29T19:31:41.156Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Winlogbeat-Windows
[2020-06-29T19:31:41.353Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Elastic-Agent-Mac-OS-X
[2020-06-29T19:31:41.633Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Filebeat-x-pack-Mac-OS-X
[2020-06-29T19:31:41.789Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Filebeat-Mac-OS-X
[2020-06-29T19:31:41.952Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Auditbeat-oss-Mac-OS-X
[2020-06-29T19:31:42.101Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-x-pack-Mac-OS-X
[2020-06-29T19:31:42.359Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Auditbeat-x-pack-Mac-OS-X
[2020-06-29T19:31:42.619Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-Mac-OS-X
[2020-06-29T19:31:42.773Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-x-pack
[2020-06-29T19:31:43.209Z] + cat
[2020-06-29T19:31:43.209Z] + /usr/local/bin/runbld ./runbld-script
[2020-06-29T19:31:43.209Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-06-29T19:31:49.850Z] runbld>>> runbld started
[2020-06-29T19:31:49.850Z] runbld>>> 1.6.12/f45d832f2ba0aa2722ab4ec1fda8ad140f027f8b
[2020-06-29T19:31:52.398Z] runbld>>> The following profiles matched the job 'Beats/beats-beats-mbp/PR-19405' in order of occurrence in the config (last value wins).
[2020-06-29T19:31:53.341Z] runbld>>> Debug logging enabled.
[2020-06-29T19:31:53.341Z] runbld>>> Storing result
[2020-06-29T19:31:53.603Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-06-29T19:31:53.603Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200629193153-4E3F7296
[2020-06-29T19:31:53.603Z] runbld>>> Adding system facts.
[2020-06-29T19:31:54.546Z] runbld>>> Adding vcs info for the latest commit:  e3b207eb1c1b0fd63477945ea2d64d8e627091f0
[2020-06-29T19:31:54.546Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-06-29T19:31:54.546Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-06-29T19:31:54.546Z] Processing JUnit reports with runbld...
[2020-06-29T19:31:54.546Z] + echo 'Processing JUnit reports with runbld...'
[2020-06-29T19:31:54.821Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-06-29T19:31:54.821Z] runbld>>> DURATION: 12ms
[2020-06-29T19:31:54.821Z] runbld>>> STDOUT: 40 bytes
[2020-06-29T19:31:54.821Z] runbld>>> STDERR: 49 bytes
[2020-06-29T19:31:54.821Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-06-29T19:31:54.821Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats
[2020-06-29T19:31:56.230Z] runbld>>> Storing build metadata: 
[2020-06-29T19:31:56.230Z] runbld>>> Adding test report.
[2020-06-29T19:31:56.230Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats
[2020-06-29T19:31:56.806Z] runbld>>> Found 98 test output files
[2020-06-29T19:31:57.380Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-graphite.xml
[2020-06-29T19:31:57.642Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-OSS-Integration-tests/metricbeat/build/TEST-go-integration-windows.xml
[2020-06-29T19:31:57.642Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-iis.xml
[2020-06-29T19:31:57.642Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-istio.xml
[2020-06-29T19:31:57.642Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-activemq.xml
[2020-06-29T19:31:57.642Z] runbld>>> No testsuite node found in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405/src/github.com/elastic/beats/Metricbeat-x-pack/x-pack/metricbeat/build/TEST-go-integration-openmetrics.xml
[2020-06-29T19:31:59.031Z] runbld>>> Test output logs contained: Errors: 0 Failures: 3 Tests: 9956 Skipped: 1315
[2020-06-29T19:31:59.031Z] runbld>>> Storing result
[2020-06-29T19:31:59.031Z] runbld>>> FAILURES: 3
[2020-06-29T19:31:59.972Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-06-29T19:31:59.973Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200629193153-4E3F7296
[2020-06-29T19:31:59.973Z] runbld>>> Email notification disabled by environment variable.
[2020-06-29T19:31:59.973Z] runbld>>> Slack notification disabled by environment variable.
[2020-06-29T19:32:05.641Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-19405
[2020-06-29T19:32:05.807Z] [INFO] getVaultSecret: Getting secrets
[2020-06-29T19:32:05.924Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-06-29T19:32:06.785Z] + chmod 755 generate-build-data.sh
[2020-06-29T19:32:06.785Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19405/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19405/runs/7 ABORTED 7421506
[2020-06-29T19:32:06.785Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19405/runs/7/steps/?limit=10000 -o steps-info.json
[2020-06-29T19:32:13.269Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19405/runs/7/tests/?status=FAILED -o tests-errors.json
[2020-06-29T19:32:14.612Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-19405/runs/7/log/ -o pipeline-log.txt

@urso urso added needs_backport PR is waiting to be backported to other branches. v7.9.0 labels Jun 25, 2020
@urso
Copy link
Author

urso commented Jun 26, 2020

jenkins run the tests please

The pipeline/testing package provides some helpers for mocking/faking a
beat.Pipeline or beat.Client. This change adds some more helpers that
can be reused thrughout beats.
@urso urso force-pushed the pipeline-testing-helpers branch from 30f081a to f42a9a2 Compare June 29, 2020 12:25
@urso urso merged commit fac91b3 into elastic:master Jun 30, 2020
@urso urso deleted the pipeline-testing-helpers branch June 30, 2020 11:05
v1v added a commit to v1v/beats that referenced this pull request Jul 2, 2020
…ne-beats

* upstream/master: (105 commits)
  ci: enable packaging job (elastic#19536)
  ci: disable upstream trigger on PRs for the packaging job (elastic#19490)
  Implement memlog on-disk handling (elastic#19408)
  fix go.mod for PR elastic#19423 (elastic#19521)
  [MetricBeat] add param `aws_partition` to support aws-cn, aws-us-gov regions (elastic#19423)
  Input v2 stateless manager (elastic#19406)
  Input v2 compatibility layer (elastic#19401)
  [Elastic Agent] Fix artifact downloading to allow endpoint-security to be downloaded (elastic#19503)
  fix: ignore target changes on scans (elastic#19510)
  Add more helpers to pipeline/testing package (elastic#19405)
  Report dependencies in CSV format (elastic#19506)
  [Filebeat] Fix reference leak in TCP and Unix socket inputs (elastic#19459)
  Cursor input skeleton (elastic#19378)
  Add changelog. (elastic#19495)
  [DOC] Typo in Kerberos (elastic#19265)
  Remove accidentally commited unused NOTICE template (elastic#19485)
  [Elastic Agent] Support the install, control, and uninstall of Endpoint (elastic#19248)
  [Filebeat][httpjson] Add split_events_by config setting (elastic#19246)
  ci: disabling packaging job until we fix it (elastic#19481)
  Fix golang.org/x/tools to release1.13 (elastic#19478)
  ...
@urso urso removed the needs_backport PR is waiting to be backported to other branches. label Jul 7, 2020
urso pushed a commit to urso/beats that referenced this pull request Jul 7, 2020
urso pushed a commit that referenced this pull request Jul 8, 2020
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libbeat review skip-test-plan Team:Services (Deprecated) Label for the former Integrations-Services team v7.9.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants