2022-11-25 21:59:14 +00:00
|
|
|
# ? load the BATS helper
|
|
|
|
load "${REPOSITORY_ROOT}/test/helper/setup"
|
|
|
|
load "${REPOSITORY_ROOT}/test/helper/common"
|
|
|
|
|
|
|
|
# ? global variable initialization
|
|
|
|
# ? to identify the test easily
|
|
|
|
TEST_NAME_PREFIX='template:'
|
|
|
|
# ? must be unique
|
2023-01-03 05:58:09 +00:00
|
|
|
CONTAINER_NAME='dms-test_template'
|
2022-11-25 21:59:14 +00:00
|
|
|
|
|
|
|
# ? test setup
|
|
|
|
|
|
|
|
function setup_file() {
|
|
|
|
# ? optional setup before container is started
|
|
|
|
|
|
|
|
# ? initialize the test helpers
|
|
|
|
init_with_defaults
|
|
|
|
|
|
|
|
# ? add custom arguments supplied to `docker run` here
|
|
|
|
local CUSTOM_SETUP_ARGUMENTS=(
|
|
|
|
--env LOG_LEVEL=trace
|
|
|
|
)
|
|
|
|
|
|
|
|
# ? use a helper to correctly setup the container
|
|
|
|
common_container_setup 'CUSTOM_SETUP_ARGUMENTS'
|
|
|
|
|
|
|
|
# ? optional setup after the container is started
|
|
|
|
}
|
|
|
|
|
|
|
|
# ? test finalization
|
|
|
|
|
|
|
|
function teardown_file() { _default_teardown ; }
|
|
|
|
|
|
|
|
# ? actual unit tests
|
|
|
|
|
|
|
|
@test "${TEST_NAME_PREFIX} default check" {
|
|
|
|
_run_in_container bash -c "true"
|
|
|
|
assert_success
|
|
|
|
}
|