Re-enabling golang integration tests#15819
Re-enabling golang integration tests#15819ycombinator merged 14 commits intoelastic:masterfrom ycombinator:go-integ-pass-env-vars
Conversation
libbeat/scripts/Makefile
Outdated
| -e RACE_DETECTOR=$(RACE_DETECTOR) \ | ||
| -e DOCKER_COMPOSE_PROJECT_NAME=${DOCKER_COMPOSE_PROJECT_NAME} \ | ||
| -e TEST_ENVIRONMENT=${TEST_ENVIRONMENT} \ | ||
| -e BEATS_DOCKER_INTEGRATION_TEST_ENV=1 \ |
There was a problem hiding this comment.
I can confirm that I focused mostly on the continuously failing integration tests for x-pack/metricbeat and assumed that the execution path at this level is same for both. Sorry about that.
I see test output in the Travis CI log proving it's working now. I don't know about any requirements that prevent you from merging this change. Thanks!
side note:
It would be useful if these magic envs are somewhere documented (what are they for, why not autodiscovered): BEATS_DOCKER_INTEGRATION_TEST_ENV, TEST_ENVIRONMENT, etc.
|
|
||
| // +build integration windows | ||
| // +build integration | ||
| // +build windows |
There was a problem hiding this comment.
Without this change this integration test was being run on Linux. Multiple build tags on the same line are combined with a logical OR whereas multiple build tags on different lines are combined with an "AND". We want the latter effect for this test.
libbeat/scripts/Makefile
Outdated
| -e RACE_DETECTOR=$(RACE_DETECTOR) \ | ||
| -e DOCKER_COMPOSE_PROJECT_NAME=${DOCKER_COMPOSE_PROJECT_NAME} \ | ||
| -e TEST_ENVIRONMENT=${TEST_ENVIRONMENT} \ | ||
| -e BEATS_DOCKER_INTEGRATION_TEST_ENV=1 \ |
There was a problem hiding this comment.
I can confirm that I focused mostly on the continuously failing integration tests for x-pack/metricbeat and assumed that the execution path at this level is same for both. Sorry about that.
I see test output in the Travis CI log proving it's working now. I don't know about any requirements that prevent you from merging this change. Thanks!
side note:
It would be useful if these magic envs are somewhere documented (what are they for, why not autodiscovered): BEATS_DOCKER_INTEGRATION_TEST_ENV, TEST_ENVIRONMENT, etc.
|
@andrewkroh Can you please have a look if the use of the environment variables is correct? Are we missing environment variables in the Makefile? I just found the variable + documentation in some go file. What is the reason to run go based integration tests from within a docker container? When running tests from within a container we only run integration tests on Linux. It looks like on windows/macOS we use a very different code path (via |
|
This value should not need to be set anywhere other than where mage sets it automatically. So I suspect something else changed with how the tests are invoked... I see that The fix here to add |
|
Thanks for the clear explanation @andrewkroh. I'll implement the shim in the OSS Metricbeat Makefile as you suggested. |
|
@andrewkroh @urso @mtojek I looked at what I did take a couple of suggestions from @andrewkroh's comment, viz.:
This way, at least most of the changes are now scoped to the OSS Metricbeat Makefile. Please let me know what you think. Thanks! |
andrewkroh
left a comment
There was a problem hiding this comment.
LGTM for getting the tests running again. We can revisit the converting the project over to a pure Go / mage based build in a few weeks.
|
Thanks @andrewkroh. Related: #9842. |
* Adding debugging * Still debugging * Add deps for integration tests * Making progress, I think :) * Testing * Try a different way of passing the env var * Revert docker info change * Removing debugging statements * Ensure "AND"ing of build tags * Don't explicitly pass BEATS_DOCKER_INTEGRATION_TEST_ENV * Move mage goIntegTest usage to metricbeat makefile * Fixing up comment * Forgot the line continuation mark * Pass the env var
* Adding debugging * Still debugging * Add deps for integration tests * Making progress, I think :) * Testing * Try a different way of passing the env var * Revert docker info change * Removing debugging statements * Ensure "AND"ing of build tags * Don't explicitly pass BEATS_DOCKER_INTEGRATION_TEST_ENV * Move mage goIntegTest usage to metricbeat makefile * Fixing up comment * Forgot the line continuation mark * Pass the env var
Somewhere along the way we inadvertently stopped runing golang integration tests. This PR re-enables them.