Skip to content

Commit

Permalink
chore: add perltidy in ci tests (fixes #46)
Browse files Browse the repository at this point in the history
  • Loading branch information
slauger committed Sep 18, 2020
1 parent 3948c2c commit 799c545
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ before_install:
- docker run -dt -p 80 --name web2 nginx:${NGINX_CONTAINER_VERSION:-latest}

install:
- sudo apt-get install -y sshpass jq cpanminus libwww-perl liblwp-protocol-https-perl libjson-perl strace
- sudo apt-get install -y sshpass jq cpanminus libwww-perl liblwp-protocol-https-perl libjson-perl strace perltidy
- sudo cpanm Monitoring::Plugin
- git clone https://github.com/bats-core/bats-core.git bats-core

Expand All @@ -24,5 +24,6 @@ script:
- export WEB02_IP=$(docker inspect web2 | jq -r .[0].NetworkSettings.IPAddress)
- sed -i "s/WEB01_IP/${WEB01_IP}/g" tests/ns.conf
- sed -i "s/WEB02_IP/${WEB02_IP}/g" tests/ns.conf
- tests/lint.sh
- tests/travis_prepare.sh
- bats-core/bin/bats tests/bats
16 changes: 16 additions & 0 deletions tests/lint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

LINT_FILE=$(mktemp)

perltidy check_netscaler.pl > ${LINT_FILE}
diff check_netscaler.pl ${LINT_FILE}

echo

if [ "${?}" -eq 0 ]; then
echo "OK: perltidy lint ok"
exit 0
else
echo "ERROR: please run perltidy, changes found"
exit 1
fi

0 comments on commit 799c545

Please sign in to comment.