Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
dbscripts
Commits
70aad50f
Verified
Commit
70aad50f
authored
Nov 19, 2021
by
Jelle van der Waa
🚧
Browse files
Allows bats arguments to be passed to tests
Useful to specify a specific test to run during development/debugging.
parent
ce6d77c9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
70aad50f
IMAGE
:=
dbscripts/test
RUN_OPTIONS
:=
--rm
--network
=
none
-v
$(PWD)
:/dbscripts:ro
--tmpfs
=
/tmp:exec
-w
/dbscripts/test
CASES
?=
cases
BATS_ARGS
?=
DOCKER
?=
docker
test-image
:
$(DOCKER)
build
--pull
-t
$(IMAGE)
test
test
:
test-image
$(DOCKER)
run
$(RUN_OPTIONS)
$(IMAGE)
make
CASES
=
$(CASES)
test
$(DOCKER)
run
$(RUN_OPTIONS)
$(IMAGE)
make
CASES
=
$(CASES)
BATS_ARGS
=
"
$(BATS_ARGS)
"
test
test-coverage
:
test-image
rm
-rf
${PWD}
/coverage
...
...
README.md
View file @
70aad50f
...
...
@@ -62,6 +62,12 @@ issuing `systemctl start docker`.
*
The test suite can now be run with
`make test`
.
*
A coverage report can be generated with
`make test-coverage`
. Open
`coverage/index.html`
in your web browser to inspect the results.
Bats arguments or specific test can be run by providing
`CASES`
and
`BATS_ARGS`
:
```
make test DOCKER=podman CASES=cases/db-update.bats BATS_ARGS='-f Wrong'
```
## License
For a long time, dbscripts didn't have an explicit license. Currently it is
primarily licensed under the GPL-2.0-or-later, but some code is of unknown
...
...
test/Makefile
View file @
70aad50f
CASES
?=
cases
BATS_ARGS
?=
test
:
BUILDDIR
=
/build
PATH
=
$(CURDIR)
/../:
$(CURDIR)
/../cron-jobs/:
$(PATH)
bats
$(CASES)
BUILDDIR
=
/build
PATH
=
$(CURDIR)
/../:
$(CURDIR)
/../cron-jobs/:
$(PATH)
bats
$(BATS_ARGS)
$(CASES)
test-coverage
:
BUILDDIR
=
/build
PATH
=
$(CURDIR)
/../:
$(CURDIR)
/../cron-jobs/:
$(PATH)
kcov
\
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment