Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Commit

Permalink
[WIP] Run PAPR on newly added test (#173)
Browse files Browse the repository at this point in the history
* Run PAPR on newly added test

Currently PAPR will only run the improved sanity test when there is
a new pull request.  This commit will add a very simple script to
run any new test.

* fixup! Run PAPR on newly added test

* fixup! Run PAPR on newly added test

* fixup! Run PAPR on newly added test

* fixup! Run PAPR on newly added test

* fixup! Run PAPR on newly added test

* fixup! Run PAPR on newly added test

* fixup! Run PAPR on newly added test

* fixup! Run PAPR on newly added test

* fixup! Run PAPR on newly added test

* fixup! Run PAPR on newly added test
  • Loading branch information
mike-nguyen authored and Micah Abbott committed Jun 13, 2017
1 parent 470968c commit 6e80c52
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .papr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ context: centos/7/atomic/smoketested

packages:
- ansible
- git

tests:
- ansible-playbook -vi testnode, common/ans_ah_head-1_deploy.yml
- ansible-playbook -vi testnode, tests/improved-sanity-test/main.yml
- ./.test_director

---
inherit: true
Expand Down
19 changes: 19 additions & 0 deletions .test_director
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
set -xeuo pipefail

# check commit
HEAD=${PAPR_COMMIT:-HEAD}
NEW_TESTS=( $(git diff --name-only origin/master..$HEAD | grep 'tests/.*/main.yml' || true) )

if [ ${#NEW_TESTS[@]} -eq 0 ]; then
ansible-playbook -vi testnode, common/ans_ah_head-1_deploy.yml
ansible-playbook -vi testnode, tests/improved-sanity-test/main.yml
else
printf '%s\n' "${NEW_TESTS[@]}"
for NEW_TEST in "${NEW_TESTS[@]}"; do
# diff may contain deleted tests so only run tests that exist
if [ -f $NEW_TEST ]; then
ansible-playbook -vi testnode, $NEW_TEST
fi
done
fi

0 comments on commit 6e80c52

Please sign in to comment.