Skip to content

Commit

Permalink
Merge pull request elastic#50 from jsoriano/auto-tag-flag
Browse files Browse the repository at this point in the history
Automatically set the tags flags when needed
  • Loading branch information
mdelapenya authored Sep 30, 2019
2 parents 3453fec + 4f93116 commit a28658d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions metricbeat-tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FEATURE?=
FLAG?=
FORMAT?=pretty
LOG_INCLUDE_TIMESTAMP?=TRUE
LOG_LEVEL?=INFO
METRICBEAT_FETCH_TIMEOUT?=20
QUERY_MAX_ATTEMPTS?=5
RETRY_TIMEOUT?=3

ifneq ($(FEATURE),)
FEATURE_FLAG=--tags
endif

.PHONY: build-binary
build-binary:
cd ../cli && go build -o op && mv op ../metricbeat-tests && cd -
Expand All @@ -22,7 +25,7 @@ functional-test:
OP_METRICBEAT_FETCH_TIMEOUT=${METRICBEAT_FETCH_TIMEOUT} \
OP_QUERY_MAX_ATTEMPTS=${QUERY_MAX_ATTEMPTS} \
OP_RETRY_TIMEOUT=${RETRY_TIMEOUT} \
godog --format=${FORMAT} ${FLAG} ${FEATURE}
godog --format=${FORMAT} ${FEATURE_FLAG} ${FEATURE}

.PHONY: run-elastic-stack
run-elastic-stack:
Expand Down
3 changes: 1 addition & 2 deletions metricbeat-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,12 +206,11 @@ $ make functional-tests # runs the test suite
You could set up the environment so that it's possible to run one single module. As we are using _tags_ for matching modules, we could tell `make` to run just the tests for redis:

```shell
$ LOG_LEVEL=DEBUG FLAG="-t" FEATURE="redis" make functional-test
$ LOG_LEVEL=DEBUG FEATURE="redis" make functional-test
```
where:

- LOG_LEVEL: sets the default log level in the tool (DEBUG, INFO, WARN, ERROR, FATAL)
- FLAG: if set as `-t`, it will tell `Godog` to filter by tag.
- FEATURE: sets the tag to filter by (apache, mysql, redis)

### Advanced usage
Expand Down

0 comments on commit a28658d

Please sign in to comment.