Commit Graph
310 Commits
Author SHA1 Message Date
Parker BibusandAlexander Köplinger f06d2c07d8 [MAUI][PERF] Add IPA file usage for iOS Maui SOD (#66358)
* [PERF][MAUI] Add ios-arm64 logic to create .ipa for perf runs

Switches from simulator builds to device builds so we can track the size for the .ipa.

We generate a dummy codesigning cert and provisioning profile since device builds require that.

* First run with new ipa compatible ios perf setup and ipa app passthrough.

* Temporarily use preview 14 until all packages are synced for 6.0.300 for testing.

* Changed MacCatalyst folder copied on perf setup and made the mono ios app have it's subfolders copied.

* Update the calling args so xcopy knows the files are directories.

Co-authored-by: Alexander Köplinger <[email protected]>
2022-03-09 14:55:02 -08:00
Ankit Jain 95770c9198 [wasm] Add support for symbolicating native traces from JS, using a symbols file (#66042)
* [wasm] Fix run command lines for samples

* [wasm] Export FS_readFile

* [wasm] Add support for symbolicating traces in console errors, or

.. warnings. The regex patterns are hardcoded in `debug.ts`. And the
symbols are loaded from `dotnet.js.symbols`.

We try to symbolicate wherever possible.

* [wasm] Enable symbolicating for non-aot test builds by default

* [wasm] Enable symbol map for debugger tests

* Address feedback from @pavelsavara

* [wasm] Add a `mono_wasm_symbolicate_string` function

.. and use that to symbolicate traces marshaled as C# exceptions (thanks
to @pavelsavara for the suggestion).
2022-03-04 21:38:26 -05:00
Sven Boemer 6246f84506 Run trim analyzer (#65870)
* Use SDK logic for IsTrimmable

* Address some analyzer warnings

* Disable analyzer when baseline suppressions exist

* Don't mark unannotated test project as trimmable

* Add nativeaot annotations

* Add suppression in windows-only code

* Import illink.targets only when trimming mobile tests

* Don't run analyzer on unannotated windows OOBs

* PR feedback

Use pragma instead of UnconditionalSuppressMessage
2022-03-03 14:22:30 -08:00
Ankit Jain 1d60246366 [wasm] Bump sdk for workload testing to 7.0.100-preview.3.22151.18 (#65003)
* [wasm] bump sdk for workload testing to 7.0.100-preview.2.22108.4

* [wasm] dotnet-install.sh logs errors from curl, while trying older urls,

.. don't let that fail the build.

* [wasm] trigger Wasm.Build.Tests when workload-testing.targets changes

* [wasm] trigger Wasm.Build.Tests on CI when eng/Versions.props changes

* [wasm] Update Wasm.Build.Tests to target net7.0 by default

net6 projects don't build with the workload currently. Tests will be
added for that once it is fixed.

* Bump sdk for workload testing to 7.0.100-preview.3.22128.3

* Bump sdk version for workload testing to 7.0.100-preview.3.22151.18
2022-03-02 19:57:08 -05:00
Parker Bibus c41f452cc9 [PERF][MAUI] Add Maui version info to stored data. Runtime Side (#65800)
* Setup pipeline for testing.

* First test with the Maui Version.

* Remove perf-job parameter version typo.

* Try another way of doing the output variable.

* Third times the charm?

* Add a second test for two to be done in one run.

* Fix variable problem with xplat-setup.yml

* Third time was not the charm...

* Try another setup.

* Only include one of the tests as the perf setup is failing potentially due to this.

* Try 2 variable attempts and write out potential get methods.

* Remove failed thing and split them to all be seperate and always run.

* Move variables into the second job stuff.

* Won't run when specified under the job parameters.

* Try hardcoded values to see if it is the output or input that seems to not be connected properly.

* Try new variable format.

* Missed bracket that wasn't found until after most of the way through.

* Maui installs are failing, work around this for variable testing.

* Need to keep mono build enabled.

* Revert "Need to keep mono build enabled."

This reverts commit ff32e46c080efb8a103907de6dd1a13cd0d1be04.

* Revert "Maui installs are failing, work around this for variable testing."

This reverts commit 6dbf6b0ee26d8047d14be86e12e56872c7dab7cc.

* Temp fix for workload install.

* Removed breaking variable test as the new format works along with changing to only having one variable for testing. This should allow us to have access to the maui version in the perf setup for testing.

* Full run test. Still using perf repo fork.

* Add comment explaining RetrievedMauiVersion.

* Add maui version to the iOS runs.

* Undo testing changes to prepare for merge once install is working again.
2022-02-27 19:30:29 -08:00
Parker Bibus 87e7f06ef3 [PERF][MAUI] Update Startup scenarios (#65911)
* Setup pipeline and setup for testing.

* Updated scenario names for new scenario name setup and added no animation tests.

* Revert "Setup pipeline and setup for testing."
2022-02-25 18:17:11 -08:00
Marek Fišera 99898388d5 [wasm] Refactor script to load NPM modules for NodeJS on Helix (#65774)
- Refactor script to load NPM modules for NodeJS on Helix to tests.wasm.targets.
- Move NODE_TLS_REJECT_UNAUTHORIZED=0 to LocalEchoServer.props.
2022-02-24 19:54:31 +01:00
Ankit Jain f35e865f83 [wasm] Use --emit-symbol-map to generate a dotnet.js.symbols (#65162)
* [wasm] Use --emit-symbol-map to generate a dotnet.js.symbols

.. and package it in the runtime pack. This can be disabled with
`$(WasmEmitSymbolMap)`.

* wasm.proj: cleanup

* [wasm] honor XunitShowProgress property

* [wasm] avoid extra build when publishing

* [wasm] WasmAppBuilder: Fix handling of ExtraFilesToDeploy

It incorrectly treated `TargetPath` metadata as a directory.

* [wasm] Disable generation of symbol maps by default

- this is needed because the sdk needs to handle this file specifically,
  and would break tests.
- Once, the sdk gets the fix, then we can turn this on by default.

- For tests, turn it on by default

* [wasm] Deploy dotnet.js.symbols with the tests

* cleanup

* [wasm] dotnet-install.sh logs errors from curl, while trying older urls,

.. don't let that fail the build.

* [wasm] Temporarily disable WasmEmitSymbolMap by default

.. because sdk needs a fix for blazor projects to handle
`dotnet.js.symbols`.

But explicitly enable this for tests.

* Address review feedback
2022-02-24 02:31:56 -05:00
Ankit Jain 2a9745176a [wasm][tests] Fix use of RandomTest*Orderer with trimming (#65754)
With trimming the tests would fail to load the types:
```
[21:11:50] info: Discovered:  System.Runtime.Tests.dll (found 6200 of 6302 test cases)
[21:11:50] info: Could not find type 'TestUtilities.RandomTestCaseOrderer' in TestUtilities for assembly-level test case orderer
[21:11:50] info: Could not find type 'TestUtilities.RandomTestCollectionOrderer' in TestUtilities for assembly-level test collection orderer
```
2022-02-23 00:12:02 -05:00
Ankit Jain cacb3bf4f7 [wasm] Add support for a random test case orderer, for xunit tests (#65628)
* [wasm] Add support for a random test case orderer, for xunit tests

This is enabled by default for wasm with
`$(XUnitUseRandomizedTestOrderer)=true`.

When the library tests run, they print two messages like:

```
  info: Using random seed for test cases: 700149826
  info: Using random seed for collections: 700149826
  info: Starting:    System.Collections.Immutable.Tests.dll
```

These seeds are picked randomly every time the tests are run. To run the
tests with a specific seed, use environment variable
`XUNIT_RANDOM_ORDER_SEED`.

When running with tests, this can be used as:

    `WasmXHarnessMonoArgs="--setenv=XUNIT_RANDOM_ORDER_SEED=<seed>`

* Enable test orderer only for libraries tests

* [wasm] Automatically pass XUNIT_RANDOM_ORDER_SEED envvar to wasm apps

* Disable random test ordering for `System.Xml.RW.XmlWriterApi.Tests`

`System.Xml.Tests.TCCloseOutput.*` tests seem to depend on the order of
execution.

```
[06:35:14] fail: [FAIL] System.Xml.Tests.TCCloseOutput.CloseOutput_4(utils: XmlWriterUtils { Async = False, WriterType = UTF8Writer }, outputType: "Stream")
[06:35:14] info: System.IO.FileNotFoundException : File Not Found: writer.out
[06:35:14] info:    at XmlCoreTest.Common.FilePathUtil.getStream(String filename)
[06:35:14] info:    at System.Xml.Tests.TCCloseOutput.CloseOutput_4(XmlWriterUtils utils, String outputType)
[06:35:14] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```

* [wasm] Disable random tests ordering for `System.Runtime.Loader`

It seems to cause failures like, reproducible with
`XUNIT_RANDOM_ORDER_SEED=2106784294`:

```
[06:25:43] fail: [FAIL] System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(alc: "Empty", assemblyName: "System.Runtime.Loader.Tests", culture: "en")
[06:25:43] info: Assert.Same() Failure
[06:25:43] info: Expected: "Default" System.Runtime.Loader.DefaultAssemblyLoadContext #0
[06:25:43] info: Actual:   "Empty" System.Runtime.Loader.AssemblyLoadContext #4
[06:25:43] info:    at System.Runtime.Loader.Tests.SatelliteAssembliesTests.SatelliteLoadsCorrectly_FromName(String alc, String assemblyName, String culture)
[06:25:43] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```

* [wasm] Disable random test ordering for `System.Runtime.Numerics`

Randomized runs seem to fail with:

```
[03:29:54] info: Starting:    System.Runtime.Numerics.Tests.dll
[03:29:58] fail: [FAIL] System.Numerics.Tests.cast_toTest.RunDoubleExplicitCastToBigIntegerTests
[03:29:58] info: Assert.Equal() Failure
[03:29:58] info:           ↓ (pos 0)
[03:29:58] info: Expected: -0
[03:29:58] info: Actual:   0
[03:29:58] info:           ↑ (pos 0)
[03:29:58] info:    at System.Numerics.Tests.cast_toTest.VerifyDoubleExplicitCastToBigInteger(Double value)
[03:29:58] info:    at System.Numerics.Tests.cast_toTest.RunDoubleExplicitCastToBigIntegerTests()
[03:29:58] info:    at System.Reflection.RuntimeMethodInfo.InvokeWorker(Object obj, BindingFlags invokeAttr, Span`1 parameters)
```

Reproducible with `XUNIT_RANDOM_SEED_ORDER=1883302047`.

* Add issues for the failing tests
2022-02-21 16:58:09 -05:00
Parker Bibus ced5e7a2fd [MAUI][PERF] Reenable Maui w/o package injection (#65409)
* Reenable stuff for android startup.

* Disable package replacement and temporarily most of the perf.yml files.

* Reenable full perf.yml for final test.
2022-02-16 15:56:21 -08:00
Elinor Fung 03494f3dca Disable core dumps when running libraries tests on macOS (#65405) 2022-02-15 18:51:06 -08:00
Jo Shields 14e64115c9 Skip AOT of Microsoft.CodeAnalysis.CSharp.dll for WASM, due to out-of-memory issues in CI (#63958) 2022-02-14 23:12:31 -05:00
Viktor Hofer 20e8f905d0 Don't use Targets* helper properties in libs (#64500)
* Don't use Targets* helper properties in libs projs

This change makes it possible to migrate 200+ (ref+src) projects to use
TargetFramework instead of TargetFrameworks which avoids the additional
outer build evaluation and invocation which ultimately makes the overall
build faster.

Targets* properties (i.e. TargetsWindows, TargetsAnyOS, TargetsUnix,
etc.) rely on the TargetFramework property which usually are set
inside a project. The TargetFramework property is only
available before a project specifies it if it's explicitly set in a props
file or if the project is cross-targeting and the outer-build dispatches
into the inner-build. During the dispatch, the TargetFramework property
is passed in as a global property.

Until now that behavior wasn't a problem because every libraries project
cross-targeted (by setting the TargetFrameworks property) even though
many only include a single TargetFramework (i.e. NetCoreAppCurrent).

To allow projects to use the TargetFramework property instead of
TargetFrameworks, the Targets* helper properties can't be calculated
anymore early in a props file as the TargetFramework property isn't set
at that time.

In general, the guidance by the SDK/msbuild team is to not read from the
TargetFramework property before the project sets it
(in a property group). That effectively means that the TargetFramework
property shouldn't be used in props files at all.

Therefore these helper properties can't be used anymore for property
conditions and I'm replacing their usage with TargetPlatformIdentifier
comparisons for both properties and items.
In nearly all cases, the Targets* helper properties can be replaced with
TargetPlatformIdentifier checks on items and in the few cases where
TargetsUnix or TargetsLinux marks multiple tfms as compatible, the exact
tfms must be used instead for the TargetPlatformIdentifier comparison.

Whenever a project needs to condition properties on the platform, I'm
first setting the TargetPlatformIdentifier the same way the SDK sets it
so that the SDK later doesn't need to set it again to avoid the
additional expensive msbuild function call.

* Use TargetFramework singular to avoid outer builds

Use TargetFramework instead of TargetFrameworks property whenever a
projects only targets a single target framework. This avoid unnecessary
outer builds and evaluations and makes the build faster.
2022-02-12 13:07:16 +01:00
Parker Bibus a1f0147eb6 Update Maui/Mobile pre.py's and disable android due to AOT Issue (#65231)
* Setup testing jobs, change repo to test perf repo, and added apk-name parameter to pre.py for mobile scenarios.

* Update dotnet install type to be daily. This matches the link for installing net 6.0 in the maui contributing dev requirements list.

* Try lowercase package name.

* List post build folder stuff.

* Add android output format as apk.

* Disable package replacement to see if that is the issue location.

* Revert "Disable package replacement to see if that is the issue location."

This reverts commit 31cffe7cb296ccd5796fccccac14edbdbc526452.

* Always try to publish the binlog files.

* Comment out the props file to see if that fixes the AOT error.

* Readd props references.

* Try building without AOT.

* Disable Maui Android Scenarios so that at least iOS on main are being build and measured for SOD.

* Forgot to remove the uploading of the Android APP.

* Disable download attempt of the MauiAndroidApp.

* Reenable full perf run.

* Set the setup branch back to main.

* Undisable MauiScenario.targets file. It semi-causes the AOT issue but should still be enabled for other working builds.

* Add reason for the commented out sections.
2022-02-11 17:21:02 -08:00
Elinor Fung 77d6833b70 Move test with expected crash to outerloop (#65114) 2022-02-11 10:22:24 -08:00
Marek Fišera 1ac45f5161 [wasm] Fix WebSocket tests on NodeJS (#64330)
- Move all SetScriptCommands to a target, so they are placed after scenario in the generated script.
- Add WasmXHarnessArgsCli as an alternative variable that can be used from cli.
- Fix NodeJS symbolic links on Helix.
- Copy TestEchoMiddleware and RemoteLoopMiddleware even for Scenario=NodeJS.
- Enable System.Net.WebSockets.Client.Tests on NodeJS.
2022-02-09 10:27:24 +01:00
Elinor Fung 871438f86d Temporarily disable core dumps when running libraries tests on macOS (#65001) 2022-02-08 11:57:53 -08:00
Michal Strehovský b11469f658 NativeAOT ARM64 libraries testing (#64373)
Enable ARM64 libraries testing for NativeAOT.

* Copy the crosstargeting build approach from crossgen2. We'll now build two ILC compilers when targeting ARM64 from x64: an arm64-hosted one that is useless on the build machine, and a x64-hosted one, that will work on the build machine. The `ILCompiler.csproj/props/_crossarch.csproj` projects mirror crossgen's approach.
* Limit the number of libraries tests to one. Hopefully it avoids the build races that we'd see until we can update the repo build to .NET 7 Preview 1.
* Create an ARM64 NativeAOT CI leg that sends the libraries tests to Helix to run.
2022-02-08 13:33:47 +09:00
Parker Bibus 2eec504163 Update Maui Workload Install Process for Perf (#64692)
*  Add dotnet install and run to test if new dotnet version can be installed similar to how it is done in the Maui repo.

* Download and use local dotnet version.

* Use updated dotnet for more of the pipeline.

* Test with made runtime packs and and add ios arm pack substitution.

* Try building instead of publishing.

* Reenable everything for full test run.

* Package name now seems to default to lower case, at least for maui.
2022-02-03 08:34:33 -08:00
Ankit Jain ee5e6bef92 [wasm] Enable WasmTemplateTests on CI (#64589) 2022-02-03 02:14:40 -05:00
Thays GraziaandAnkit Jain e696cbae2a [wasm][debugger] Implement support to Set Next Instruction Pointer. (#64114)
* Implement Set Next Instruction Pointer.

* Addressing @radical comments.

* Checking if the line number is inside the same function.
Adding test for it.
Adding test for moving the IP to a line that has already a breakpoint.

* Creating tests in async function and lambda as suggested by @radical

* Addressing @radical comments.

* Addressing @radical comments offline

* Adding comment to explain dual invocations.

* Removing unnecessary code.

* Addressing @radical comments.

* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs

Co-authored-by: Ankit Jain <[email protected]>

* Addressing @radical comments.

* Apply suggestions from code review

Co-authored-by: Ankit Jain <[email protected]>

* Removing unnecessary code.Addressing @radical comments.

* Addressing @radical comments.

* Added test as suggested offline by @radical

* Creating tests as suggested by @radical.

* Adding test as suggested by @radical.
Fixing behavior of this new test: moving IP to a nested function.

* Changing order in test.

* Creating new test suggested by @radical.

* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs

Co-authored-by: Ankit Jain <[email protected]>

* Addressing @radical comments.

* Addressing @radical comments.

Co-authored-by: Ankit Jain <[email protected]>
2022-02-02 14:35:59 -03:00
Viktor Hofer ef5803de62 Delete NS2x runtime specific impls (#64610)
* Remove .NETStandard runtime implementations

Remove the remaining ten .NETStandard runtime specific implementations.
For reasoning please see https://github.com/dotnet/runtime/issues/64536.

* Remove infra support for NS platform specific tfms

Also cleaning-up some logic and stop disabling AppendTargetFramework.
2022-02-01 22:51:32 +01:00
Parker Bibus 94f2afb8cf Add Android Maui Startup testing (#64121)
* Setup test pipeline for closest possible setup to what is currently working for android startup with the new adb method being used.

* Fix android scenario problems.

* Use latest xharness version for testing popen fix.

* Wrong branch changed.

* Final run setup for runtime part of the repo.

* Use test branch for full run test and keep it until the test finishes.

* Change perf pull branch back to main, hold until test run is complete.

* Add in iOS runtime builds for sure, and change branch for testing.

* Add in the file extraction of the built ios packs and changed workload typo to runtime to better match actual meaning.

* Revert back to main branch for setup.

* Git missed ios-arm runtime extraction, add that in.
2022-01-31 12:04:35 -08:00
Jan Kotas 3e6eda669c Revert "Temporarily disable coredumps during library testing on macOS (#63742)" (#64057)
This reverts commit 2c28e63f93.

Fixes #63761
2022-01-20 12:51:28 -08:00
Eric StJohn 1d751ba856 Update XUnit to 2.4.2-pre.22 (#63948)
* Update to Xunit build 2.4.2-pre.13

Also pick up latest pre-release of analyzers

* Disambiguate calls to Assert.Equals(double,double,int)

Xunit added a new Assert overload that caused a lot of ambiguous calls.
https://github.com/xunit/xunit/issues/2393

Workaround by casting to double.

* Fix new instances of xUnit2000 diagnostic

* Workaround xUnit2002 issue with implicit cast

Works around https://github.com/xunit/xunit/issues/2395

* Disable xUnit2014 diagnostic

This diagnostic forces the use of Assert.ThrowsAsync for any async method,
however in our case we may want to test that a method will throw
synchronously to avoid regressing that behavior by moving to the async
portion of the method.

* Use AssertExtensions to test for null ArgumentException.ParamName

Workaround https://github.com/xunit/xunit/issues/2396

* Update to Xunit 2.4.2-pre.22

* Fix another ArugmentException.ParamName == null assert
2022-01-20 10:35:50 -08:00
Marek FišeraandPavel Savara 3361b2f86a [wasm] WebSocket tests on NodeJS (#63441)
- NPM package with WS.
- Restore npm during build.
- Load npm modules in test-main.js.

Co-authored-by: Pavel Savara <[email protected]>
2022-01-20 13:58:49 +01:00
Michal Strehovský c66e3c49b5 Add support for libraries testing with NativeAOT (#63781)
This adds support for running libraries tests with NativeAOT. It reuses the single file xunit runner since we cannot `LoadFrom` the tests on NativeAOT. The strategy is the same as for single file testing: do a publish. To do the NativeAOT publish, we include the Microsoft.DotNet.ILCompiler.targets.
2022-01-19 15:01:43 +09:00
Alexander Köplinger 2c28e63f93 Temporarily disable coredumps during library testing on macOS (#63742)
System.Runtime.InteropServices.Tests seems to produce >10GB of coredumps which overwhelms CI.
2022-01-13 22:17:54 +01:00
Jeremy KoritzinskyandTomas 90ec876346 Convert JIT/Methodical/Array/range Pri0 tests and hook up mobile testing (#62752)
Co-authored-by: Tomas <[email protected]>
2022-01-06 13:51:48 -08:00
Elinor Fung 44b9a6ee58 Make DllImportGenerator unit tests' compilations use live refs (#63410) 2022-01-06 14:36:54 -05:00
Marek Fišera cab2fd80cc Fix running WASM tests locally on Windows (#63334)
Set BROWSER_PATH variable only when HELIX_CORRELATION_PAYLOAD variable is set.

Fixes change in the https://github.com/dotnet/runtime/pull/62779.
2022-01-05 08:59:55 +01:00
Steve Pfister 00952e17c4 Pass configuration as a parameter for local Apple mobile test runs (#63348)
Reverts #62549 as the configuration parameter is needed to let xharness know where the iOS/tvOS/MacCatalyst test app is.

For example, a debug test app will be under Debug-iphoneos and a release one will be under Release-iphoneos. Xharness won't be able to tell unless provided the right info.
2022-01-04 15:57:06 -05:00
Maxim Lipnin 1d12267302 Fix setting the configuration parameter in the apple test runner (#63102) 2021-12-24 09:22:36 +03:00
Pavel Savara 61c69c5fed [wasm] fix sample make files & RunScript bash lowercase problem (#63062)
* fix make
* fix lower case $Scenario
2021-12-22 12:48:25 +01:00
Pavel Savara a73d44f100 [wasm] Testing with NodeJs on CI (#62779)
* enable testing with NodeJS on CI
* Fix task marshal tests.
Co-authored-by: Marek Fišera <[email protected]>
2021-12-18 10:14:01 +01:00
Ankit Jain ad3f1c135b [wasm] Add support for running debugger tests CI (#62431)
* [wasm] Don't emit warning if runtimeconfig.json cannot be found

Library projects don't have runtimeconfig.json files by default. So,
don't make it a warning. Instead, emit a low importance which might be
useful when debugging.

But library projects can have runtimeconfig.json, like the runtime test
projects. So, don't limit processing that by OutputType.

IOW, if it's found then use it.

* [wasm] Add timestamp to logs

* Download dotnet-install script for installing workloads

Instead of trying to use the script from `.dotnet`, download the script.
`.dotnet` might not exist, for example, when the `global.json` version
matches the system installed one.

* [wasm] WasmAppBuilder: catch UnauthorizedAccessException also

* [wasm] Fix bug in tests

Some helper methods have a `Action<JToken>` parameter. Many tests
pass an async lambda to this, expecting it to get awaited upon.

```csharp
    EvaluateAndCheck (Action<T> locals_fn)
    {
        ...
        locals_fn(); // no await
        ...
    }

    async Task Test()
    {
        EvaluateAndCheck( async (locals) => {
            ...
            CheckNumber(locals, ...);

            await CheckDateTime(locals, ..);
            ...

        } );
    }
```

In the above example, roslyn generates an async-void lambda, so the
compiler never complains about the async lambda being passed.
`EvaluateAndCheck` cannot, and does not await this, but if the lambda happens to
block, then it will return at that point, and the test(calling method) will end,
without ever completing the lambda. And for most tests, the actual
checks are done in that lambda.

This gets hit when `CheckDateTimeValue` tries to fetch properties of a
`DateTime` object. And it started to show up when adding
`ConfigureAwait(false)` to some calls.

* [wasm] Add Wasm.Debugger.Tests wrapper project

This is a proxy/wrapper project for `src/mono/wasm/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj`.

- Building the project as part of the regular browser-wasm build
  presents some issues, because of part the tests need use the aspnet
  sdk, and that doesn't work with `browser-wasm`.
- This wrapper project essentially builds the `DebuggerTestSuite`
  project, with some
  properties(`TargetFramework;TargetFrameworks;Configuration;TargetOS;TargetArchitecture`)
  removed so they don't propogate from the parent build.
  - And it packages it up for running the tests on helix

- I did try to convert `DebuggerTestSuite` into a `Wasm.Debugger.Tests`,
  and make it use the library tests infrastructure, but ran into an
  issue
  - it built the project with no `testhost.dll`, so can't use `dotnet
    test`
  - it did get `xunit.console.dll`, but that would fail to run the tests
    because of missing `System.Runtime` (and I'm guessing, other
    assemblies)
    - attempts to publish the project failed
    - So, for now, this is what we have!

* [wasm][tests] Make them friendly to running outside the tree

.. like on helix.

Add new `DEBUGGER_TEST_PATH`, and `CHROME_PATH_FOR_DEBUGGER_TESTS` which
will be set for helix.

And change the appbundle directory name from the misleading `publish/`
to `AppBundle/`.

* [wasm] Tests.cs -> MiscTests.cs

* [wasm] Add support for submitting debugger tests to helix

Also, added `eng/testing/scenarios/WasmDebuggerTestsJobsList.txt` which
is a manually generated list of test classes. This will be changed to be
generated at runtime, in an upcoming PR.

* [wasm] Add debugger tests job for linux, and windows

They follow the same pattern as other wasm jobs:

- build when isFullMatrix
- build in runtime-manual
- Additionally, build when there are changes in:

```
  - src/mono/wasm/debugger/*
  - src/mono/wasm/runtime/*
  - src/mono/mono/*
```

* [wasm] Add new make targets to submit tests to helix

`submit-debugger-tests-helix`
`submit-tests-helix` - submits any library test archives

* Build Wasm.Debugger.Tests from src/libraries/tests.proj

* DebuggerTestSuite: Copy files for the test archive

* [wasm] Fix HarnessTests.BrowserClose

* [wasm] Fix building `ApplyUpdateReferencedAssembly` project on CI

Essentially, disable use of SourceLink which gets enabled by default
when using `-p:ContinuousIntegrationBuild=true`.

Issue: https://github.com/dotnet/runtime/issues/62618

* cleanup

* Wasm.Build.Tests: add missing file

* [wasm] sendtohelixhelp.proj: Error out if there is more than one zip

.. file when running for Wasm.Build.Tests, or Wasm.Debugger.Tests .

* [wasm] Disable DebuggerTests.ArrayTests on helix

Issue: https://github.com/dotnet/runtime/issues/62661

Using `[Trait..` instead of `ActiveIssue` because: https://github.com/dotnet/runtime/issues/62660

* disable non-wasma builds

* sendtohelixhelp.proj: guard against no payload found

* Disable more tests

* add back builds

* [wasm][debugger] Disable failing debugger test

`DebuggerTests.BreakpointTests.BreakpointInAssemblyUsingTypeFromAnotherAssembly_BothDynamicallyLoaded`

Issue: https://github.com/dotnet/runtime/issues/62823

* Try to fix windows command line

* Move debugger-tests for linux to runtime-staging

* Revert "[wasm][debugger] Fix source-link test (#62786)"

.. as it is breaking debugger tests build on windows.

Issue: https://github.com/dotnet/runtime/issues/62892
This reverts commit 8151740725.
2021-12-16 15:17:37 -03:00
Pavel Savara 7f09104621 [wasm] Allow the main.js file to keep it's name (#62576)
* allow the main.js file to keep it's name
Co-authored-by: Ankit Jain <[email protected]>
2021-12-10 14:04:27 +01:00
Mitchell HwangandMitchell Hwang c7efe6bca2 [tests] Fix local test runs for mobile (#62549)
Co-authored-by: Mitchell Hwang <[email protected]>
2021-12-09 12:03:24 +03:00
Parker BibusandBill Wert c8ede5c4b1 Add Runtime portion of android startup scenario (#61861)
Add app with debug instrumentation build and download. Add android scenario calls and include xharness.

Co-authored-by: Bill Wert <[email protected]>
2021-12-07 16:27:04 -08:00
Ankit Jain f179b76343 [wasm] Build improvements, and fixes (#61581)
Includes:
- Better error logging, and handling
- Add @(NativeFileReference) to up-to-date check items for VS
- Add `WasmBuild.sln`
- Better fix up of symbol names for pinvokes, and callbacks, based on @lambdageek's suggestion in https://github.com/dotnet/runtime/pull/60814#discussion_r736903990

Fixes dotnet#60862
2021-12-04 01:48:02 -05:00
1bd36302b4 [Wasm] JS modularization (#61313)
Modularized dotnet.js
* By using emcc options MODULARIZE and EXPORT_ES6, depending on WasmEnableES6 to produce ES6 or CommonJS modules respectively.
* WasmEnableES6 enables WasmBuildNative because dotnet.js need to be re-linked
* CommonJS version is able to be loaded into global namespace and behaves as before this change.
* Added new es6/*.js and es6/*.js files which are included in dotnet.js creation. 
* Key aspects are documented in src/mono/wasm/runtime/modularize-dotnet.md of this PR.
* Improved dotnet.d.ts it is now generated into version control too, so that we could observe how it evolves.
* Removed legacy --testing argument and simplified is_testing logic in the the samples.
* Added browser-es6 sample app, which uses WasmEnableES6=true to compile dotnet.js as ES6 module.
* Added browser-legacy sample, which uses dotnet.js CommonJS module and loads it into global namespace.
* Added package.json into the nupkg

Co-authored-by: Ankit Jain <[email protected]>
Co-authored-by: Katelyn Gadd <[email protected]>
Co-authored-by: Marek Fišera <[email protected]>
2021-12-02 10:38:00 +01:00
Adeel Mujahid 6cc2d2e478 Fix a few syntax issues in shell scripts (#62102)
* Fix a few syntax issues in shell scripts

* Cleanup trailing whitespace in changed files
```sh
# git remote add dotnet https://github.com/dotnet/runtime && git pull --rebase dotnet main

if uname 2>/devnull | grep -q Darwin; then
    space=" "
fi

git show --name-only --pretty="" HEAD...dotnet/main |\
    xargs -I{} sh -c "test -f {} && sed -i$space'' 's/[[:space:]]*$//' {}"
```

* Address CR feedback
2021-11-30 17:32:39 -06:00
Ankit JainandRadek Doulik f9dfd41994 [wasm] Misc CI/test run improvements (#61937)
- Update chrome+chromedriver for helix tests to latest stable (`96.0.4664.45`)
- Enable library tests to run on Windows, for manual runs

- Disable windows/AOT builds completely due to https://github.com/dotnet/runtime/issues/61721
- Disable failing WBT tests on windows due to https://github.com/dotnet/runtime/issues/61725
- Disable JS interop tests failing with new chrome - https://github.com/dotnet/runtime/issues/61945

Co-authored-by: Radek Doulik <[email protected]>
2021-11-23 20:17:09 -05:00
Ankit JainandAlexander Köplinger ce93c291e4 [wasm] Run AOT, and Wasm.Build.Tests on windows (#59479)
Adds two new jobs to runtime-staging for Windows - AOT, and Wasm.Build.Tests.

AOT - runs with the same conditions as the one in runtime
Wasm.Build.Tests - run for rolling builds, or when a narrow set of paths related to wasm build change
And do this for corresponding job in runtime for linux

Co-authored-by: Alexander Köplinger <[email protected]>
2021-11-19 20:19:19 -05:00
Pavel Savara da0e0f73e2 [wasm] renames and cleanup before modularization (#61596)
- no imports from outer scope
- move dotnet to -extern-pre-js
- re-enable JS minification with ES2018
- rename main javaScript files to main.js and test-main.js
- sample and test script cleanup
- rename set_exit_code method
- rewrite test start as async method
- improve script loading via script element on page in test
- use BINDING.bind_static_method instead of INTERNAL where possible
- better .d.ts exports
- formatted html files
- renamed modules.ts to imports.ts which makes more sense
- improved error propagation
- renamed __initializeImportsAndExports
- delayed exit and stdout flush
2021-11-17 06:52:25 +01:00
Santiago Fernandez Madero c66fa996b5 Add .runsettings file to be able to run and debug tests on vscode in codespace with prebuilt (#61684) 2021-11-16 14:34:52 -08:00
Ankit Jain 30765864ea InstallWorkload: Use the repo's nuget.config as the base for installing manifests (#60699) 2021-11-09 18:32:40 -05:00
Krzysztof WicherandAnkit Jain 2924d19fbb [wasm][aot] Disable (again) Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests failing due to OOM (#61323)
* [wasm] Disable tests failing due to OOM

Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests
https://github.com/dotnet/runtime/issues/61339

* [wasm] Use special exitcodes when AOT test build fails, and when it gets oom-killed

Co-authored-by: Ankit Jain <[email protected]>
2021-11-09 10:36:07 +01:00
Drew Scoggins c87e932d2b Add back SoD Blazor Pizza Aot test (#61118) 2021-11-02 15:51:49 -07:00