-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Running browebat ansible unit tests | ||
=================================== | ||
|
||
Running ansible molecule unit tests | ||
----------------------------------- | ||
|
||
- Ensure that you have docker installed: | ||
|
||
https://docs.docker.com/install/ | ||
|
||
- Run tox -e molecule | ||
|
||
Adding ansible molecue unit test | ||
-------------------------------- | ||
|
||
- cd ansible/install/roles/<example role> | ||
molecule init scenario --role-name <example role> --driver-name docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
|
||
# Run molecule tests. Any arguments passed to this script will be passed onto | ||
# molecule. | ||
|
||
set -e | ||
|
||
molecules="$(find ansible/install/roles/ -name molecule -type d)" | ||
|
||
failed=0 | ||
ran=0 | ||
for molecule in $molecules; do | ||
pushd $(dirname $molecule) | ||
if ! molecule test --all $*; then | ||
failed=$((failed + 1)) | ||
fi | ||
ran=$((ran + 1)) | ||
popd | ||
done | ||
|
||
if [[ $failed -ne 0 ]]; then | ||
echo "Failed $failed / $ran molecule tests" | ||
exit 1 | ||
fi | ||
|
||
echo "Ran $ran molecule tests successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters