Граф коммитов

8561 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge f9fbf56544
[xharness] Disable default inclusion behavior for the introspection .NET tests. (#9137)
It gets too annoying to keep track of which files are where with the project
cloning we're doing, if files are implicitly included.
2020-07-21 14:48:52 +02:00
Rolf Bjarne Kvinge 7d47d8742d
[xharness] Don't generate into the same directory/files for macOS Modern and macOS Full. (#9121)
* [xharness] Don't generate into the same directory/files for macOS Modern and macOS Full.

This meant that we were overwriting some generated files, which meant that we
were executing the Modern set of tests instead of the Full set of tests for at
least some configurations.

* Add a few ignored tests to the System.Configuration test now that we actually run it.
2020-07-21 13:15:14 +02:00
monojenkins 6bbcfd4c78
[main][msbuild] Changes GetMinimumOSVersionTaskBase to use ITaskItem for inputs (#9135)
* [msbuild] Changes GetMinimumOSVersionTaskBase to use ITaskItem for inputs

From Visual Studio we need the input files to be  instead of plain strings to identify the files that need to be copied to the Mac

* Adds null check for AppManifest in GetMinimumOSVersionTaskBase

Co-authored-by: emaf <ema@xamarin.com>
2020-07-21 08:31:28 +02:00
Rolf Bjarne Kvinge 858e44aa4d
[xharness] Only try to parse the build log if we have a build log. (#9130) 2020-07-20 14:32:52 +02:00
Rolf Bjarne Kvinge 121032e8f9
[xharness] Fix BCL project generation for watchOS projects. (#9131)
Reading from a file named as the actual content of the watchOS template doesn't
_quite_ work. Instead just use the content directly.
2020-07-20 14:32:42 +02:00
Rolf Bjarne Kvinge ba7e73b5dd
[xharness] Don't replace existing files, instead add new files, when providing human-readable logs. (#9123)
This makes understanding what's going on much easier.
2020-07-20 10:27:07 +02:00
Rolf Bjarne Kvinge 64bc5ea6eb
[xharness] Don't try to write cleaned xml into the same file as the dirty xml was. (#9122) 2020-07-20 10:20:33 +02:00
Rolf Bjarne Kvinge 4f78e8c51b
[xharness] Improve process killing a bit. (#9120)
* Log what we're doing.
* Wait a bit after sending SIGABRT, to allow for the OS to create any crash
  reports.
2020-07-17 18:24:58 +02:00
Rolf Bjarne Kvinge a4d19dad29
[xharness] Try harder to make lldb quit after trying to get a backtrace. (#9119)
When a process times out, we try to print a stack trace for all threads. This
involves executing "lldb --source <script>", where the script contains:

	process attach --pid 1234
	thread list
	thread backtrace all
	detach
	quit

Basically we attach to the project, and ask lldb to print stack traces.

The problem:

    16:09:02.9522580 Printing backtrace for pid=25276
    16:09:02.9528060 /usr/bin/lldb --source /var/folders/q7/mkzwrzcn7bzf3g2v38f3c1cw0000gn/T/tmp58e75d85.tmp
    16:09:04.6127570 (lldb) command source -s 0 '/var/folders/q7/mkzwrzcn7bzf3g2v38f3c1cw0000gn/T/tmp58e75d85.tmp'
    16:09:04.6130020 Executing commands in '/var/folders/q7/mkzwrzcn7bzf3g2v38f3c1cw0000gn/T/tmp58e75d85.tmp'.
    16:09:04.6130200 (lldb) process attach --pid 25276
    16:09:05.6458750 error: attach failed: Error 1
    16:09:05.7529100 25276 Execution timed out after 1200 seconds and the process was killed.
    16:09:05.7588770 Execution timed out after 1200 seconds.

If any of those commands fail, the subsequent commands aren't executed. This
includes the final "quit" command, which means we end up waiting forever for
lldb to do its thing, when lldb doesn't think it needs to do anything at all.

The fix: pass two different scripts. It turns out subsequent scripts are
executed even if previous scripts fail, so we do the equivalent of:

     lldb --source <attach script> --source <quit script>

And now lldb will quit no matter what the attach script does (it still works
even if the attach script succeeds, in which case we'll ask lldb to quit
twice).
2020-07-17 17:34:03 +02:00
Rolf Bjarne Kvinge 3cd9bafbcc
[xharness] Improve code to not throw exceptions in the first place instead of catching and ignoring. (#9118) 2020-07-17 17:33:13 +02:00
Rolf Bjarne Kvinge 7b1592bd4e
[tests] Remove common.mk, it doesn't look like this file is used anymore. (#9115) 2020-07-17 15:26:48 +02:00
Rolf Bjarne Kvinge 026a58b6c4
[monotouch-test] Second attempt at fixing the broken UrlRequestTest.Mutability_30744 test. (#9116)
This has been tested on:

* macOS 10.9, 10.10, 10.11, 10.12, 10.13, 10.14 and 10.15.
* iOS device:
	* iOS 8.2
	* iOS 9.3.5
	* iOS 11.4.1
	* iOS 13.6
2020-07-17 15:26:38 +02:00
Rolf Bjarne Kvinge c394c12c54
[xharness] De-asyncify template expansion. (#9104)
This avoids:

* Getting the resource stream for every template expansion
* Reading the resource stream
* A lot of async code.

Instead just read the resource stream once, into a string, and return that.

This speeds up the startup by ~10% (from ~0.96s to ~0.83s on my machine).
2020-07-17 11:09:09 +02:00
Rolf Bjarne Kvinge 965245086d
[apitest] Sleep for 0.05s instead of 0.5s. (#9108)
This makes these tests exactly 3.6s faster.
2020-07-17 11:00:51 +02:00
Rolf Bjarne Kvinge d0241e1707
[apitest] Refactor tests to not be async. (#9109)
* [apitest] Refactor tests to not be async.

The macOS tests will soon be upgraded to use the official NUnit[Lite], and in
that case we can't use async tests, because they end up deadlocking the
processes.

So refactor the two tests this affect to not be async, but instead use other
methods of accomplishing the same thing.

* Fix grammar

Co-authored-by: Whitney Schmidt <whschm@microsoft.com>
2020-07-17 08:51:53 +02:00
Rolf Bjarne Kvinge 92821b5dec
[xharness] Parse NUnit v2 xml reports correctly. (#9110) 2020-07-17 08:50:00 +02:00
Rolf Bjarne Kvinge 2995cd086a
[tests] Update tests to make native type vs normal type comparison explicit (#9097)
We've modified our NUnitLite to special-case the native types, so that they
can easily be compared with the standard types, but that doesn't work anymore
when switching to the official NUnit[Lite], so change all asserts to
explicitly convert whenever needed.
2020-07-17 08:48:09 +02:00
Rolf Bjarne Kvinge 4235dfbff7
[mmp] Use the right pkg-config directory. (#9105) 2020-07-16 17:57:15 +02:00
Rolf Bjarne Kvinge 7509c6bfcd
[xharness] Fix finding testable types in test assemblies. Fixes #xamarin/maccore@2267. (#9103)
Apparently a null namespace when using Reflection can be an empty namespace in Cecil.

Fixes https://github.com/xamarin/maccore/issues/2267.
2020-07-16 17:16:25 +02:00
Chris Hamons 5657a63539
Add support for arbitrary extensions to be bundled in XI/XM apps (#9048)
- This commit adds a hook, "AdditionalAppExtensions", to the msbuild to allow
extensions written in other languages, such as Swift, to be embedded and signed in an
Xamarin App bundle easily.
- Example:
<AdditionalAppExtensions Include="$(MSBuildProjectDirectory)/../../native">
	<Name>NativeTodayExtension</Name>
	<BuildOutput Condition="'$(Platform)' == 'iPhone'">build/Debug-iphoneos</BuildOutput>
	<BuildOutput Condition="'$(Platform)' == 'iPhoneSimulator'">build/Debug-iphonesimulator</BuildOutput>
</AdditionalAppExtensions>
2020-07-16 10:13:15 -05:00
Rolf Bjarne Kvinge 4b0fd5529c
[xharness] Don't group simulators when running in server mode. (#9098)
Grouping simulators means we have to wait until we know which simulators are
available, because we group by the simulator's UDID.

When running in server mode, we don't need to group simulator test runs,
because we run the as the user chooses, not in any particular order.

This way the test list loads faster at startup, since we don't have to wait
until we've loaded the simulators before we can show the list.
2020-07-16 08:20:51 +02:00
Rolf Bjarne Kvinge 839f586344
[monotouch-test] Fix broken UrlRequestTest.Mutability_30744 test. (#9096)
* [monotouch-test] Fix broken UrlRequestTest.Mutability_30744 test.

This test is supposed to assert that setting a header on an immutable
dictionary throws an exception.

The problem is that the tested code always throws an exception: either when
setting the header, or when asserting right after because no exception was
thrown, effectively always passing.

This showed up with current versions of NUnit[Lite], which keeps track of
assertion failures, and fails a test even if those assertion
failures/exceptions are caught in exception handlers.

So remove the whole exception verification logic, and just try to set the
value. We'll see if the test start failing somewhere (I've already tested both
on device and simulator, and no problems found so far).

* Remove a simulator condition.

It works on device for me (iPhone 7 with iOS 11.4.1)... maybe Apple changed
something?
2020-07-16 08:20:09 +02:00
Rolf Bjarne Kvinge e344698612
[tests] Use Assert.Throws instead of the ExpectedException attribute. (#9092)
* [tests] Use Assert.Throws instead of the ExpectedException attribute.

The ExpectedExceptionAttribute doesn't exist in newer versions of NUnit[Lite] anymore.

* [monotouch-test] Rework some CaptiveNetwork tests.

They need permissions, and entitlements, and something else I couldn't figure
out, so just assert they're returning null instead.
2020-07-16 08:19:33 +02:00
Rolf Bjarne Kvinge 3ac93d2330
[monotouch-test] Comparing uint to int for inequality doesn't work newer versions of NUnit[Lite]. (#9094)
So make sure we pass two values of the same type to Assert.AreNotEqual.
2020-07-16 08:19:01 +02:00
Manuel de la Pena fcc410f36a
[DevOps] Add debugging messages from when we fail the ./configure (#9102)
Some bots are giving error with this step. Try to add some verbosity and
ensure that $? is 0 when done.
2020-07-15 20:13:57 -04:00
Manuel de la Pena 3fccc1e3e0
[DevOps] If we cannot clear the hd, continue. (#9101)
Few things:

1. Move from Write-Error to Write-Debug so that we do not set the exit
code and an error.
2. Ig we fail in the Clear-HD step, continue, we should be ok or cancel
if not enough space is found.
2020-07-15 20:13:34 -04:00
Manuel de la Pena f13fe4ba30
[DevOps] In a self-hosted pool we need to specify the os. (#9100) 2020-07-15 18:51:37 -04:00
Rolf Bjarne Kvinge a59742a8ec
[monotouch-test] Use Is.EqualTo instead of Is.EquivalentTo for equal arrays. (#9093)
The latter is much, much, *much* slower when using a recent version of NUnit[Lite].

I have no idea exactly how much slower, because it was so slow that I got
tired of waiting, and stopped the tests.

So use EqualTo instead, since the arrays should be equal in the first place.
2020-07-15 18:07:57 +02:00
monojenkins 22ff73b52c
[msbuild] Allow overriding CompileAppManifestTaskBase Execute method (#9090)
If the Execute method of a task is sealed the Windows side tasks won't be able to "inject" the code that executes the tasks remotely.

Co-authored-by: emaf <ema@xamarin.com>
2020-07-15 16:50:48 +02:00
Rolf Bjarne Kvinge 93b5c223d6
[tests] Provide an ignore reason for Ignore attributes. (#9091)
Newer versions of NUnit[Lite] require this.
2020-07-15 14:50:54 +02:00
Rolf Bjarne Kvinge 6c4e357d3b
[monotouch-test] Fix debug naming. (#9084) 2020-07-15 09:05:34 +02:00
Rolf Bjarne Kvinge 7beb88089a
[xharness] Use Cecil to inspect assemblies, instead of Reflection. (#9082)
This is slightly faster - ~0.95s vs ~1.4s - (probably because reflection tries
to load a lot of other referenced assemblies, which may or may not exist,
causing exceptions (if they don't exist) or spend time loading them (which
Cecil won't)).

It also avoids a lot of exception details showing up when tracing xharness
execution.
2020-07-15 09:01:31 +02:00
Matthew Leibowitz b70d25d011
Include assembly refs in _CompileToNative Inputs (#9071)
* Include assembly refs in _CompileToNative Inputs

Fixes #9014

* Unify with iOS

Sort of match this: 64c63279b3/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Common.targets (L573-L595)

* Update Xamarin.Mac.Common.targets
2020-07-14 14:54:26 +02:00
Rolf Bjarne Kvinge 64c63279b3
[xharness] Add support for generating a tvOS version of .NET iOS projects. (#9032)
* [xharness] Add support for generating a tvOS version of .NET iOS projects.

And use it to run the tvOS version of introspection for .NET.

* [xharness] Change according to reviews.
2020-07-13 17:12:11 +02:00
Rolf Bjarne Kvinge 96327dee88
[monotouch-test] Use a normal thread instead of MulticastDelegate.BeginInvoke in AVAssetImageGeneratorTest. (#9067)
MulticastDelegate.BeginInvoke isn't supported in .NET.

Ref: https://github.com/dotnet/runtime/issues/16312
2020-07-13 15:07:05 +02:00
Rolf Bjarne Kvinge b46aae7fd6
[msbuild] Make the ParseExtraMtouchArgs task platform-agnostic, and share it between Xamarin.iOS and Xamarin.Mac. (#9061)
* Change the parsing code slightly, to make it easier to parse other arguments
  (coming soon).
* Add the parsing task to Xamarin.Mac projects, and use it there as well. The
  parsed result isn't used yet, but it will be soon.
* Unify a few related MSBuild properties (MtouchNoSymbolStrip and
  MtouchNoDSymUtil).
2020-07-13 14:56:34 +02:00
kiddailey 97d09a7b24
Add AutoFill CredentialProvider NSExtensionPoint support (#9030)
* Fix unrecognized extension build warning for credential providers

* Bump Xamarin.MacDev.

New commits in xamarin/Xamarin.MacDev:

* xamarin/Xamarin.MacDev@5e08f5f Add AutoFill CredentialProvider NSExtensionPoint support (#75)

Diff: a1bc6f39b3..5e08f5f2fd

* Add IDE deployment target for credential provider

Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-07-13 14:50:23 +02:00
Manuel de la Pena 773df34fde
[DevOps] Fix issues with the xm storage path. (#9043)
* [DevOps] Fix issues with the xm stroage path.

For some reason, and it is very probably a bug in the azurepipelines,
the following bash code creates a path with an extra single quote at the
end:

```bash
 P=jenkins/xamarin-macios/$BUILD_LANE/$BUILD_REVISION/$ID/device-tests

echo "##vso[task.setvariable variable=XM_STORAGE_PATH]$P"
```

* Should it do it? Not, it should not.
* Does it do it? Yes, it does.

We work around it via td -d \'\" and remove all single and double quotes
in the string. How long did it take to discover this? More than it
should have.

There is another interesting bug with the variable expansion, the
following
```bash
echo '##vso[task.setvariable variable=XAMARIN_STORAGE_PATH;isOutput=true]$P'
```
Does not equal
```bash
echo '##vso[task.setvariable variable=XAMARIN_STORAGE_PATH;isOutput=true]'$P
```

The first will not expand the variable, the second one will. We do need
the value of $P not '$P'.


Co-authored-by: Whitney Schmidt <51677938+whitneyschmidt@users.noreply.github.com>
2020-07-10 17:19:59 -04:00
Manuel de la Pena 9eff2f2964
[DevOps] Move back to self hosted windows pools. (#9040)
The microsoft hosted images have a limit of 10gb, or logs are getting
close to that size when expanded, therefore we will get into issues.
Move back to the self-hosted pool before we have problems.
2020-07-08 18:57:56 -04:00
Rolf Bjarne Kvinge 80c3cc0028
[src] Create a Constants.cs file for Constants that are in all platforms. (#9031) 2020-07-08 18:04:38 +02:00
Rolf Bjarne Kvinge 400d0f65fa
[AVFoundation] Ignore a few compiler warnings about missing overrides for comparison support. (#9033) 2020-07-08 18:04:28 +02:00
Sebastien Pouliot 1b09465acf
[tests][xtro] Fix NSUrl-based categories (#9029)
We were using the managed name, e.g. `NSUrl`, instead of the native name,
e.g. `NSURL`, when dealing with categories.

To fix this we must resolve the type and this caused issues as other
assemblies (e.g. OpenTK) were not already loaded/cached and some type
could not be resolved (and this throw exceptions)

The runner now loads all assemblies before starting to visit them.

The fix solved a known issue (iOS-NetworkExtension.ignore), some API
that were already bound (common-Foundation.ignore) and also caught an
additional API where we missed a `[NullAllowed]` on a return value
2020-07-08 09:26:54 -04:00
Manuel de la Pena f4d165863a
[DevOps] Clean all workspaces and try to fix our space problems. (#9028) 2020-07-07 18:45:50 -04:00
Rolf Bjarne Kvinge e193ed7316
[msbuild] Unify all the UsingTask statements. (#8998)
Some of these have been duplicated across various targets files, and when
adding a new task it's annoying to forget to add it somewhere.

So just have them all in the same place, so that they're loaded in every file.

There are still duplicates between the iOS and Mac tasks, but those will be
unified in a later PR.
2020-07-07 15:52:06 +02:00
Rolf Bjarne Kvinge ac36305a2d
[msbuild] Unify the _GenerateBindings target and a few properties related to binding projects. (#8997) 2020-07-07 15:46:23 +02:00
Rolf Bjarne Kvinge 4e2d612dae
[msbuild] Unify XamarinMacFrameworkRoot and MonoTouchSdkRoot into _XamarinSdkRoot. (#8995) 2020-07-07 15:45:42 +02:00
Manuel de la Pena edd8a2c896
[Foundation] Avoid LINQ in bindings. Fixes #8773 (#8991)
LINQ was giving issues in a client application with the Link SDK
enabled. The root cause is that we had issues in the LINQ operations
that are used to create the headers for the native request.

We fix this by:

1. Do not modify the managed request headers. Do not modify an object we
   do not own.
2. Remove the use of LINQ

This issue was probelmatic when the client application was setting the
headers that are used by the HttpContent. If headers were not added in
the content, the issues did not happen.

Co-authored-by: Alex Soto <alex@alexsoto.me>
2020-07-06 10:51:50 -04:00
Manuel de la Pena e1d537107f
[Foundation] Do expose server errors. (#8990)
Creating a good API is hard. The delegate DOES return two different
errors.

1. Client errors in the error variable in the delegate method.
2. Server errros in the error in the task in the delegate method.

We need to expose both of them to the user in case there is an issue in
any of them. An exception should be thrown ig any is not null.

PD: As per apple docs:

> The only errors your delegate receives through the error parameter are
> client-side errors, such as being unable to resolve the hostname or
> connect to the host. To check for server-side errors, inspect the
> response property of the task parameter received by this callback.
2020-07-06 10:51:06 -04:00
Rolf Bjarne Kvinge 9a17e053b7
[dotnet] Add some project capabilities. (#9013)
* [.NET 5] Start adding some project capabilities (#3)

Aligned with XA too, see https://github.com/xamarin/xamarin-android/pull/4383.

We'll start using Apple instead of iOS for these things at the IDE level since many
behaviors don't actually depend on iOS but also apply to tvOS, watchOS, and so on.

These capabilities go before other imports just in case additional packages/targets
from the SDK need to access them too.

* Remove the LaunchProfiles capability for the CPS integration (#8472)

Implements https://work.azdo.io/1112733 as a workaround for the conflicts between
the built-in launchsettings.json-based .NET Core debugger and our Mono debugger.

Co-authored-by: Daniel Cazzulino <daniel@cazzulino.com>
2020-07-06 14:31:27 +02:00
Rolf Bjarne Kvinge 31f4a2e22a
[tests] Skip a few networking tests on macOS 10.9. Fixes #xamarin/maccore@2221. (#9012)
Fixes https://github.com/xamarin/maccore/issues/2221.
2020-07-06 13:26:09 +02:00