Skip to content

Commit

Permalink
Remove fixed container names as not needed (elastic#3122)
Browse files Browse the repository at this point in the history
Add beat name to project namespace

* This makes sure different beats environment do not affect each other for example when Kafka is used
* It also allows to run the testsuites of all the beats in parallel

Introduce `stop-environment` command to stop all containers
  • Loading branch information
ruflin authored and tsg committed Dec 6, 2016
1 parent c1847a6 commit b8d202a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ BUILD_DIR=build
COVERAGE_DIR=${BUILD_DIR}/coverage
BEATS=packetbeat filebeat winlogbeat metricbeat heartbeat
PROJECTS=libbeat ${BEATS}
PROJECTS_ENV=libbeat metricbeat
SNAPSHOT?=yes

# Runs complete testsuites (unit, system, integration) for all beats with coverage and race detection.
Expand All @@ -12,6 +13,9 @@ testsuite:
$(foreach var,$(PROJECTS),$(MAKE) -C $(var) testsuite || exit 1;)
#$(MAKE) -C generate test

stop-environments:
$(foreach var,$(PROJECTS_ENV),$(MAKE) -C $(var) stop-environment || exit 0;)

# Runs unit and system tests without coverage and race detection.
.PHONY: test
test:
Expand Down
5 changes: 3 additions & 2 deletions libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ TEST_ENVIRONMENT?=false
SYSTEM_TESTS?=false
GOX_OS?=linux darwin windows solaris freebsd netbsd openbsd
TESTING_ENVIRONMENT?=snapshot
DOCKER_COMPOSE?=docker-compose -p ${TESTING_ENVIRONMENT} -f ${PWD}/../testing/environments/base.yml -f ${PWD}/../testing/environments/${TESTING_ENVIRONMENT}.yml -f docker-compose.yml
DOCKER_COMPOSE_PROJECT_NAME?=${BEATNAME}_${TESTING_ENVIRONMENT}
DOCKER_COMPOSE?=docker-compose -p ${DOCKER_COMPOSE_PROJECT_NAME} -f ${PWD}/../testing/environments/base.yml -f ${PWD}/../testing/environments/${TESTING_ENVIRONMENT}.yml -f docker-compose.yml
DOCKER_CACHE?=1 # If set to 0, all docker images are created without cache
GOPACKAGES_COMMA_SEP=$(subst $(space),$(comma),$(strip ${GOPACKAGES}))
PYTHON_ENV?=${BUILD_DIR}/python-env
Expand Down Expand Up @@ -304,7 +305,7 @@ start-environment: stop-environment
.PHONY: stop-environment
stop-environment:
-${DOCKER_COMPOSE} stop
-${DOCKER_COMPOSE} rm -f -v -a
-${DOCKER_COMPOSE} rm -f -v

.PHONY: write-environment
write-environment:
Expand Down
4 changes: 0 additions & 4 deletions testing/environments/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ services:
- logstash
environment:
- LS_HOST=logstash
container_name: beat

elasticsearch:
image: elasticsearch:latest
container_name: elasticsearch

logstash:
image: logstash:latest
links:
- elasticsearch
container_name: logstash
environment:
- ES_HOST=elasticsearch

Expand All @@ -28,4 +25,3 @@ services:
- elasticsearch
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200/
container_name: kibana

0 comments on commit b8d202a

Please sign in to comment.