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

Commit 9004fee

Browse files
author
jashook
committed
Windows Arm64 - Build/Run tests in CI
Build tests with arm64 runs and upload/run them to the arm64 test machines.
1 parent c842376 commit 9004fee

File tree

2 files changed

+51
-4
lines changed

2 files changed

+51
-4
lines changed

tests/runtest.cmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ if /i "%1" == "-help" goto Usage
6060
if /i "%1" == "x64" (set __BuildArch=x64&set __MSBuildBuildArch=x64&shift&goto Arg_Loop)
6161
if /i "%1" == "x86" (set __BuildArch=x86&set __MSBuildBuildArch=x86&shift&goto Arg_Loop)
6262
if /i "%1" == "arm" (set __BuildArch=arm&set __MSBuildBuildArch=arm&shift&goto Arg_Loop)
63+
if /i "%1" == "arm64" (set __BuildArch=arm64&set __MSBuildBuildArch=arm64&shift&goto Arg_Loop)
6364

6465
if /i "%1" == "debug" (set __BuildType=Debug&shift&goto Arg_Loop)
6566
if /i "%1" == "release" (set __BuildType=Release&shift&goto Arg_Loop)
@@ -201,6 +202,8 @@ call :PrecompileFX
201202
:SkipPrecompileFX
202203

203204
if defined __GenerateLayoutOnly (
205+
REM Delete the unecessary mscorlib.ni file.
206+
del %CORE_ROOT%\mscorlib.ni.dll
204207
exit /b 0
205208
)
206209

@@ -235,6 +238,7 @@ if "%__CollectDumps%"=="true" (
235238
echo %__MsgPrefix%CORE_ROOT that will be used is: %CORE_ROOT%
236239
echo %__MsgPrefix%Starting the test run ...
237240

241+
REM Delete the unecessary mscorlib.ni file.
238242
del %CORE_ROOT%\mscorlib.ni.dll
239243

240244
set __BuildLogRootName=TestRunResults

tests/scripts/arm64_post_build.py

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434

3535
g_arm64ci_path = os.path.join(os.environ["USERPROFILE"], "bin")
3636
g_dotnet_url = "https://go.microsoft.com/fwlink/?LinkID=831469"
37-
g_test_url = "https://clrjit.blob.core.windows.net/arm64ci/CoreCLR-Pri1Testing.zip"
38-
g_x64_client_url = "https://clrjit.blob.core.windows.net/arm64ci/x64_client.zip"
37+
g_x64_client_url = "https://clrjit.blob.core.windows.net/arm64ci/x64_client_live_tests.zip"
3938

4039
################################################################################
4140
# Argument Parser
@@ -88,6 +87,34 @@ def copy_core_root(core_root):
8887

8988
except OSError as error:
9089
log("Core Root not copied. Error: %s" % error)
90+
sys.exit(1)
91+
92+
return new_location
93+
94+
def copy_tests(test_location):
95+
""" Copy the test directory to the current dir as "tests"
96+
Args:
97+
test_location (str): location of the tests directory
98+
Returns:
99+
copy_location (str): name of the location, for now hardcoded to tests
100+
: for backcompat in the old system
101+
"""
102+
103+
new_location = "tests"
104+
105+
# Delete used instances.
106+
if os.path.isdir(new_location):
107+
try:
108+
shutil.rmtree(new_location)
109+
except:
110+
assert not os.path.isdir(new_location)
111+
112+
try:
113+
shutil.copytree(test_location, new_location)
114+
115+
except OSError as error:
116+
log("Test location not copied. Error: %s" % error)
117+
sys.exit(1)
91118

92119
return new_location
93120

@@ -249,15 +276,28 @@ def validate_arg(arg, check):
249276

250277
def main(args):
251278
global g_arm64ci_path
252-
global g_test_url
253279

254280
repo_root, arch, build_type, scenario, key_location, force_update = validate_args(args)
255281

282+
cwd = os.getcwd()
283+
os.chdir(repo_root)
284+
285+
runtest_location = os.path.join(repo_root, "tests", "runtest.cmd")
286+
args = [runtest_location, "GenerateLayoutOnly", arch, build_type]
287+
subprocess.check_call(args)
288+
289+
os.chdir(cwd)
290+
256291
core_root = os.path.join(repo_root,
257292
"bin",
258293
"Product",
259294
"Windows_NT.%s.%s" % (arch, build_type))
260295

296+
test_location = os.path.join(repo_root,
297+
"bin",
298+
"tests",
299+
"Windows_NT.%s.%s" % (arch, build_type))
300+
261301
cli_location = setup_cli(force_update=force_update)
262302
add_item_to_path(cli_location)
263303

@@ -269,6 +309,9 @@ def main(args):
269309
core_root = copy_core_root(core_root)
270310
log("Copied core_root to %s." % core_root)
271311

312+
test_location = copy_tests(test_location)
313+
log("Copied test location to %s." % test_location)
314+
272315
# Make sure the lst file is copied into the core_root
273316
lst_file = os.path.join(repo_root, "tests", arch, "Tests.lst")
274317
shutil.copy2(lst_file, core_root)
@@ -280,7 +323,7 @@ def main(args):
280323
build_type,
281324
scenario,
282325
core_root,
283-
g_test_url]
326+
test_location]
284327

285328
log(" ".join(args))
286329
proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

0 commit comments

Comments
 (0)