Skip to content

Commit

Permalink
Merge 19901ca into 41ebf22
Browse files Browse the repository at this point in the history
  • Loading branch information
athos-ribeiro authored Jul 9, 2019
2 parents 41ebf22 + 19901ca commit 34722f8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ services:
- docker
env:
matrix:
- ACTION=bandit
OS=fedora
OS_VERSION=29
PYTHON_VERSION=2
- ACTION=bandit
OS=fedora
OS_VERSION=29
PYTHON_VERSION=3
- OS=centos
OS_VERSION=7
PYTHON_VERSION=2
Expand Down
20 changes: 18 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -eux
OS=${OS:="centos"}
OS_VERSION=${OS_VERSION:="7"}
PYTHON_VERSION=${PYTHON_VERSION:="2"}
ACTION=${ACTION:="test"}
IMAGE="$OS:$OS_VERSION"
docker_mounts="-v $PWD:$PWD:z"
for dir in ${EXTRA_MOUNT:-}; do
Expand Down Expand Up @@ -71,8 +72,23 @@ if [[ $OS != "fedora" ]]; then
fi
if [[ $PYTHON_VERSION -gt 2 ]]; then $RUN $PIP install -r requirements-py3.txt; fi

case ${ACTION} in
"test")
TEST_CMD="py.test --cov dockerfile_parse --cov-report html -vv tests"
;;
"bandit")
$RUN $PKG install -y git
$RUN $PIP install bandit
TEST_CMD="bandit-baseline -r dockerfile_parse -ll -ii"
;;
*)
echo "Unknown action: ${ACTION}"
exit 2
;;
esac

# Run tests
$RUN py.test --cov dockerfile_parse --cov-report html -vv tests "$@"
$RUN ${TEST_CMD} "$@"

echo "To run tests again:"
echo "$RUN py.test --cov dockerfile_parse --cov-report html -vv tests"
echo "$RUN ${TEST_CMD}"

0 comments on commit 34722f8

Please sign in to comment.