Adding a Makefile and basic tests.

This approach uses bats to create a generic docker-compose test. It
checks that images are pullable, projects are buildable, up works, and
if ports are exposed that something is listening.

The tests can be tailored for each example. As long as they are the same
though, you can edit lib/test.bats.example and then `make update-tests`
and all the tests will be synced.

Signed-off-by: Chad Metcalf <chad@docker.com>
This commit is contained in:
Chad Metcalf
2020-08-07 11:57:15 -07:00
committed by Chad Metcalf
parent c47ca78721
commit 702ec96821
28 changed files with 1595 additions and 0 deletions

7
Makefile Normal file
View File

@@ -0,0 +1,7 @@
.phony: test
test:
@bats -T -r .
update-tests:
@find . -maxdepth 1 -type d -not -path '*/\.*' -not -path '.' -not -path './lib' -exec cp ./lib/test.bats.example {}/test.bats \;