From 972aa5658152b409feb2ede9e5c1ae11fd631a4c Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Fri, 30 May 2014 11:54:04 -0700 Subject: [PATCH] Use nproc puppet apply processes when testing Puppet apply is single threaded and slow. We are testing many puppet applies in noop mode so it should be safe to run them in parallel using the number of cpus available to us. Make it so. Change-Id: I66250d21258de7791e4f5fc0b013100efae63603 --- test.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/test.sh b/test.sh index 129fe6e611..1bc035bd8a 100755 --- a/test.sh +++ b/test.sh @@ -11,9 +11,4 @@ csplit -sf applytest/puppetapplytest manifests/site.pp '/^$/' {*} sed -i -e 's/^[^[:space:]]/#&/g' applytest/puppetapplytest* sed -i -e 's@hiera(.\([^.]*\).,\([^)]*\))@\2@' applytest/puppetapplytest* -set +e -RETURN=0 -for f in `find applytest -name 'puppetapplytest*' -print` ; do - sudo puppet apply --modulepath=${MODULE_PATH} --noop --verbose --debug $f >/dev/null || RETURN=1 -done -exit $RETURN +find applytest -name 'puppetapplytest*' -print0 | xargs -0 -P $(nproc) -n 1 -I filearg sudo puppet apply --modulepath=${MODULE_PATH} --noop --verbose --debug filearg > /dev/null