chore(test): make app-ct run easier
This commit is contained in:
parent
7ea69f56be
commit
45dfc8a2fa
10
Makefile
10
Makefile
|
@ -46,6 +46,16 @@ proper: $(REBAR)
|
||||||
ct: $(REBAR)
|
ct: $(REBAR)
|
||||||
@ENABLE_COVER_COMPILE=1 $(REBAR) ct --name 'test@127.0.0.1' -c -v
|
@ENABLE_COVER_COMPILE=1 $(REBAR) ct --name 'test@127.0.0.1' -c -v
|
||||||
|
|
||||||
|
APPS=$(shell $(CURDIR)/scripts/find-apps.sh)
|
||||||
|
|
||||||
|
## app/name-ct targets are intended for local tests hence cover is not enabled
|
||||||
|
.PHONY: $(APPS:%=%-ct)
|
||||||
|
define gen-app-ct-target
|
||||||
|
$1-ct:
|
||||||
|
$(REBAR) ct --name 'test@127.0.0.1' -v --suite $(shell $(CURDIR)/scripts/find-suites.sh $1)
|
||||||
|
endef
|
||||||
|
$(foreach app,$(APPS),$(eval $(call gen-app-ct-target,$(app))))
|
||||||
|
|
||||||
.PHONY: cover
|
.PHONY: cover
|
||||||
cover: $(REBAR)
|
cover: $(REBAR)
|
||||||
@ENABLE_COVER_COMPILE=1 $(REBAR) cover
|
@ENABLE_COVER_COMPILE=1 $(REBAR) cover
|
||||||
|
|
|
@ -89,17 +89,12 @@ make eunit ct
|
||||||
|
|
||||||
### To run subset of the common tests
|
### To run subset of the common tests
|
||||||
|
|
||||||
examples
|
Examples
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./rebar3 ct --name 'test@127.0.0.1' -c -v --dir test,apps/emqx_sn,apps/emqx_coap
|
make apps/emqx_bridge_mqtt-ct
|
||||||
./rebar3 ct --name 'test@127.0.0.1' -c -v --dir apps/emqx_auth_mnesi --suite emqx_acl_mnesia_SUITE
|
|
||||||
./rebar3 ct --name 'test@127.0.0.1' -c -v --dir apps/emqx_auth_mnesi --suite emqx_acl_mnesia_SUITE --case t_rest_api
|
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: Do *NOT* use full (relative) path to SUITE files like this `--suite apps/emqx_auth_mnesia/test/emqx_acl_mnesia_SUITE.erl`,
|
|
||||||
because it will lead to a full copy of `apps` dir into `_buid/test/lib/emqx`.
|
|
||||||
|
|
||||||
### Dialyzer
|
### Dialyzer
|
||||||
##### To Analyze all the apps
|
##### To Analyze all the apps
|
||||||
```
|
```
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# ensure dir
|
||||||
|
cd -P -- "$(dirname -- "$0")/.."
|
||||||
|
|
||||||
|
find_app() {
|
||||||
|
local appdir="$1"
|
||||||
|
find "${appdir}/" -mindepth 1 -maxdepth 1 -type d
|
||||||
|
}
|
||||||
|
|
||||||
|
find_app 'apps'
|
||||||
|
if [ -f 'EMQX_ENTERPRISE' ]; then
|
||||||
|
find_app 'lib-ee'
|
||||||
|
else
|
||||||
|
find_app 'lib-ce'
|
||||||
|
fi
|
|
@ -0,0 +1,13 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## this script prints out all test/*_SUITE.erl files of a given app,
|
||||||
|
## file names are separated by comma for rebar3 ct's `--suite` option
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# ensure dir
|
||||||
|
cd -P -- "$(dirname -- "$0")/.."
|
||||||
|
|
||||||
|
APPDIR="$1"
|
||||||
|
|
||||||
|
find "${APPDIR}/test" -name "*_SUITE.erl" | tr -d '\r' | tr '\n' ','
|
Loading…
Reference in New Issue