diff options
author | Bernhard Urban <bernhard.urban@xamarin.com> | 2018-09-12 20:32:59 +0300 |
---|---|---|
committer | Ludovic Henry <luhenry@microsoft.com> | 2018-09-12 20:32:59 +0300 |
commit | cfa5e8d5350bd9344da358ee91b92068fe441204 (patch) | |
tree | 42ee9325cf2ee7a25d5fb768b3ded4b7b30fee98 | |
parent | f4df4c84225db8bc4a677df8ae95c77c051dfc1b (diff) |
[ci] do not hardcode CPU count (#10560)
getconf should work on both, macOS and linux.
Fixes https://github.com/mono/mono/issues/10506
-rwxr-xr-x | scripts/ci/run-jenkins.sh | 28 | ||||
-rwxr-xr-x | scripts/ci/run-test-default.sh | 8 | ||||
-rwxr-xr-x | scripts/ci/run-test-interpreter.sh | 2 | ||||
-rwxr-xr-x | scripts/ci/run-test-testing_aot_full.sh | 6 | ||||
-rwxr-xr-x | scripts/ci/run-test-testing_aot_hybrid.sh | 2 | ||||
-rwxr-xr-x | scripts/ci/run-test-winaot.sh | 4 |
6 files changed, 26 insertions, 24 deletions
diff --git a/scripts/ci/run-jenkins.sh b/scripts/ci/run-jenkins.sh index 952e9a603ed..5407307f95a 100755 --- a/scripts/ci/run-jenkins.sh +++ b/scripts/ci/run-jenkins.sh @@ -3,6 +3,8 @@ export MONO_REPO_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../../" && pwd )" export TESTCMD=${MONO_REPO_ROOT}/scripts/ci/run-step.sh +export CI_CPU_COUNT=$(getconf _NPROCESSORS_ONLN || echo 4) + export TEST_HARNESS_VERBOSE=1 make_timeout=300m @@ -102,13 +104,13 @@ if [[ ${CI_TAGS} == *'product-sdks-ios'* ]]; echo "DISABLE_WASM=1" >> sdks/Make.config export device_test_suites="Mono.Runtime.Tests System.Core" - ${TESTCMD} --label=provision-llvm --timeout=60m --fatal make -j4 -C sdks/builds provision-llvm36-llvm32 provision-llvm-llvm64 + ${TESTCMD} --label=provision-llvm --timeout=60m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds provision-llvm36-llvm32 provision-llvm-llvm64 - ${TESTCMD} --label=build-sim-runtimes --timeout=60m --fatal make -j4 -C sdks/builds package-ios-{sim64,sim32,simtv,simwatch} - ${TESTCMD} --label=build-dev-runtimes --timeout=60m --fatal make -j4 -C sdks/builds package-ios-{target64,target32,targettv,targetwatch} - ${TESTCMD} --label=build-cross-compilers --timeout=60m --fatal make -j4 -C sdks/builds package-ios-{cross64,cross32,crosswatch} + ${TESTCMD} --label=build-sim-runtimes --timeout=60m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds package-ios-{sim64,sim32,simtv,simwatch} + ${TESTCMD} --label=build-dev-runtimes --timeout=60m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds package-ios-{target64,target32,targettv,targetwatch} + ${TESTCMD} --label=build-cross-compilers --timeout=60m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds package-ios-{cross64,cross32,crosswatch} - ${TESTCMD} --label=bcl --timeout=60m --fatal make -j4 -C sdks/builds package-bcl + ${TESTCMD} --label=bcl --timeout=60m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds package-bcl ${TESTCMD} --label=build-tests --timeout=10m --fatal make -C sdks/ios compile-tests ${TESTCMD} --label=run-sim --timeout=20m make -C sdks/ios run-ios-sim-all ${TESTCMD} --label=build-ios-dev --timeout=60m make -C sdks/ios build-ios-dev-all @@ -137,12 +139,12 @@ if [[ ${CI_TAGS} == *'product-sdks-android'* ]]; echo "IGNORE_PROVISION_MXE=1" >> sdks/Make.config echo "IGNORE_PROVISION_LLVM=1" >> sdks/Make.config echo "DISABLE_CCACHE=1" >> sdks/Make.config - ${TESTCMD} --label=provision-android --timeout=120m --fatal make -j4 -C sdks/builds provision-android + ${TESTCMD} --label=provision-android --timeout=120m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds provision-android if [[ ${CI_TAGS} == *'provision-mxe'* ]]; then - ${TESTCMD} --label=provision-mxe --timeout=240m --fatal make -j4 -C sdks/builds provision-mxe + ${TESTCMD} --label=provision-mxe --timeout=240m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds provision-mxe fi - ${TESTCMD} --label=llvm --timeout=240m --fatal make -j4 -C sdks/builds provision-llvm-llvm{,win}{32,64} - ${TESTCMD} --label=runtimes --timeout=120m --fatal make -j4 -C sdks/builds package-android-{armeabi-v7a,arm64-v8a,x86,x86_64} package-android-host-{Darwin,mxe-Win64} package-android-cross-{arm,arm64,x86,x86_64}{,-win} + ${TESTCMD} --label=llvm --timeout=240m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds provision-llvm-llvm{,win}{32,64} + ${TESTCMD} --label=runtimes --timeout=120m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds package-android-{armeabi-v7a,arm64-v8a,x86,x86_64} package-android-host-{Darwin,mxe-Win64} package-android-cross-{arm,arm64,x86,x86_64}{,-win} exit 0 fi @@ -151,9 +153,9 @@ if [[ ${CI_TAGS} == *'webassembly'* ]]; echo "DISABLE_ANDROID=1" > sdks/Make.config echo "DISABLE_IOS=1" >> sdks/Make.config echo "DISABLE_DESKTOP=1" >> sdks/Make.config - ${TESTCMD} --label=runtimes --timeout=60m --fatal make -j4 -C sdks/builds package-wasm-runtime package-wasm-cross - ${TESTCMD} --label=bcl --timeout=60m --fatal make -j4 -C sdks/builds package-bcl - ${TESTCMD} --label=wasm-build --timeout=60m --fatal make -j4 -C sdks/wasm build + ${TESTCMD} --label=runtimes --timeout=60m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds package-wasm-runtime package-wasm-cross + ${TESTCMD} --label=bcl --timeout=60m --fatal make -j ${CI_CPU_COUNT} -C sdks/builds package-bcl + ${TESTCMD} --label=wasm-build --timeout=60m --fatal make -j ${CI_CPU_COUNT} -C sdks/wasm build ${TESTCMD} --label=ch-mini-test --timeout=60m make -C sdks/wasm run-ch-mini ${TESTCMD} --label=v8-mini-test --timeout=60m make -C sdks/wasm run-v8-mini ${TESTCMD} --label=sm-mini-test --timeout=60m make -C sdks/wasm run-sm-mini @@ -196,7 +198,7 @@ fi if [[ ${CI_TAGS} == *'monolite'* ]]; then make get-monolite-latest; fi -make_parallelism=-j4 +make_parallelism="-j ${CI_CPU_COUNT}" if [[ ${CI_TAGS} == *'linux-ppc64el'* ]]; then make_parallelism=-j1; fi make_continue= diff --git a/scripts/ci/run-test-default.sh b/scripts/ci/run-test-default.sh index 7272b086f3a..235d8090000 100755 --- a/scripts/ci/run-test-default.sh +++ b/scripts/ci/run-test-default.sh @@ -3,10 +3,10 @@ ${TESTCMD} --label=mini --timeout=5m make -w -C mono/mini -k check check-seq-points EMIT_NUNIT=1 if [[ ${CI_TAGS} == *'win-'* ]] || [[ ${CI_TAGS} == *'ppc64'* ]] then ${TESTCMD} --label=aot-test --skip; -else ${TESTCMD} --label=aot-test --timeout=30m make -w -C mono/tests -j4 -k test-aot +else ${TESTCMD} --label=aot-test --timeout=30m make -w -C mono/tests -j ${CI_CPU_COUNT} -k test-aot fi -${TESTCMD} --label=compile-bcl-tests --timeout=40m make -i -w -C runtime -j4 test xunit-test -${TESTCMD} --label=compile-runtime-tests --timeout=40m make -w -C mono/tests -j4 tests +${TESTCMD} --label=compile-bcl-tests --timeout=40m make -i -w -C runtime -j ${CI_CPU_COUNT} test xunit-test +${TESTCMD} --label=compile-runtime-tests --timeout=40m make -w -C mono/tests -j ${CI_CPU_COUNT} tests ${TESTCMD} --label=runtime --timeout=160m make -w -C mono/tests -k test-wrench V=1 CI=1 CI_PR=$([[ ${CI_TAGS} == *'pull-request'* ]] && echo 1 || true) ${TESTCMD} --label=runtime-unit-tests --timeout=5m make -w -C mono/unit-tests -k check if [[ ${CI_TAGS} == *'osx-'* ]]; then ${TESTCMD} --label=corlib-btls --timeout=5m bash -c "export MONO_TLS_PROVIDER=btls && make -w -C mcs/class/corlib TEST_HARNESS_FLAGS=-include:X509Certificates run-test"; fi @@ -130,7 +130,7 @@ ${TESTCMD} --label=bundle-test-results --timeout=2m find . -name "TestResult*.xm if [[ $CI_TAGS == *'apidiff'* ]]; then source ${MONO_REPO_ROOT}/scripts/ci/util.sh - if ${TESTCMD} --label=apidiff --timeout=15m --fatal make -w -C mcs -j4 mono-api-diff + if ${TESTCMD} --label=apidiff --timeout=15m --fatal make -w -C mcs -j ${CI_CPU_COUNT} mono-api-diff then report_github_status "success" "API Diff" "No public API changes found." || true else report_github_status "error" "API Diff" "The public API changed." "$BUILD_URL/Public_20API_20Diff/" || true fi diff --git a/scripts/ci/run-test-interpreter.sh b/scripts/ci/run-test-interpreter.sh index ce87676e882..982694b2405 100755 --- a/scripts/ci/run-test-interpreter.sh +++ b/scripts/ci/run-test-interpreter.sh @@ -6,7 +6,7 @@ export TEST_WITH_INTERPRETER=1 ${TESTCMD} --label=interpreter-regression --timeout=10m make -C mono/mini richeck ${TESTCMD} --label=mixedmode-regression --timeout=10m make -C mono/mini mixedcheck ${TESTCMD} --label=fullaotmixed-regression --timeout=10m make -C mono/mini fullaotmixedcheck -${TESTCMD} --label=compile-runtime-tests --timeout=40m make -w -C mono/tests -j4 tests +${TESTCMD} --label=compile-runtime-tests --timeout=40m make -w -C mono/tests -j ${CI_CPU_COUNT} tests ${TESTCMD} --label=runtime-interp --timeout=160m make -w -C mono/tests -k testinterp V=1 CI=1 CI_PR=$([[ ${CI_TAGS} == *'pull-request'* ]] && echo 1 || true) ${TESTCMD} --label=corlib --timeout=160m make -w -C mcs/class/corlib run-test V=1 ${TESTCMD} --label=System --timeout=160m bash -c "export MONO_TLS_PROVIDER=legacy && make -w -C mcs/class/System run-test V=1" diff --git a/scripts/ci/run-test-testing_aot_full.sh b/scripts/ci/run-test-testing_aot_full.sh index c91695acb86..b9ca4fe4530 100755 --- a/scripts/ci/run-test-testing_aot_full.sh +++ b/scripts/ci/run-test-testing_aot_full.sh @@ -2,14 +2,14 @@ if test -n "${MONO_STATIC_AOT}"; then -${TESTCMD} --label=mkbundle --timeout=25m make -j 4 -w -C mcs/class/corlib -k mkbundle-all-tests +${TESTCMD} --label=mkbundle --timeout=25m make -j ${CI_CPU_COUNT} -w -C mcs/class/corlib -k mkbundle-all-tests fi if test -n "${MONO_LLVMONLY}"; then -${TESTCMD} --label=mini --timeout=25m make -j 4 -w -C mono/mini -k llvmonlycheck +${TESTCMD} --label=mini --timeout=25m make -j ${CI_CPU_COUNT} -w -C mono/mini -k llvmonlycheck else -${TESTCMD} --label=mini --timeout=25m make -j 4 -w -C mono/mini -k fullaotcheck +${TESTCMD} --label=mini --timeout=25m make -j ${CI_CPU_COUNT} -w -C mono/mini -k fullaotcheck fi ${TESTCMD} --label=runtime --timeout=160m make -w -C mono/tests -k test-wrench V=1 CI=1 diff --git a/scripts/ci/run-test-testing_aot_hybrid.sh b/scripts/ci/run-test-testing_aot_hybrid.sh index 5bb6cf319d3..1c9c8649437 100755 --- a/scripts/ci/run-test-testing_aot_hybrid.sh +++ b/scripts/ci/run-test-testing_aot_hybrid.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -${TESTCMD} --label=mini --timeout=25m make -j 4 -w -C mono/mini -k aotcheck +${TESTCMD} --label=mini --timeout=25m make -j ${CI_CPU_COUNT} -w -C mono/mini -k aotcheck ${TESTCMD} --label=runtime --timeout=160m make -w -C mono/tests -k test-wrench V=1 CI=1 ${TESTCMD} --label=corlib --timeout=30m make -w -C mcs/class/corlib run-test ${TESTCMD} --label=verify --timeout=15m make -w -C runtime mcs-compileall diff --git a/scripts/ci/run-test-winaot.sh b/scripts/ci/run-test-winaot.sh index 618bb9ed257..4aa2902d77d 100755 --- a/scripts/ci/run-test-winaot.sh +++ b/scripts/ci/run-test-winaot.sh @@ -2,9 +2,9 @@ if test -n "${MONO_LLVMONLY}"; then -${TESTCMD} --label=mini --timeout=25m make -j 4 -w -C mono/mini -k llvmonlycheck +${TESTCMD} --label=mini --timeout=25m make -j ${CI_CPU_COUNT} -w -C mono/mini -k llvmonlycheck else -${TESTCMD} --label=mini --timeout=25m make -j 4 -w -C mono/mini -k fullaotcheck +${TESTCMD} --label=mini --timeout=25m make -j ${CI_CPU_COUNT} -w -C mono/mini -k fullaotcheck fi ${TESTCMD} --label=runtime --timeout=160m make -w -C mono/tests -k test-wrench V=1 CI=1 |