Skip to content

Cherry-pick #18086 to 7.x: Fix metricbeat generator test to use mage test#18208

Merged
blakerouse merged 1 commit intoelastic:7.xfrom
blakerouse:backport_18086_7.x
May 5, 2020
Merged

Cherry-pick #18086 to 7.x: Fix metricbeat generator test to use mage test#18208
blakerouse merged 1 commit intoelastic:7.xfrom
blakerouse:backport_18086_7.x

Conversation

@blakerouse
Copy link
Copy Markdown
Contributor

@blakerouse blakerouse commented May 4, 2020

Cherry-pick of PR #18086 to 7.x branch. Original message:

What does this PR do?

Updates the generated custom metricbeat to use mage test instead of make unit.

Why is it important?

So the generator tests pass.

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.

* Use mage unit-test.

* Should be make.

* Update mage test.

* Add PackageKibanaDashboardsFromBuildDir.

(cherry picked from commit 9e7321a)
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label May 4, 2020
@blakerouse blakerouse added the Team:Platforms Label for the Integrations - Platforms team label May 4, 2020
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/integrations-platforms (Team:Platforms)

@blakerouse blakerouse removed the needs_team Indicates that the issue/PR needs a Team:* label label May 4, 2020
@blakerouse blakerouse requested a review from a team May 4, 2020 20:57
Copy link
Copy Markdown
Contributor

@ycombinator ycombinator left a comment

Choose a reason for hiding this comment

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

Backport LGTM.

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

Pipeline View Test View Changes Artifacts preview stats

Expand to view the summary

Build stats

Steps errors

Expand to view the steps failures

  • Name: Make -C generator/_templates/metricbeat test
    • Description: make -C generator/_templates/metricbeat test

    • Result: FAILURE

    • Duration: 1 min 39 sec<

    • Start Time: 2020-05-04T22:28:41.868+0000

Log output

Expand to view the last 100 lines of log output

