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

7565 Коммитов

Автор SHA1 Сообщение Дата
Manuel de la Pena 8a52fcd812
[Makefile] Make csc strict and fix some small errors. (#7665)
* [Makefile] Make csc strict and fix some small errors.

Make csc to bee more strict when compiling the projects and mix some
small errors we had in the bindings.

Fixes: https://github.com/xamarin/xamarin-macios/issues/5398
2020-01-02 13:57:22 -05:00
Manuel de la Pena fffa889f22
[Foundation] Add CookieContainer support in NSUrlSessionHandler. (#7654)
There are two important things to look at this:

1. That we do set the cookies that are present in the CookieContainer in
the request. That is, we need to set Cookie headers for all of them.
2. That if we receive a Set-Cookie from the server, the CookieContainer
gets correctly updated else we will have issues since we do not respect
the data sent from the server side.

Tests show both that we are setting the Cookie header and that we honour
the Set-Cookie header.

Fixes: https://github.com/xamarin/xamarin-macios/issues/5665
2019-12-27 15:36:47 -05:00
Manuel de la Pena a25e676e5e
[Tests] Update the tests.sln to take into account the new splitted tests. (#7655) 2019-12-27 11:17:40 -05:00
Manuel de la Pena 87cdcf4b3c
[BCL Tests] Make sure that the xUnit runner is not too greedy. (#7653)
The tests in xunit are ran in parallel, the default number of threads is
to large which is making the iOS watchdog kill the process before we are
done with the tests.

The default value is either 0 (use as many as possible) of the
Enviroment.ProcessorsCount value, in our case we divide that by two to
make sure we do not use too much CPU.

Fixes: https://github.com/xamarin/maccore/issues/2083
2019-12-27 11:15:50 -05:00
Sebastien Pouliot 9eac081031
[msbuild] Avoid lines starting with a whitespace inside generated response files. Fix #7645 (#7647)
Since the "quote" refactoring there's no real difference between `Add*`
and `Add*Line` methods, everything is now line-oriented.

However `Add` and `AddQuoted` behaved differently, which meant that `Add`
would add a whitespace before a new argument in the `StringBuilder` was
not empty (as a separator needed _when_ different lines were not used).

That resulted in response files that had some lines starting with a white
space. That was not an issue (spec [1] wise) but it broke some (not so
correct) assumptions in `mtouch` and could also break anything that added
comments (which must start with `#`) in the future.

This brings consistency in the output whether quoted/non-quoted arguments
are used.

Reference:
[0] https://github.com/xamarin/xamarin-macios/issues/7645
[1] https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/response-file-compiler-option
2019-12-27 09:15:52 -05:00
Vincent Dondain a1e695b272 [DevOps] Don't be too fancy with multiple jobs for device tests pipeline
Inspiration was taken from other yaml pipelines but those multiple jobs are not behaving the way I expected.

1. Each job will clone `xamarin-macios` in a dedicated folder (for 3 jobs you'll have `./1/s`; `./2/s`; `./3/s`)
2. The goal of the last job was to upload the `TestSummary.md` but because of the cloning strategy it couldn't find it. There might be ways to pass files (artifacts?) between jobs but there's no need to be that fancy right now.
3. Cloning takes time so I'm assuming having everything in one job can actually save us some time.
2019-12-26 09:13:41 -05:00
Vincent Dondain 5f89458a49 [DevOps] Fix DDFun pipeline GitHub comment report
- We had `./jenkins/vsts-device-tests-set-status.sh: line 88: HTML_REPORT: unbound variable` in the `Report results to GitHub as comment / status` step. Now that the HTML_REPORT is set this shouldn't happen anymore.
- The `Add summaries` task is reporting errors but it's working regardless. I believe this might be due to -x being set instead of the original +x (I changed that by mistake).
2019-12-26 09:13:41 -05:00
Manuel de la Pena 1c3bd7f114
[XHarness] If there are issues generating the BCL tests for mac dont crash. (#7646) 2019-12-23 19:04:09 -05:00
Manuel de la Pena 4c6181e904
[Test] Bump mono and use the new splited tests. (#7626)
Bump mono to get the new splited test dlls and add them to be ran in
xharness. Special logic is used for mscorlib so we make sure that all
the 'parts' of the test dll do have the same configurations.


Co-Authored-By: Waleed Chaudhry <54864665+wachaudh@users.noreply.github.com>
2019-12-23 18:39:41 -05:00
Marius Ungureanu de34b5e178 Fix NSUuid constructor. Pinning is only for the duration of the fixed statement (#7643) 2019-12-23 16:57:46 -05:00
Vincent Dondain f1b92747c7
[DevOps] Convert our device tests into a pool agnostic yaml pipeline (#7604)
- Needed for the DDFun migration of our tests
- Don't use SSH because it's restricted on the new bots
- Use brand new DevOps feature to clone multiple repos via HTTPS
- Update names of all tasks (clearer)
- Simplify and re-use code
- Update all paths because our cloning strategy is different compared to old pipeline
- Update xharness to print "experimental" titles in GitHub comments
- Update xharness to not add the Html link for tests from the DDFun pipeline
- Fix all timeouts to be relevant to the tests length
- Split in multiple jobs (for GitHub status)
- Move longer scripts to independant files
- Make inline bash prettier
- Use a variable for the pool name
- Fix single space alignment
- Remove unused variable in `vsts-device-tests-set-status.sh` that broke it
- Bump maccore to use the right certificates and profiles
- Bump maccore to target the right pipeline
- Bump maccore to not use ssh in scripts
- Bump maccore and use persistCredentials

Notes:
- Right now the xharness test output can only be seen when downloading the zip file locally (better output soon)
2019-12-23 14:34:41 -05:00
Rolf Bjarne Kvinge 5c7b669b5b [msbuild] Don't leave changes behind if a test fails. (#7636) 2019-12-23 13:30:12 -05:00
Rolf Bjarne Kvinge b107841f13 [msbuild] Don't use events and methods that are obsolete and do nothing. (#7637)
Fixes these warnings:

    IPhoneSdks.cs(22,4): warning CS0618: 'AppleSdkSettings.Changed' is obsolete: 'This event is never raised' [/work/maccore/onedotnet/xamarin-macios/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Tasks.Core.csproj]
    IPhoneSdks.cs(31,4): warning CS0618: 'AppleSdkSettings.CheckChanged()' is obsolete: 'This method does nothing' [/work/maccore/onedotnet/xamarin-macios/msbuild/Xamarin.iOS.Tasks.Core/Xamarin.iOS.Tasks.Core.csproj]
    MacOSXSdks.cs(18,4): warning CS0618: 'AppleSdkSettings.Changed' is obsolete: 'This event is never raised' [/work/maccore/onedotnet/xamarin-macios/msbuild/Xamarin.Mac.Tasks.Core/Xamarin.Mac.Tasks.Core.csproj]
    MacOSXSdks.cs(25,4): warning CS0618: 'AppleSdkSettings.CheckChanged()' is obsolete: 'This method does nothing' [/work/maccore/onedotnet/xamarin-macios/msbuild/Xamarin.Mac.Tasks.Core/Xamarin.Mac.Tasks.Core.csproj]

Also bump Xamarin.MacDev to pick up updated Xamarin.MacDev:

* xamarin/Xamarin.MacDev@0f578f5 [tests] Upgrade to NUnit 3.12 and use package references. (#65)
* xamarin/Xamarin.MacDev@55a30e2 [tests] Adjust tests to not expect the provisioning profiles in the index in any particular order. (#63)
* xamarin/Xamarin.MacDev@dc270f6 Make methods that do nothing obsolete and fix a compiler warning. (#67)
* xamarin/Xamarin.MacDev@681aef6 Remove unused csproj. (#66)
* xamarin/Xamarin.MacDev@d78a92f Update gitignore (#55)

Diff: ca221c8fd6..0f578f51e6
2019-12-23 13:29:34 -05:00
Marius Ungureanu 319c617aaf Fix some warnings in the build (#7642) 2019-12-23 13:07:17 -05:00
Chris Hamons e316fc38b5
[mmp][mtouch] Drill into wrapped exceptions to produce better linker errors
- https://devdiv.visualstudio.com/DevDiv/_workitems/edit/947932
- It turns out the linker in some cases can wrap expected exceptions in a outer exception. By drilling in we can produce better errors, again.
- Refactor pipeline exception handling to be shared between mmp/mtouch
2019-12-23 09:57:48 -06:00
Sebastien Pouliot 2694579530
[mtouch] Fix case where `copyfile` could fail silently (#7633)
Copying the framework could fail (error 260) and the failure was never
reported so the build succeeded - but without updating (completely) the
framework.

The exact reason it fails is unknown :( but we can recover from it by
deleting the target and copying (everything) back to the expected
(target) location.

Build logs will now indicate when this fails and will try to recover
before reporting a build error. Best case it works :) worse case we'll
be aware something is wrong (which is better than ignoring)

This is half the fix from https://github.com/xamarin/xamarin-macios/pull/7544
which was reverted due to the second half causing a regression (under
investigation).

Reference: https://github.com/xamarin/xamarin-macios/issues/7514 (partial fix)
2019-12-23 09:18:04 -05:00
Manuel de la Pena 2c0366cc0d
[Foundation] Provide a strong dictionary for proxy configuration. (#7640)
Although we provide the correct property to set the proxy configuration,
we do not add a strong dict that will make it nicer for users. This
fixes that API.

Fixes: https://github.com/xamarin/xamarin-macios/issues/5811
2019-12-21 11:01:32 -05:00
Manuel de la Pena f33ed7ac12
[xharness] Do not trace the reflection exceptions used for the BCL. (#7631) 2019-12-20 11:36:03 -05:00
Rolf Bjarne Kvinge a0beca28f9
[msbuild] Use package references. (#7621)
One of many steps towards building for netstandard 2.0.
2019-12-20 17:23:09 +01:00
Rolf Bjarne Kvinge 0ec82e7cca
[sample-tester] Collect app size and build duration statistics. (#7602)
* [sample-tester] Collect app size and build duration statistics.

* Always publish performance data.

* [mmp] Add support for MMP_ENV_OPTIONS to mirror mtouch's MTOUCH_ENV_OPTIONS.

* [sample-tester] Make mmp/mtouch show timing information, and get the diagnostic msbuild log.

* Collect task and target info.

* Add more perf data and a baseline test.

* Redo the base test a bit.

* More tweaks.

* More tweaks.

* Huh?

* Debug stuff.

* diagnostics.

* Better diagnostics.

* cleanup

* tmp

* Use a separate stage to push data.

* Next attempt.

* Unique artifact names.

* Make the right name unique.

* More progress

* Improvements

* Don't need new maccore.

* cleanup

* Remove debug spew.

* Realign stuff.

* duh

* More path fixes.

* zippity zip.

* Show publishing errors.

* dependencies

* Not fake results anymore.

* Tweaks

* Merge xml files

* [sampletester] Bump nuget timeout to 5 minutes.

The TodoREST.iOS test seems to use a lot of packages, and it can apparently
take a while to restore them, so give a few more minutes.

* Improvements.

* Fix glob.

* [sampletester] Fix fetching of sample repository and hash.

* [sampletester] Centralize verbosity for mtouch and mmp.
2019-12-20 16:27:36 +01:00
Manuel de la Pena 002b4dffd2
[xharness] Support the split of test assemblies from the BCL. (#7625)
Some of the test assemblies are too large and will be splitted by mono so
that they can be compiled for iOS 32b. In that case, we are using the
following pattern

`
test_assembly_name.dll
`
becomes
`
test_assembly_name.part1.dll
test_assembly_name.part2.dll
`
Perse the only change we need to add to make our life easier is to be
able to mantain a single .ignore file since mantaining more .ignore
files is hard and more error prone. This change simply checks if we are
working with a splitted dll and ensures that the correct .ignore files
are added to the BCL test application.

Co-Authored-By: Pramit Mallick <prmallic@microsoft.com>
2019-12-19 09:29:43 -05:00
Rolf Bjarne Kvinge cf97aaf971
[msbuild] Don't use gdk-sharp, use native functions instead. (#7623)
* [msbuild] Don't use gdk-sharp, use native functions instead.

There's no netstandard version of gdk-sharp.

* Don't require the source checkout to be named 'xamarin-macios'.
2019-12-19 15:21:09 +01:00
Alex Soto 01f6710a15
Merge pull request #7620 from dalexsoto/master-xcode11.3
[master] Merge Xcode 11.3 into master
2019-12-18 18:52:20 -05:00
Rolf Bjarne Kvinge 6ceb45c9fc
Merge pull request #7611 from rolfbjarne/msbuild-use-system-text-json
[msbuild] Use System.Text.Json instead of System.Json, since only the former is available in .netcore.
2019-12-19 00:35:04 +01:00
Rolf Bjarne Kvinge 3d465f4149
[msbuild] Use mono's coding style. (#7622) 2019-12-18 19:20:16 +01:00
Alex Soto d527862915
[xharness] Fix ExecuteCommandAsync args parameter 2019-12-18 12:19:22 -05:00
Marius Ungureanu fb9bc22d06 GetParameters should _never_ return null (#7554) 2019-12-18 11:40:13 -05:00
Marius Ungureanu 3386acb6ea Switch to Array.Empty and use Marshal.Copy instead of manual copying (#7559)
Switch to Array.Empty and use Marshal.Copy instead of manual copying


Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>
2019-12-18 11:39:29 -05:00
Marius Ungureanu 7b1049cf24 Wrap some objects in using statements (#7560)
* Wrap some objects in using statements

* Switch to using statement.
2019-12-18 11:28:23 -05:00
Rolf Bjarne Kvinge 8c589c0093
[msbuild] Remove unused file. (#7610) 2019-12-18 07:15:49 +01:00
Alex Soto 28f8313b1b
Use the latest mono 2019-10 to get Xcode11.3 binaries 2019-12-17 19:36:07 -05:00
Alex Soto 9ac17bdbcf
Merge remote-tracking branch 'xamarin/xcode11.3' into master-xcode11.3 2019-12-17 19:25:11 -05:00
Manuel de la Pena 867dcfaa77
[Tests] Split groups so that they work on iOS 32b. (#7612)
After this commit we will have more application but they will be the
appropiate size so that they can be built with the linker for iOS 32b.
It is important to note that the following apps WILL CONTINUE to fail
since the dlls need to be splitted in mono:

* mscorlib tests
* Mono BCL tests group 5 - Which is monotouch_System.Core_xunit-test.dll
and is too large.
2019-12-17 17:09:28 -05:00
monojenkins aaafa2df6f [xharness] Don't try to parse log files that don't exist. (#7614)
Makes xharness throw fewer exceptions, which makes tracing output simpler to read.
2019-12-17 17:04:00 -05:00
monojenkins a6c714fa84 [xcode11.3] [monotouch-test] Simplify NetworkReachabilityTest.CtorIPAddressPair test. (#7613)
* [monotouch-test] Improve reachability test.

Tested on:

* All macOS versions we support (10.9 -> 10.15).
* tvOS device: 13.2
* iOS devices: 8.2, 9.3.5, 10.3.3, 11.4.1, 12.4.1, 13.3
* iOS simulators: 10.3, 11.0, 12.0, 13.2.
* tvOS simulators: 10.2, 13.2

* Yay Apple!

* Give up.

* Revert unneeded change.
2019-12-17 16:07:22 -05:00
Rolf Bjarne Kvinge 015cbf1efc [msbuild] Use faster string comparison (OrdinalIgnoreCase). 2019-12-17 18:55:16 +01:00
Rolf Bjarne Kvinge ca88b95c0e [msbuild] Tell ILRepack where netstandard.dll can be found.
System.Text.Json references netstandard.dll, and ILRepack needs to be able to find it.
2019-12-17 11:34:27 +01:00
Rolf Bjarne Kvinge 0d299e0eb8 [msbuild] Calculate assemblies to be IL merged differently.
We now need to merge System.Text.Json into the final assembly, which means all
the System.Text.Json dependencies as well (there are quite a few), so adjust
the logic to figure out which assemblies to be merged to include every
library, except:

* MSBuild assemblies
* Resource assemblies
* System assemblies.
2019-12-17 11:34:24 +01:00
Rolf Bjarne Kvinge b7a50608f6 [msbuild] Adjust the Bug60536 test so that it continues to fail as expected after switching json parser.
The Bug60536 is about showing a good error message if the json in an asset
pack is invalid. It turns out that System.Text.Json is a bit more permissive
than System.Json, so the json that was previously failing to parse is now
parsing fine [1]. So introduce something that is certainly invalid json
everywhere, and update the test itself as well to cope with different error
message and error location.

Also remove workaround for xbuild in this test, since xbuild isn't used anymore.

[1]: Technically the json is still invalid, because according to the json spec
it's not valid to end a list of array elements with a trailing comma. The
problem is that System.Json would in some cases allow trailing commas for
lists of array elements, and sometimes not, which means that we have to ask
System.Text.Json to allow trailing commas as well. And when System.Text.Json
is asked to allow trailing commas, it also successfully parses a case of
trailing comma where System.Json didn't, thus the need for coming up with
something even more invalid.
2019-12-17 11:28:42 +01:00
Rolf Bjarne Kvinge a1acbd7d0d [msbuild] Use System.Text.Json instead of System.Json, since only the former is available in .netcore. 2019-12-17 11:28:11 +01:00
Rolf Bjarne Kvinge 32cd69d274 [msbuild] Split long exec command over multiple lines.
Makes it easier to understand what's happening when new arguments are added
(and easier to add comments to specific arguments).
2019-12-17 11:17:01 +01:00
Manuel de la Pena cfd8c7a20b
[Tests] Improve error when we have network issues in ImageCaptioningTest.GetCaption (#7591)
The error does give a description letting us know that the url was
invalid, that is, we could not reach it.

Fixes: https://github.com/xamarin/maccore/issues/2088
2019-12-16 22:07:22 -05:00
Manuel de la Pena 746d52ef51
[Tests] Ensure that if the TCP connection cannot be done, test are run. (#7605)
TouchUnit uses Console.Out as the writer when the TCP connection cannot
be performed. The BCL tests were not doing so and were crashing.

With this change, when ran locally, if the TCP connection is not done,
we will use Console.Out as TouchUnit and the file will be parsed by
xharness correctly.
2019-12-16 22:05:20 -05:00
Alex Soto 2bb244fcb0
Merge pull request #7600 from dalexsoto/xcode11.3-d16-4
[xcode11.3] Merge d16-4 into xcode11.3
2019-12-16 21:03:29 -05:00
Rolf Bjarne Kvinge c422869c4b
[msbuild] Update tests to NUnit 3.12. (#7597)
Updating the msbuild tasks to use netstandard2.0 requires us to bump NUnit to 3+.

This requires:

* A few code changes due to breaking API changes in NUnit.
* Changes in xharness and a makefile to cope with the new location for the
  NUnit console runner (I added a helper script to make things slightly
  easier).
2019-12-16 23:55:59 +01:00
Rolf Bjarne Kvinge d5135cce25
[msbuild] Update to latest ILRepack. (#7594)
The latest ILRepack has fixes for netstandard we'll need.

Also use package references.
2019-12-16 19:06:25 +01:00
Rolf Bjarne Kvinge 3f84883ebf
[msbuild] Remove xbuild-specific code since we don't support building with xbuild anymore. (#7601) 2019-12-16 19:05:40 +01:00
Rolf Bjarne Kvinge 0ea29935b4
[msbuild] Remove unused files. (#7599) 2019-12-16 19:04:41 +01:00
Sebastien Pouliot 2c8cc9bd43
[test][monotouch-test] Fix crash on old iOS8 32bits devices (#7595)
```
20:11:28.9562500 2019-12-12 20:11:48.058 monotouchtest[873:239608] Xamarin.iOS: Received unhandled ObjectiveC exception: NSInvalidArgumentException *** -[AVCaptureMetadataOutput setMetadataObjectTypes:] - unsupported type found.  Use -availableMetadataObjectTypes.
20:11:29.0542980 2019-12-12 20:11:48.154 monotouchtest[873:239608]
20:11:29.0543360 Unhandled Exception:
20:11:29.0543440 0   libmonosgen-2.0.dylib               0x04d53c45 setup_stack_trace + 188
20:11:29.0543500 1   libmonosgen-2.0.dylib               0x04d51df9 mono_handle_exception_internal + 2120
20:11:29.0543560 2   libmonosgen-2.0.dylib               0x04d515ad mono_handle_exception + 50
20:11:29.0543620 3   libmonosgen-2.0.dylib               0x04d47de9 mono_arm_throw_exception + 132
20:11:29.0543690 4   libmscorlib.dll.dylib               0x01570648 throw_exception + 72
...
```

Fixes https://github.com/xamarin/maccore/issues/2091
2019-12-16 08:57:57 -05:00
Alex Soto e98a9440ca
Merge remote-tracking branch 'xamarin/d16-4' into xcode11.3-d16-4 2019-12-15 19:36:45 -05:00