Skip to content

Commit

Permalink
Added option to filter functional tests when running them from the "m…
Browse files Browse the repository at this point in the history
…ake" command.
  • Loading branch information
lukasz-zaroda committed Jan 21, 2024
1 parent 75ce79f commit f5c93b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ ifndef VERSION
override VERSION = local-build
endif

# Filter functional tests. Set this variable to regex matching the names of tests you want to run.
FFILTER =

ROOT = $(shell pwd -P)

CORE_PATH = ${ROOT}/core
Expand Down Expand Up @@ -71,7 +74,7 @@ test-functional:
exit 1; \
fi; \
done
docker exec -t ${TEST_CONTAINER_NAME} /bin/bash -c "DRAKY_SOURCE_PATH=${TEST_CONTAINER_DRAKY_SOURCE_PATH} ${TEST_CONTAINER_DRAKY_SOURCE_PATH}/tests/bin/functional-tests.sh"
docker exec -t ${TEST_CONTAINER_NAME} /bin/bash -c "TEST_FILTER='${FFILTER}' DRAKY_SOURCE_PATH=${TEST_CONTAINER_DRAKY_SOURCE_PATH} ${TEST_CONTAINER_DRAKY_SOURCE_PATH}/tests/bin/functional-tests.sh"

test-lint:
docker run \
Expand Down
8 changes: 7 additions & 1 deletion tests/bin/functional-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ DRAKY_TEST_IMAGE_PATH=$(find "${DRAKY_SOURCE_PATH}" -name '*.image.tar')
docker load --input "${DRAKY_TEST_IMAGE_PATH}"

cd "$CWD/../functional" || exit 1
bats .

ARGS=()
if [ -n "${TEST_FILTER}" ]; then
ARGS=(-f "${TEST_FILTER}")
fi

bats "${ARGS[@]}" .

0 comments on commit f5c93b9

Please sign in to comment.