From 4c791c1f36c0e4b1065328bee452423f01cc6f2f Mon Sep 17 00:00:00 2001 From: Pier-Hugues Pellerin Date: Tue, 29 Jan 2019 14:50:30 -0500 Subject: [PATCH] Correctly bubble up errors when an integration test fails in a docker container. (#10380) (#10410) As a retrospect leaving the invocation of `docker-compose logs` was a bad idea, first it could hide some error in the integration suite and it could add unnecessary long logs line in the CI job making debugging even harder. So instead, I've remove it completely and leave up to the person debugging to enabled it back. (cherry picked from commit fd149bb6ec8eaec296a9800f004afc86ae30fe14) --- libbeat/scripts/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libbeat/scripts/Makefile b/libbeat/scripts/Makefile index 0c8f949971d3..3fc328f07787 100755 --- a/libbeat/scripts/Makefile +++ b/libbeat/scripts/Makefile @@ -197,7 +197,12 @@ integration-tests: prepare-tests .PHONY: integration-tests-environment integration-tests-environment: ## @testing Runs the integration inside a virtual environment. This can be run on any docker-machine (local, remote) integration-tests-environment: prepare-tests build-image - ${DOCKER_COMPOSE} run beat make integration-tests RACE_DETECTOR=$(RACE_DETECTOR) DOCKER_COMPOSE_PROJECT_NAME=${DOCKER_COMPOSE_PROJECT_NAME} || ${DOCKER_COMPOSE} logs --tail 200 + # If you want to get logs on CI when the `docker-compose` fails, you can + # add `|| ${DOCKER_COMPOSE} logs --tail 200` after the command. + # + # This will make docker-compose command to display the logs on stdout on error, It's not enabled + # by default because it can create noise if the test inside the container fails. + ${DOCKER_COMPOSE} run beat make integration-tests RACE_DETECTOR=$(RACE_DETECTOR) DOCKER_COMPOSE_PROJECT_NAME=${DOCKER_COMPOSE_PROJECT_NAME} # Runs the system tests .PHONY: system-tests