Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreCLR runtime tests + Mono on the x64 iOS simulator #43954

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
cd655d4
Try running the existing runtime test stuff on iOS_x64 and see what b…
imhameed Oct 28, 2020
bcf2194
Build libraries for iOS x64
imhameed Oct 28, 2020
f5407b7
Checkpoint
imhameed Dec 22, 2020
788c91e
.
imhameed Jan 6, 2021
a38489f
$ -> @
imhameed Jan 15, 2021
bb02967
Allow specifying a launch assembly via an environment variable
imhameed Feb 13, 2021
d62be57
Add iOSSimulator to the native test component exclusion list
imhameed Apr 9, 2021
26c6f6a
iOS -> iOSSimulator
imhameed Apr 9, 2021
17da6b1
Invoke xharness in generated runtime test execution scripts for the i…
imhameed Apr 27, 2021
f339a67
aaaaaa
imhameed Apr 28, 2021
64c6242
Enable iOSSimulator helix queues
imhameed Apr 30, 2021
6ec3caa
...
imhameed May 4, 2021
b3b105f
Try dumping output to /tmp/out instead of the home directory, which m…
imhameed May 4, 2021
916e40a
Build iOS runtime test app bundles in parallel
imhameed May 5, 2021
5b0697c
Move test apps to the "XUnitTestBinBase"
imhameed May 5, 2021
aeecc0d
Duplicate some script goo
imhameed May 6, 2021
cffef0b
escaping
imhameed May 6, 2021
2b252ad
Try resetting the simulator (slow) on each test run
imhameed May 12, 2021
9b50976
Try using invariant globalization for now (where is icudt.dat suppose…
imhameed May 13, 2021
9bae38f
...
imhameed May 14, 2021
771dc51
Dump the test app's stdout/stderr to stdout. Add a bunch of matching …
imhameed May 14, 2021
6e6b075
Try not resetting the simulator
imhameed May 14, 2021
09da8f2
...
imhameed May 14, 2021
fcfe801
Hack: for tests with a "TestGrouping" (see src/tests/Common/testgroup…
imhameed May 14, 2021
5d4ff75
.
imhameed May 14, 2021
432415a
Hack in simplistic support for loading assemblies from a path relativ…
imhameed May 15, 2021
6165602
Place test assemblies and their supporting files in different subdire…
imhameed May 15, 2021
bf603af
dummy commit
imhameed May 13, 2021
91ebaa5
dummy commit
imhameed May 13, 2021
146543a
Prefix test subdirectories
imhameed May 15, 2021
3aed260
escaping??
imhameed May 15, 2021
9da20dd
Add some interop tests to issues.targets
imhameed May 16, 2021
75801dc
Add "PayloadGroup0" reproducible failures to issues.targets
imhameed May 16, 2021
079d7f7
Exclude more reproducibly failing tests
imhameed May 16, 2021
1992619
Exclude another reproducible issue
imhameed May 16, 2021
6f77899
Add more reproducible failures to issues.targets
imhameed May 17, 2021
d636201
Accumulate more shell script gunk
imhameed May 17, 2021
0f2a312
Try OSX.1100.Amd64.Open
imhameed May 17, 2021
9d0bbc0
Revert "Try OSX.1100.Amd64.Open"
imhameed May 17, 2021
c4c8a71
.
imhameed May 17, 2021
52680a0
.
imhameed May 18, 2021
bcc2b25
Disable another reproducibly failing test
imhameed May 18, 2021
85e1fdc
Exclude more reproducible failing tests
imhameed May 18, 2021
333f3f4
Add more reproducible failures to issues.targets
imhameed May 18, 2021
e20e65d
Remove msbuild debug stuff
imhameed May 18, 2021
908cba3
Fix word misuse
imhameed May 18, 2021
1ba5709
Remove unusued helix pipeline spec for iOSSimulator_x86
imhameed May 18, 2021
bdbc13f
Use just-run instead of run
imhameed Jun 25, 2021
42f50d3
Actually run tests
imhameed Jun 26, 2021
08bd4a4
debug app installation failure
imhameed Jul 8, 2021
675c410
Hard-code support for 64-bit ios simulators in MobileAppHandler.cs
imhameed Jul 8, 2021
2a02020
Use app bundle IDs for just-run, rather than the full host paths used…
imhameed Jul 8, 2021
8ee2314
add --device
fanyang-mono Jul 28, 2021
ba636a6
Remove unnecessary swith `--device`
fanyang-mono Aug 2, 2021
c1eaf98
For now: don't submit tests to helix
imhameed Aug 3, 2021
ffc7320
Adding back the code to make tests run on ios simulator
fanyang-mono Aug 3, 2021
f451eb0
For now: don't submit tests to helix
imhameed Aug 3, 2021
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
10 changes: 7 additions & 3 deletions eng/pipelines/coreclr/templates/helix-queues-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,22 @@ jobs:
runtimeFlavorDisplayName: ${{ parameters.runtimeFlavorDisplayName }}
helixQueues:

# iOS/tvOS simulator x64/x86
- ${{ if in(parameters.platform, 'iOSSimulator_x64', 'tvOSSimulator_x64') }}:
- OSX.1015.Amd64.Open
imhameed marked this conversation as resolved.
Show resolved Hide resolved

# Android arm64
- ${{ if in(parameters.platform, 'Android_arm64') }}:
- Windows.10.Amd64.Android.Open

# Android x64
- ${{ if in(parameters.platform, 'Android_x64') }}:
- Ubuntu.1804.Amd64.Android.Open

# Browser wasm
- ${{ if eq(parameters.platform, 'Browser_wasm') }}:
- Ubuntu.1804.Amd64.Open

# Linux arm
- ${{ if eq(parameters.platform, 'Linux_arm') }}:
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
Expand Down
42 changes: 42 additions & 0 deletions eng/pipelines/runtime-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,48 @@ jobs:
creator: dotnet-bot
testRunNamePrefixSuffix: Mono_$(_BuildConfig)

#
# Build the whole product using Mono and run runtime tests with the JIT.
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
buildConfig: Release
runtimeFlavor: mono
platforms:
- iOSSimulator_x64
variables:
- ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- name: _HelixSource
value: pr/dotnet/runtime/$(Build.SourceBranch)
- ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
- name: _HelixSource
value: ci/dotnet/runtime/$(Build.SourceBranch)
- name: timeoutPerTestInMinutes
value: 60
- name: timeoutPerTestCollectionInMinutes
value: 180
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_Mono_RuntimeTests
buildArgs: -s mono+libs -c $(_BuildConfig)
timeoutInMinutes: 240
condition: >-
or(
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
eq(variables['isFullMatrix'], true))
# Test execution is temporarily disabled because test apps no longer launch
# and the test suite times out after two hours, even if xharness cannot
# successfully launch any tests. Re-enable once these issues have been fixed.
#
# extra steps, run tests
# extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml
# extraStepsParameters:
# creator: dotnet-bot
# testRunNamePrefixSuffix: Mono_$(_BuildConfig)

#
# Build the whole product using Mono for Android and run runtime tests with Android devices
#
Expand Down
13 changes: 9 additions & 4 deletions src/tasks/AppleAppBuilder/AppleAppBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ public string TargetOS
public string MonoRuntimeHeaders { get; set; } = ""!;

/// <summary>
/// This library will be used as an entry-point (e.g. TestRunner.dll)
/// This library will be used as an entry point (e.g. TestRunner.dll). Can
/// be empty. If empty, the entry point of the app must be specified in an
/// environment variable named "MONO_APPLE_APP_ENTRY_POINT_LIB_NAME" when
/// running the resulting app.
/// </summary>
[Required]
public string MainLibraryFileName { get; set; } = ""!;

/// <summary>
Expand Down Expand Up @@ -155,9 +157,12 @@ public override bool Execute()
{
bool isDevice = (TargetOS == TargetNames.iOS || TargetOS == TargetNames.tvOS);

if (!File.Exists(Path.Combine(AppDir, MainLibraryFileName)))
if (!string.IsNullOrEmpty(MainLibraryFileName))
{
throw new ArgumentException($"MainLibraryFileName='{MainLibraryFileName}' was not found in AppDir='{AppDir}'");
if (!File.Exists(Path.Combine(AppDir, MainLibraryFileName)))
{
throw new ArgumentException($"MainLibraryFileName='{MainLibraryFileName}' was not found in AppDir='{AppDir}'");
}
}

if (ProjectName.Contains(' '))
Expand Down
61 changes: 44 additions & 17 deletions src/tasks/AppleAppBuilder/Templates/runtime.m
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,33 @@
munmap (handle, size);
}

static MonoAssembly*
static const char *assembly_load_prefix = NULL;

static MonoAssembly *
load_assembly_aux (const char *filename, const char *culture, const char *bundle)
{
char path [1024];
int res;
if (culture && strcmp (culture, ""))
res = snprintf (path, sizeof (path) - 1, "%s/%s/%s", bundle, culture, filename);
else
res = snprintf (path, sizeof (path) - 1, "%s/%s", bundle, filename);
assert (res > 0);

struct stat buffer;
if (stat (path, &buffer) == 0) {
MonoAssembly *assembly = mono_assembly_open (path, NULL);
assert (assembly);
return assembly;
}
return NULL;
}

static MonoAssembly *
load_assembly (const char *name, const char *culture)
{
const char *bundle = get_bundle_path ();
char filename [1024];
char path [1024];
int res;

os_log_info (OS_LOG_DEFAULT, "assembly_preload_hook: %{public}s %{public}s %{public}s\n", name, culture, bundle);

Expand All @@ -105,19 +125,14 @@
strlcat (filename, ".dll", sizeof (filename));
}

if (culture && strcmp (culture, ""))
res = snprintf (path, sizeof (path) - 1, "%s/%s/%s", bundle, culture, filename);
else
res = snprintf (path, sizeof (path) - 1, "%s/%s", bundle, filename);
assert (res > 0);

struct stat buffer;
if (stat (path, &buffer) == 0) {
MonoAssembly *assembly = mono_assembly_open (path, NULL);
assert (assembly);
return assembly;
if (assembly_load_prefix [0] != '\0') {
char prefix_bundle [1024];
int res = snprintf (prefix_bundle, sizeof (prefix_bundle) - 1, "%s/%s", bundle, assembly_load_prefix);
assert (res > 0);
MonoAssembly *ret = load_assembly_aux (filename, culture, prefix_bundle);
if (ret) return ret;
}
return NULL;
return load_assembly_aux (filename, culture, bundle);
}

static MonoAssembly*
Expand Down Expand Up @@ -260,7 +275,7 @@

// TODO: set TRUSTED_PLATFORM_ASSEMBLIES, APP_PATHS and NATIVE_DLL_SEARCH_DIRECTORIES
const char *appctx_keys [] = {
"RUNTIME_IDENTIFIER",
"RUNTIME_IDENTIFIER",
"APP_CONTEXT_BASE_DIRECTORY",
#if !defined(INVARIANT_GLOBALIZATION)
"ICU_DAT_FILE_PATH"
Expand Down Expand Up @@ -291,6 +306,19 @@
free (file_path);
}

const char* executable = "%EntryPointLibName%";
if (executable [0] == '\0') {
executable = getenv ("MONO_APPLE_APP_ENTRY_POINT_LIB_NAME");
}
if (executable == NULL) {
executable = "";
}

assembly_load_prefix = getenv ("MONO_APPLE_APP_ASSEMBLY_LOAD_PREFIX");
if (assembly_load_prefix == NULL) {
assembly_load_prefix = "";
}

monovm_initialize (sizeof (appctx_keys) / sizeof (appctx_keys [0]), appctx_keys, appctx_values);

#if (FORCE_INTERPRETER && !FORCE_AOT)
Expand Down Expand Up @@ -334,7 +362,6 @@
MONO_EXIT_GC_UNSAFE;
#endif

const char* executable = "%EntryPointLibName%";
MonoAssembly *assembly = load_assembly (executable, NULL);
assert (assembly);
os_log_info (OS_LOG_DEFAULT, "Executable: %{public}s", executable);
Expand Down
Loading