* [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]>
* [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).
* 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
* [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
* 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.
* 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."
* [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
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
```
* [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
* Reenable stuff for android startup.
* Disable package replacement and temporarily most of the perf.yml files.
* Reenable full perf.yml for final test.
* 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.
* 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.
- 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.
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.
* 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.
* 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]>
* 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.
* 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.
* 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
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.
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.
* [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.
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
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]>
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]>
- 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
* [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]>