[2020-05-04T22:29:29.002Z] 		at hudson.remoting.Channel.call(Channel.java:998)
[2020-05-04T22:29:29.002Z] 		at hudson.FilePath.act(FilePath.java:1069)
[2020-05-04T22:29:29.002Z] 		at hudson.FilePath.act(FilePath.java:1058)
[2020-05-04T22:29:29.002Z] 		at hudson.FilePath.validateAntFileMask(FilePath.java:2684)
[2020-05-04T22:29:29.002Z] 		at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:265)
[2020-05-04T22:29:29.002Z] 		at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
[2020-05-04T22:29:29.002Z] 		at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
[2020-05-04T22:29:29.002Z] 		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
[2020-05-04T22:29:29.002Z] 		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[2020-05-04T22:29:29.002Z] 		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2020-05-04T22:29:29.002Z] 		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2020-05-04T22:29:29.002Z] 		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2020-05-04T22:29:29.002Z] Caused: hudson.FilePath$TunneledInterruptedException
[2020-05-04T22:29:29.002Z] 	at hudson.FilePath$FileCallableWrapper.call(FilePath.java:3075)
[2020-05-04T22:29:29.002Z] 	at hudson.remoting.UserRequest.perform(UserRequest.java:212)
[2020-05-04T22:29:29.002Z] 	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
[2020-05-04T22:29:29.002Z] 	at hudson.remoting.Request$2.run(Request.java:369)
[2020-05-04T22:29:29.002Z] 	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
[2020-05-04T22:29:29.002Z] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2020-05-04T22:29:29.002Z] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2020-05-04T22:29:29.002Z] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2020-05-04T22:29:29.002Z] 	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
[2020-05-04T22:29:29.002Z] Caused: java.lang.InterruptedException: java.lang.InterruptedException: no matches found within 10000
[2020-05-04T22:29:29.002Z] 	at hudson.FilePath.act(FilePath.java:1071)
[2020-05-04T22:29:29.002Z] 	at hudson.FilePath.act(FilePath.java:1058)
[2020-05-04T22:29:29.002Z] 	at hudson.FilePath.validateAntFileMask(FilePath.java:2684)
[2020-05-04T22:29:29.002Z] 	at hudson.tasks.ArtifactArchiver.perform(ArtifactArchiver.java:265)
[2020-05-04T22:29:29.002Z] 	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)
[2020-05-04T22:29:29.002Z] 	at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:67)
[2020-05-04T22:29:29.002Z] 	at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
[2020-05-04T22:29:29.002Z] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[2020-05-04T22:29:29.002Z] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[2020-05-04T22:29:29.002Z] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[2020-05-04T22:29:29.002Z] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[2020-05-04T22:29:29.002Z] 	at java.lang.Thread.run(Thread.java:748)
[2020-05-04T22:29:29.002Z] No artifacts found that match the file pattern "**/build/TEST*.out". Configuration error?
[2020-05-04T22:29:30.369Z] + curl -sSLo codecov https://codecov.io/bash
[2020-05-04T22:29:30.369Z] + FILE=auditbeat/build/coverage/full.cov
[2020-05-04T22:29:30.369Z] + [ -f auditbeat/build/coverage/full.cov ]
[2020-05-04T22:29:30.369Z] + FILE=filebeat/build/coverage/full.cov
[2020-05-04T22:29:30.369Z] + [ -f filebeat/build/coverage/full.cov ]
[2020-05-04T22:29:30.369Z] + FILE=heartbeat/build/coverage/full.cov
[2020-05-04T22:29:30.370Z] + [ -f heartbeat/build/coverage/full.cov ]
[2020-05-04T22:29:30.370Z] + FILE=libbeat/build/coverage/full.cov
[2020-05-04T22:29:30.370Z] + [ -f libbeat/build/coverage/full.cov ]
[2020-05-04T22:29:30.370Z] + FILE=metricbeat/build/coverage/full.cov
[2020-05-04T22:29:30.370Z] + [ -f metricbeat/build/coverage/full.cov ]
[2020-05-04T22:29:30.370Z] + FILE=packetbeat/build/coverage/full.cov
[2020-05-04T22:29:30.370Z] + [ -f packetbeat/build/coverage/full.cov ]
[2020-05-04T22:29:30.370Z] + FILE=winlogbeat/build/coverage/full.cov
[2020-05-04T22:29:30.370Z] + [ -f winlogbeat/build/coverage/full.cov ]
[2020-05-04T22:29:30.370Z] + FILE=journalbeat/build/coverage/full.cov
[2020-05-04T22:29:30.370Z] + [ -f journalbeat/build/coverage/full.cov ]
[2020-05-04T22:29:32.635Z] Stage "Generators Beat Linux" skipped due to earlier failure(s)
[2020-05-04T22:29:33.048Z] Stage "Generators Metricbeat Mac OS X" skipped due to earlier failure(s)
[2020-05-04T22:29:33.265Z] Stage "Generators Beat Mac OS X" skipped due to earlier failure(s)
[2020-05-04T22:29:33.770Z] Failed in branch Generators
[2020-05-04T22:29:35.998Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18208/src/github.com/elastic/beats
[2020-05-04T22:29:36.639Z] + find . -type f -name TEST*.xml -path */build/* -delete
[2020-05-04T22:29:36.801Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18208/src/github.com/elastic/beats/Lint
[2020-05-04T22:29:37.136Z] Running in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18208/src/github.com/elastic/beats/Generators-Metricbeat-Linux
[2020-05-04T22:29:38.204Z] + cat
[2020-05-04T22:29:38.204Z] + /usr/local/bin/runbld ./runbld-script
[2020-05-04T22:29:38.204Z] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
[2020-05-04T22:29:44.548Z] runbld>>> runbld started
[2020-05-04T22:29:44.934Z] runbld>>> 1.6.11/a66728ff8f4356963772e6e6d2069392fa06acbe
[2020-05-04T22:29:46.710Z] runbld>>> The following profiles matched the job 'Beats/beats-beats-mbp/PR-18208' in order of occurrence in the config (last value wins).
[2020-05-04T22:29:48.475Z] runbld>>> Debug logging enabled.
[2020-05-04T22:29:48.475Z] runbld>>> Storing result
[2020-05-04T22:29:48.475Z] runbld>>> Store result: created {:total 2, :successful 2, :failed 0} 1
[2020-05-04T22:29:48.475Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200504222948-D1082EC0
[2020-05-04T22:29:48.475Z] runbld>>> Adding system facts.
[2020-05-04T22:29:49.224Z] runbld>>> Adding vcs info for the latest commit:  e8eb1c51e0d78adea657c59592a4b4c15168c04e
[2020-05-04T22:29:49.602Z] runbld>>> >>>>>>>>>>>> SCRIPT EXECUTION BEGIN >>>>>>>>>>>>
[2020-05-04T22:29:49.602Z] runbld>>> Adding /usr/lib/jvm/java-8-openjdk-amd64/bin to the path.
[2020-05-04T22:29:49.602Z] Processing JUnit reports with runbld...
[2020-05-04T22:29:49.602Z] + echo 'Processing JUnit reports with runbld...'
[2020-05-04T22:29:49.953Z] runbld>>> <<<<<<<<<<<< SCRIPT EXECUTION END <<<<<<<<<<<<
[2020-05-04T22:29:49.953Z] runbld>>> DURATION: 13ms
[2020-05-04T22:29:49.953Z] runbld>>> STDOUT: 40 bytes
[2020-05-04T22:29:49.953Z] runbld>>> STDERR: 49 bytes
[2020-05-04T22:29:49.953Z] runbld>>> WRAPPED PROCESS: SUCCESS (0)
[2020-05-04T22:29:49.953Z] runbld>>> Searching for build metadata in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18208/src/github.com/elastic/beats
[2020-05-04T22:29:51.279Z] runbld>>> Storing build metadata: 
[2020-05-04T22:29:51.279Z] runbld>>> Adding test report.
[2020-05-04T22:29:51.279Z] runbld>>> Searching for junit test output files with the pattern: TEST-.*\.xml$ in: /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18208/src/github.com/elastic/beats
[2020-05-04T22:29:52.603Z] runbld>>> Found 0 test output files
[2020-05-04T22:29:52.603Z] runbld>>> Test output logs contained: Errors: 0 Failures: 0 Tests: 0 Skipped: 0
[2020-05-04T22:29:52.603Z] runbld>>> Storing result
[2020-05-04T22:29:52.955Z] runbld>>> Store result: updated {:total 2, :successful 2, :failed 0} 2
[2020-05-04T22:29:52.955Z] runbld>>> BUILD: https://c150076387b5421f9154dfbf536e5c60.us-west1.gcp.cloud.es.io:9243/build-1587637540455/t/20200504222948-D1082EC0
[2020-05-04T22:29:52.955Z] runbld>>> Email notification disabled by environment variable.
[2020-05-04T22:29:52.955Z] runbld>>> Slack notification disabled by environment variable.
[2020-05-04T22:29:59.258Z] Running on Jenkins in /var/lib/jenkins/workspace/Beats_beats-beats-mbp_PR-18208
[2020-05-04T22:29:59.748Z] [INFO] getVaultSecret: Getting secrets
[2020-05-04T22:29:59.895Z] Masking supported pattern matches of $VAULT_ADDR or $VAULT_ROLE_ID or $VAULT_SECRET_ID
[2020-05-04T22:30:01.526Z] + chmod 755 generate-build-data.sh
[2020-05-04T22:30:01.526Z] + ./generate-build-data.sh https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18208/ https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18208/runs/1 FAILURE 5562795
[2020-05-04T22:30:02.077Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18208/runs/1/steps/?limit=10000 -o steps-info.json
[2020-05-04T22:30:03.944Z] INFO: curl https://beats-ci.elastic.co/blue/rest/organizations/jenkins/pipelines/Beats/beats-beats-mbp/PR-18208/runs/1/tests/?status=FAILED -o tests-errors.json

@andrewkroh
Copy link
Copy Markdown
Member

I think there's a flaw with these tests. It looks like the test generates code from this PR's commit (as it should) but it always pulls in the generated Beat's vendor from "origin/master".

@blakerouse
Copy link
Copy Markdown
Contributor Author

@andrewkroh Yes because of go mods the generated beat always uses origin/master. Maybe we should only run this test for master.

@andrewkroh
Copy link
Copy Markdown
Member

It seems like we need a way to be able to test against the same code that's under test (populate the generated beat's vendor with commit under test). Otherwise you can never be confident that the merged changes are good. Even if we only test on master you'd still have this problem.

@blakerouse
Copy link
Copy Markdown
Contributor Author

@andrewkroh being that issue still affects master, I am going to merge this so 7.x and master are the same in this regard.

@blakerouse blakerouse merged commit 4e81293 into elastic:7.x May 5, 2020
@blakerouse blakerouse deleted the backport_18086_7.x branch May 5, 2020 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport review Team:Platforms Label for the Integrations - Platforms team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants