Hashar has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/71798


Change subject: tweaks for puppet-test-runner
......................................................................

tweaks for puppet-test-runner

use find | xargs, no more using an intermediate variable.

Change-Id: Iec0bde5976e1f297ccbfc7aeb963fba88bbeb321
---
M bin/puppet-test-runner.sh
1 file changed, 7 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/jenkins 
refs/changes/98/71798/1

diff --git a/bin/puppet-test-runner.sh b/bin/puppet-test-runner.sh
index 22d6046..0dc46b4 100755
--- a/bin/puppet-test-runner.sh
+++ b/bin/puppet-test-runner.sh
@@ -24,27 +24,25 @@
 puppet_apply_noop() {
        manifest="$1"
 
-       echo "info: Invoking puppet on '$1'"
-
+       echo "INFO: Invoking puppet on '$1'"
        puppet apply --noop --modulepath="$MODULE_DIR" $manifest
 
        test_result=$?
-       [[ $test_result != 0 ]] && echo "error: failed tests for '$manifest'"
+       [[ $test_result != 0 ]] && echo "ERROR: failed tests for '$manifest'"
        return $test_result
 }
 
-echo "info: Will assume modules are under '$MODULE_DIR'"
-TEST_FILES=`find . -type f -wholename '*tests/*.pp'`
-
-echo "info: Triggering tests using up to $MAX_JOBS puppet runners"
+echo "INFO: Will assume modules are under '$MODULE_DIR'"
+echo "INFO: Triggering tests using up to $MAX_JOBS puppet runners"
 
 # Export environnent so that is made available to the subshell executed
 # by xargs.
 export MODULE_DIR
 export -f puppet_apply_noop
 
-echo $TEST_FILES|xargs -t -I '{}' -P$MAX_JOBS -n1 bash -c 'puppet_apply_noop 
{}'
+find . -type f -wholename '*tests/*.pp' -print0 \
+       | xargs -0 -t -I '{}' -P$MAX_JOBS -n1 bash -c 'puppet_apply_noop {}'
 FINAL_EXIT_CODE=$?
 
-echo "info: Final exit code: $FINAL_EXIT_CODE"
+echo "INFO: Final exit code: $FINAL_EXIT_CODE"
 exit $FINAL_EXIT_CODE

-- 
To view, visit https://gerrit.wikimedia.org/r/71798
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec0bde5976e1f297ccbfc7aeb963fba88bbeb321
Gerrit-PatchSet: 1
Gerrit-Project: integration/jenkins
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to