-
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
Add CI testing to x-pack/auditbeat #9362
Add CI testing to x-pack/auditbeat #9362
Conversation
@cwurm Some tests are failing in x-pack/auditbeat. And there's an unrelated failure in metricbeat on jenkins. |
84ce662
to
2a12cb7
Compare
I skipped one test that was failing. After this merges I'll open a separate PR to add an OSX worker to the Travis CI matrix. This requires some additional infrastructure changes to be able to disable integration tests executed using Docker. And once we merge the feature branch to master we can open a PR to add Jenkins testing of |
Because Jenkins failed on auditbeat/macos I triggered another build of only macos. It passed: https://beats-ci.elastic.co/job/elastic+beats+pull-request+multijob-darwin/beat=auditbeat,label=macosx/2102/ I think it was some kind of error in downloading the pip modules. I saw a similar failure in journalbeat. |
auditbeat/magefile.go
Outdated
// PythonIntegTest executes the python system tests in the integration environment (Docker). | ||
func PythonIntegTest(ctx context.Context) error { | ||
if !mage.IsInIntegTestEnv() { | ||
mg.Deps(Fields) |
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.
Should it also depend on Dashboards
? Without it, I get the following error when running mage integtest
in beats/auditbeat
:
# mage integtest
[...]
>> python test: Integration Testing
E.......
======================================================================
ERROR: Test that the dashboards can be loaded with `setup --dashboards`
----------------------------------------------------------------------
Traceback (most recent call last):
File "/go/src/github.com/elastic/beats/auditbeat/tests/system/test_base.py", line 67, in test_dashboards
shutil.copytree(kibana_dir, os.path.join(self.working_dir, "kibana"))
File "/usr/lib/python2.7/shutil.py", line 171, in copytree
names = os.listdir(src)
OSError: [Errno 2] No such file or directory: '/go/src/github.com/elastic/beats/auditbeat/build/kibana'
With Dashboards
, I get further, but it still fails:
>> python test: Integration Testing
F.......
======================================================================
FAIL: Test that the dashboards can be loaded with `setup --dashboards`
----------------------------------------------------------------------
Traceback (most recent call last):
File "/go/src/github.com/elastic/beats/auditbeat/tests/system/test_base.py", line 80, in test_dashboards
self.run_beat(extra_args=["setup", "--dashboards"], exit_code=0)
File "/go/src/github.com/elastic/beats/auditbeat/tests/system/../../../metricbeat/tests/system/../../../libbeat/tests/system/beat/beat.py", line 164, in run_beat
return proc.check_wait(exit_code)
File "/go/src/github.com/elastic/beats/auditbeat/tests/system/../../../metricbeat/tests/system/../../../libbeat/tests/system/beat/beat.py", line 93, in check_wait
exit_code, actual_exit_code)
AssertionError: Expected exit code to be 0, but it was 1
From build/system-tests/run/test_base.Test.test_dashboards/auditbeat.log
:
2018-12-04T22:30:25.815Z ERROR instance/beat.go:795 Exiting: Failed to import index-pattern: Failed to load directory /go/src/github.com/elastic/beats/auditbeat/build/system-tests/run/test_base.Test.test_dashboards/kibana/6/index-pattern:
error loading /go/src/github.com/elastic/beats/auditbeat/build/system-tests/run/test_base.Test.test_dashboards/kibana/6/index-pattern/auditbeat.json: blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];. Response: {"objects":[{"id":"auditbeat-*","type":"index-pattern","error":{"message":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}}]}
Exiting: Failed to import index-pattern: Failed to load directory /go/src/github.com/elastic/beats/auditbeat/build/system-tests/run/test_base.Test.test_dashboards/kibana/6/index-pattern:
error loading /go/src/github.com/elastic/beats/auditbeat/build/system-tests/run/test_base.Test.test_dashboards/kibana/6/index-pattern/auditbeat.json: blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];. Response: {"objects":[{"id":"auditbeat-*","type":"index-pattern","error":{"message":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}}]}
I didn't look more into why this is happening. Does it happen for you, too?
Update auditbeat and x-pack/auditbeat to share logic for generating config and packages. This makes auditbeat and x-pack/auditbeat have independent `package` targets where auditbeat generates only OSS packages and x-pack/auditbeat generates Elastic licensed packages. And x-pack/auditbeat will now be tested on Travis CI.
174ff37
to
ef15dbe
Compare
@cwurm I think I fixed the issues that you encountered. I tested both auditbeat and x-pack/auditbeat on Linux.
|
x-pack/auditbeat/magefile.go
Outdated
mg.Deps(makeConfigTemplates) | ||
// PythonUnitTest executes the python system tests. | ||
func PythonUnitTest() error { | ||
mg.Deps(mage.BuildSystemTestBinary) |
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 PythonUnitTest
should depend on Fields
. Otherwise, it fails after a mage clean
.
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’ll fix that.
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.
Fixed.
Great, both
and
Are you seeing the same thing? |
|
In
In
Both changes don't seem harmful, so I'm happy to just go with them if it makes |
The addition of this package does not happen on this branch. That should only occur if the package has a _meta dir and contains .go files. Maybe you have some files that are not checked in to this branch? I have a future enhancement that also checks that something in the packages uses
I see the same thing when running |
Ah, I found it. For some reason, I have a
Ok, we can deal with it later. |
* Refactor Auditbeat build logic Update auditbeat and x-pack/auditbeat to share logic for generating config and packages. This makes auditbeat and x-pack/auditbeat have independent `package` targets where auditbeat generates only OSS packages and x-pack/auditbeat generates Elastic licensed packages. And x-pack/auditbeat will now be tested on Travis CI. * Skip failing Auditbeat system module test * Skip failing system/process test * Add temporary target alias for Windows CI * Fix file permission issues caused by Docker usage * Optimize chown by checking if UID/GID need changed
* Refactor Auditbeat build logic Update auditbeat and x-pack/auditbeat to share logic for generating config and packages. This makes auditbeat and x-pack/auditbeat have independent `package` targets where auditbeat generates only OSS packages and x-pack/auditbeat generates Elastic licensed packages. And x-pack/auditbeat will now be tested on Travis CI. * Skip failing Auditbeat system module test * Skip failing system/process test * Add temporary target alias for Windows CI * Fix file permission issues caused by Docker usage * Optimize chown by checking if UID/GID need changed
Update auditbeat and x-pack/auditbeat to share logic for generating config and packages. This makes auditbeat and x-pack/auditbeat have independent
package
targets where auditbeat generates only OSS packages and x-pack/auditbeat generates Elastic licensed packages.And x-pack/auditbeat will now be tested on Travis CI.