Skip to content

Commit

Permalink
abort build-tests if failed to restore stress dependencies (dotnet#25140
Browse files Browse the repository at this point in the history
)

* abort build-tests if failed to restore stress dependencies

* Fix arm condition.

* Add arm64 condition.

* Skip runtime dependencies for arm32/arm64.
  • Loading branch information
Sergey Andreenko authored Jun 15, 2019
1 parent 3eb98b0 commit 14a981f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 13 deletions.
4 changes: 4 additions & 0 deletions build-test.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,10 @@ REM ===
REM =========================================================================================

call "%__TestDir%\setup-stress-dependencies.cmd" /arch %__BuildArch% /outputdir %__BinDir%
if errorlevel 1 (
echo %__MsgPrefix%Error: setup-stress-dependencies failed.
goto :Exit_Failure
)
@if defined _echo @echo on

REM =========================================================================================
Expand Down
6 changes: 5 additions & 1 deletion build-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,13 @@ generate_layout()
cp -r $__BinDir/* $CORE_ROOT/ > /dev/null

if [ "$__BuildOS" != "OSX" ]; then
nextCommand="\"$__TestDir/setup-stress-dependencies.sh\" --outputDir=$CORE_ROOT"
nextCommand="\"$__TestDir/setup-stress-dependencies.sh\" --arch=$__BuildArch --outputDir=$CORE_ROOT"
echo "Resolve runtime dependences via $nextCommand"
eval $nextCommand
if [ $? != 0 ]; then
echo "${__MsgPrefix}Error: setup-stress-dependencies failed."
exit 1
fi
fi

# Precompile framework assemblies with crossgen if required
Expand Down
10 changes: 2 additions & 8 deletions tests/bringup_runtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1451,14 +1451,8 @@ else
load_failing_tests
fi

# Other architectures are not supported yet.
if [ "$ARCH" == "x64" ]
then
scriptPath=$(dirname $0)
${scriptPath}/setup-stress-dependencies.sh --outputDir=$coreOverlayDir
elif [ "$ARCH" != "arm64" ] && [ "$ARCH" != "arm" ]; then
echo "Skip preparing for GC stress test. Dependent package is not supported on this architecture."
fi
scriptPath=$(dirname $0)
${scriptPath}/setup-stress-dependencies.sh --arch=$ARCH --outputDir=$coreOverlayDir

export __TestEnv=$testEnv

Expand Down
9 changes: 7 additions & 2 deletions tests/setup-stress-dependencies.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ if not defined __OutputDir goto Usage
if not defined __Arch goto Usage

REM Check if the platform is supported
if /i %__Arch% == "arm" (
if /i "%__Arch%" == "arm" (
echo No runtime dependencies for Arm32.
exit /b 0
)
)

if /i "%__Arch%" == "arm64" (
echo No runtime dependencies for Arm64.
exit /b 0
)

REM =========================================================================================
REM ===
Expand Down
19 changes: 17 additions & 2 deletions tests/setup-stress-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ function print_usage {
echo ''
echo 'Command line:'
echo ''
echo './setup-gcstress.sh --outputDir=<coredistools_lib_install_path>'
echo './setup-gcstress.sh --arch=<TargetArch> --outputDir=<coredistools_lib_install_path>'
echo ''
echo 'Required arguments:'
echo ' --arch=<TargetArch> : Target arch for the build'
echo ' --outputDir=<path> : Directory to install libcoredistools.so'
echo ''
}
Expand Down Expand Up @@ -55,6 +56,9 @@ do
-v|--verbose)
verbose=1
;;
--arch=*)
__BuildArch=${i#*=}
;;
--outputDir=*)
libInstallDir=${i#*=}
;;
Expand All @@ -66,12 +70,23 @@ do
esac
done

if [ -z "$__BuildArch" ]; then
echo "--arch is required."
print_usage
exit_with_error 1
fi

if [ -z "$libInstallDir" ]; then
echo "--libInstallDir is required."
echo "--outputDir is required."
print_usage
exit_with_error 1
fi

if [ "$__BuildArch" == "arm64" ] || [ "$__BuildArch" == "arm" ]; then
echo "No runtime dependencies for arm32/arm64"
exit $EXIT_CODE_SUCCESS
fi

# This script must be located in coreclr/tests.
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

Expand Down

0 comments on commit 14a981f

Please sign in to comment.