Skip to content
Snippets Groups Projects
Commit f73e933a authored by ale's avatar ale
Browse files

Split the test-driver "run" command into "provision" and "test"

parent 7c2a85c2
No related branches found
No related tags found
No related merge requests found
...@@ -92,9 +92,12 @@ Commands: ...@@ -92,9 +92,12 @@ Commands:
cleanup Cleanup the test environment (turn down VMs, etc) cleanup Cleanup the test environment (turn down VMs, etc)
run Run the main float playbook, and the test suite, using provision Run the main float playbook
the playbooks specified by the remaining command-line
arguments test Run the test suite, using the playbooks specified by
the remaining command-line arguments
run (deprecated) Run 'provision' and 'test'
If DIR is specified, chdir there before running anything. If DIR is specified, chdir there before running anything.
...@@ -119,6 +122,20 @@ if [ $# -gt 0 ]; then ...@@ -119,6 +122,20 @@ if [ $# -gt 0 ]; then
shift shift
fi fi
do_provision() {
log Running main playbook
${float_dir}/float run site.yml \
|| die "failed to run the main playbook"
}
do_test() {
for playbook in "${float_dir}/test/integration-test.yml" "$@"; do
log Running test playbook ${playbook}
${float_dir}/float run ${playbook} \
|| die "test playbook failed"
done
}
case "$cmd" in case "$cmd" in
init) init)
run_init run_init
...@@ -134,16 +151,18 @@ case "$cmd" in ...@@ -134,16 +151,18 @@ case "$cmd" in
run_cleanup run_cleanup
;; ;;
run) provision)
log Running main playbook do_provision
${float_dir}/float run site.yml \ ;;
|| die "failed to run the main playbook"
for playbook in "${float_dir}/test/integration-test.yml" "$@"; do test)
log Running test playbook ${playbook} do_test
${float_dir}/float run ${playbook} \ ;;
|| die "test playbook failed"
done # Legacy command to run both 'provision' and 'test' at once.
run)
do_provision
do_test
;; ;;
*) *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment