-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a tox environment & dependencies for running molecule tests
- Loading branch information
Mark Goddard
committed
Feb 20, 2018
1 parent
0f5832e
commit 318f73c
Showing
5 changed files
with
49 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,3 +57,11 @@ ansible/kolla-venv/ | |
|
||
# Vagrant | ||
.vagrant | ||
|
||
# Molecule | ||
.molecule/ | ||
|
||
# Pytest | ||
.cache/ | ||
.pytest_cache/ | ||
pytestdebug.log |
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,25 @@ | ||
#!/bin/bash | ||
|
||
# Run molecule tests. Any arguments passed to this script will be passed onto | ||
# molecule. | ||
|
||
set -e | ||
|
||
molecules="$(find ansible/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