Skip to content

Commit

Permalink
[FAB-5985] unit-test: introduce verbose mode
Browse files Browse the repository at this point in the history
rebased on master and add new verbose mode
to modified run.sh.

Verbose mode can be run with:

VERBOSE=1 make unit-tests

Change-Id: I492fffdd7891e696fb202efc9de79e0d9c7854b2
Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
  • Loading branch information
Naoya Horiguchi authored and christo4ferris committed Feb 13, 2018
1 parent 8e98cdc commit d46e51a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions unit-test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ unit-tests:
- OUTPUT
- TEST_PKGS=${TEST_PKGS}
- CORE_VM_DOCKER_ATTACHSTDOUT=true
- VERBOSE
- JOB_TYPE=${JOB_TYPE}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Expand Down
9 changes: 7 additions & 2 deletions unit-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,19 @@ serial_test_packages() {
# will be tested in parallel
run_tests() {
echo ${GO_TAGS}
flags="-cover"
if [ -n "${VERBOSE}" ]; then
flags="-v -cover"
fi

local parallel=$(parallel_test_packages "$@")
if [ -n "${parallel}" ]; then
time go test -cover -tags "$GO_TAGS" -ldflags "$GO_LDFLAGS" ${parallel[@]} -short -timeout=20m
time go test ${flags} -tags "$GO_TAGS" -ldflags "$GO_LDFLAGS" ${parallel[@]} -short -timeout=20m
fi

local serial=$(serial_test_packages "$@")
if [ -n "${serial}" ]; then
time go test -cover -tags "$GO_TAGS" -ldflags "$GO_LDFLAGS" ${serial[@]} -short -p 1 -timeout=20m
time go test ${flags} -tags "$GO_TAGS" -ldflags "$GO_LDFLAGS" ${serial[@]} -short -p 1 -timeout=20m
fi
}

Expand Down

0 comments on commit d46e51a

Please sign in to comment.