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

abort build-tests if failed to restore stress dependencies #25140

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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