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

7638 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 984374157c
[mtouch/mmp] Share Main. (#7910) 2020-02-18 16:05:42 -05:00
Rolf Bjarne Kvinge 96d5d3e02b
[mtouch/mmp] Share verbosity code. (#7908) 2020-02-18 15:44:19 -05:00
Waleed Chaudhry bc878256f4
[msbuild] Update test engine to implement IBuildEngine4 (#7905) 2020-02-18 10:56:29 -05:00
Manuel de la Pena af784d6613
[Harness] Create xml unit test failure when an application timesout. (#7929)
If we are in VSTS and we want to have correct reportings we need to
generate a test failure when the applicaiton times out. If not, we have
a missmatch between the results from xharness (we have failures) and
VSTS (success).
2020-02-18 10:28:06 -05:00
Manuel de la Pena f9c502579b
[Harness] Create a xml crash file when we do not have a result file. (#7928)
On devices that cannot reach the host via TCP we do not have a log, this
means that in the if statement needs to have a case for it.

The main problem is that when the device cannot connect to the host, we
do not get a log OR a crash reason from the crash logs. It makes sense
not to have a crash reason, because the app did not crash. In these
sitations, we have to create a xml crash report (since we really do not
know if we can parse the file) that will tell vsts that there was an
issue. Adding the main log will let the monitoring person see the
results of the test run.
2020-02-18 09:16:10 -05:00
Manuel de la Pena 0de70e3dde
[VSTS] Correct order of params for make. (#7927) 2020-02-18 09:15:18 -05:00
Manuel de la Pena e21e50fe73
[VSTS] Clean always, no matter what. (#7926)
Good citizens clean after themselves, even when they are cancelled. Up
to this point if the task was cancelled we would not clean after us.
2020-02-18 09:14:48 -05:00
Manuel de la Pena 9d11429de3
[Tests] Fix AudioQueueTest.Properties test. (#7930)
From the documentation of
https://developer.apple.com/documentation/audiotoolbox/audio_converter_services?language=objc
I think we can deduce that we are hitting a 'hwiu' which is Hardware in
use. Could make sense if we did not clean up properly. Switching to use
the software implementation should fix the flacky test.

fixes: https://github.com/xamarin/maccore/issues/1614
2020-02-18 09:09:47 -05:00
Manuel de la Pena 4937a5d626
[VSTS] Update pipeline yml to use the correct results pattern. (#7922) 2020-02-17 17:12:07 -05:00
Manuel de la Pena 09cf9a92dc
[VSTS] Propagate debug to the make rules (#7917)
If the pipeline is set on debug, to be able to see any issues, propagate
that to the make calls so that we can also get the information there,
else debugging issues with the pipelines + make is really hard.
2020-02-17 16:08:56 -05:00
Manuel de la Pena 59faa728cd
[VSTS] If we could not checkout, do not try to call scripts that are missing. (#7919)
Some of the bots fail to do the checkout (miss configuration). The clean
up step is always executed and assumes the pressence of a script, which
will fail since the script is not there.

The script is small, there is no need to add the rm in an extra file
that needs to be checkout.

This removes an extra warning that is set in the pipeline which is noise
when monitoring.
2020-02-17 15:26:38 -05:00
Manuel de la Pena e8e826e6a3
[VSTS] Ensure that certain tasks do not run when not needed. (#7916)
If the bot could no get the provisioning profiles installed, there is no
reason for certain tasks to run since they are all going to fail. This
adds A LOT of noise in the pipeline for the monitoring person to check
when there is no reason.
2020-02-17 13:12:44 -05:00
Manuel de la Pena 8f58afe857
[Harness] Add a prefix to the final xml to be imported. (#7914)
Because the PublishTest task is taking a regular expression, it is
importing the test results more than one, which gives wrong stats. Add a
prefix to better filter those files we are interested in (thos with
attachments).

As a bonus, refactored the xml failure code for less copy pasting and to
have a single place where we had to add the prefix.
2020-02-17 12:27:22 -05:00
Manuel de la Pena 5475256f51
[XHarness] Close left open html tags. (#7915) 2020-02-17 12:18:31 -05:00
Manuel de la Pena 65df0e650e
[Harness] Use fullname for test-case in the xunit xslt. (#7912)
After reading the code of the parser used in VSTS I found out that name
is not used, but fullname. That attribute is the one used in their xml
parser to set the 'testCaseResultData.AutomatedTestName'.

Parser src: https://dev.azure.com/mseng/AzureDevOps/_git/AzureDevOps?path=%2FTa%2FTasks%2FPublishTestResults%2FParser%2FNUnitResultParser.cs&_a=contents&version=GBmaster
2020-02-17 12:18:09 -05:00
Manuel de la Pena 00c3867ca9
[Xhanress] If we fail to install the application, report it as an test failure. (#7902)
VSTS does not provide a good way to report an app installation issue,
but we can fake a failure in the test when the installation does not
happen.

In the case of the installation failure a xml test result is generated
that will expose all the required information and will attach all the
needed logs (install logs). An example of the generated result can be
seen here: https://gist.github.com/mandel-macaque/2274bcd8785eebd636b98142e228afa9
2020-02-14 17:28:00 -05:00
Manuel de la Pena d2eb074bb4
[XHarness] If there is a build error, report it as a test failure. (#7903)
If there is a build error generate a xml that will be imported by VSTS
and will be reported as a test failure.

Examnple of the error: https://gist.github.com/mandel-macaque/dab2a5a4f3d21a81c172a8c8450d2448
2020-02-14 17:27:35 -05:00
Manuel de la Pena 6fde517698
[Harness] If app does not launch or crash, create a test failure. (#7906)
Make sure that when we are running on VSTS we do get test failures when
the application cannot be launched or crashes.
2020-02-14 17:27:01 -05:00
Alex Soto ec973295b5
Replace removed dsymutil `-t` switch with `-num-threads` (#7898) 2020-02-14 15:44:19 -05:00
Manuel de la Pena 4bdbf3035f
[XHarness] Add ids to the xunit to nunit transformed tests. (#7889)
The NUnit3 xml requires an id for the tests, but xunit does not provide
one. Add an extension object to the xslt that will return a very lame id
so that the test uploader does not complain.

fixes: https://github.com/xamarin/xamarin-macios/issues/7888
2020-02-14 12:45:32 -05:00
Alex Soto d01ced3a54
[sharpie] Update sharpie to latest notarized version (#7894) 2020-02-14 09:41:04 -05:00
Rolf Bjarne Kvinge de61d3d705
[msbuild] Deduplicate the code for generating the app bundle name/path between our various platforms. (#7841)
Also move the app bundle name/path generation code together for all platforms
to avoid it drifting apart in the future.
2020-02-14 14:26:48 +01:00
Rolf Bjarne Kvinge d98a8f1792
[msbuild] Tweak the tests. (#7877)
This is a series of commits that tweaks the msbuild tests a little bit.

* [msbuild] Match configuration between MyWatchKit2Extension and MyWatchKit2IntentsExtension.

Fixes this warning:

>  MTOUCH : warning MT0113: Native code sharing has been disabled for the extension 'MyWatchKit2IntentsExtension' because the --assembly-build-target options are different between the container app () and the extension (--assembly-build-target:@all=dynamiclibrary). [MyWatchKit2Extension/MyWatchKit2Extension.csproj]

* [msbuild] Add the extra argument for the AppWithExtraArgumentThatOverrides test project to all configurations.

That way the test can be built in all configurations (and still test what it's
supposed to test).

* [msbuild] Clean up project files a bit.

* Removed default 'CodesignKey' values from simulator configurations.
* Removed 'MtouchFastDev' values from simulator configurations.
* Removed 'IOSDebuggerPort' values, not needed for these projects.

* [msbuild] Update test projects to use 64-bit architectures.

Also enable bitcode (+llvm) for release device builds for tvOS and watchOS.

* [msbuild] Simplify test project configuration a bit.

* [msbuild] Unify output path.

Using 'TV' and 'TVSimulator' in the OutputPath works fine, but it makes some
of the tests a bit more complex because they need to special-case this test to
find the path to the resulting .app.

* [msbuild] Fix the MyiOSFrameworkBinding test project to have the same assembly name as the project itself.

This simplifies upcoming testing code a bit.
2020-02-14 14:12:25 +01:00
Manuel de la Pena f41a64fd29
[Harness] Attach build logs to NUnit V3 xml results. (#7855)
Get the previous task ID and use it to build the log directory of the
builds, then add all the combined files as attachments.

Fixes: https://github.com/xamarin/xamarin-macios/issues/7854
2020-02-13 16:51:14 -05:00
Manuel de la Pena dc63adf39f
[VSTS] Remove the some hardcoded vars. (#7883)
Move to use a template for the DDFun pipeline. Copy the current pipeline
to a template, set some parameters and recreate the pipeline importing
the template.
2020-02-13 13:02:44 -05:00
Rolf Bjarne Kvinge c517281f1c
Make the smcs script obsolete, and don't use it in tests anymore. (#7878)
Don't remove the entire script, because I believe there's code out there that
checks for the existence of the smcs script to determine whether Xamarin.iOS
is installed or not.
2020-02-13 08:37:52 +01:00
Rolf Bjarne Kvinge 43336779cf
[mtouch] Fix looking up satellites for root assemblies without a path. (#7871)
This may happen when a root assembly is in the current directory.

This fixes the bug-13945 test in the scripted tests.
2020-02-13 08:06:24 +01:00
Manuel de la Pena 2cfc456787
[Harness] Add code that will generate custom xml results with failures. (#7874)
There are two cases that are not currently considered in VSTS that we
need to report:

1. The application could not be built.
2. The application crashed.

In those cases we do not have xml to be imported by VSTS. What we are
going to do is create 'fake' test runs that will encapsulate a build
error or a crash to be imported by VSTS with the needed attachments.

This code just writes custom errors. The generated results are like the
following:

* [NUnit V2](ihttps://gist.github.com/mandel-macaque/7207f6acb5a90895adf84f40a05e0b21)
* [NUnit V3](https://gist.github.com/mandel-macaque/99898c0570cde2e54e38d8af5991f824)
* [xUnit](https://gist.github.com/mandel-macaque/4591cc06d3db0e46de6a0bf886804f13)
2020-02-12 22:06:24 -05:00
Manuel de la Pena 89d21f959c
[Harness] Add support for NUnit V3 in the new bcl tests. (#7870)
Add the required changes in the xunit runner to write NUnit V3 xml
result files so that we can have attachments in VSTS.
2020-02-12 18:17:11 -05:00
Manuel de la Pena 4544fb8fcd
[XHarness] Add NUnit3 support to the old bcl tests. (#7846)
Move the old bcl tests based on NUnit to use the NUnit V3 output so that
we can add logs to the vsts imported tests.

Follow up of PR: https://github.com/xamarin/xamarin-macios/pull/7844
2020-02-12 07:38:40 -05:00
Manuel de la Pena 1a0b2bbcc0
[XHarness] Generate TestReorts for NUnit V3. (#7851)
Now that we have NUnit V3 xml results, do generate the test report for
those correctly.
2020-02-11 20:28:28 -05:00
Manuel de la Pena b83c81ee2b
[DDFun|VSTS] Add a URL to a more interesting view. (#7845)
Since we now have test being imported in DDFun, lets use the test
results view so that the monitoring person just need to click once.
2020-02-11 14:41:38 -05:00
Manuel de la Pena be9a8b1e81
[XHarness] Add logs to VSTS test runs. (#7844)
As per the documentation of the VSTS test uploader (https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/test/publish-test-results?view=azure-devops&tabs=yaml#attachments-support)
the tests support the addition of attachments. We want to be able to
access the logs of the different tests runs, this is achieved the
following way:

1. Move TouchUnit to use NUnit V3 which allows to add attachments.
2. Once the tests are ran, add the attachments to the following nodes:
   1. The very first test-suite. This will allow to have the logs for
   succesul tests.
   2. Add logs to failing tests. Reduces the number of clicks to be done
   to access to the logs when a test case fails.
3. Modify the assembly name of the test-suit to match the name of the
application. This ensures two things.
   1. We have a consistent name for the file column in VSTS, that can be
   used to see recurrent failing tests.
   2. The name is more readable, since if not, it will contain the UUID
   of the device.

Logs are not added to succesful tests because it will have the following
problems:

* Larger data storage usage.
* Longer upload time. The addtion of the logs per tests (succesful or
failed) was tested and resulted in an upload time LONGER than 6 hours
for all TouchUnit, NUnit blc tests and xUnit bcl tests.

In order for this to be useful, the task in the pipeline SHOULD NOT
merge test runs. We should have a test run PER application so that we do
not mix the logs.


Co-Authored-By: Rolf Bjarne Kvinge <rolf@xamarin.com>
2020-02-11 14:03:16 -05:00
Rolf Bjarne Kvinge adaf221471
[msbuild] Fix warning about CFBundleVersion in the MyWatchApp2 test project. (#7843)
Fixes:

> /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1726,3): warning : The Watch App 'MyWatchApp2' has a CFBundleVersion (1.33) that does not match the main app bundle's CFBundleVersion (1.0) [MyWatch2Container/MyWatch2Container.csproj]
> /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(1726,3): warning : The Watch Extension 'MyWatchKit2Extension' has a CFBundleVersion (1.0) that does not match the main app bundle's CFBundleVersion (1.33) [MyWatch2Container/MyWatch2Container.csproj]
2020-02-11 15:27:29 +01:00
Rolf Bjarne Kvinge b0242cfe48
[msbuild] Fix MT4174 warning for the MyWatchKit2IntentsExtension test project. (#7842)
Fixes:

> MyWatchKit2IntentsExtension/IntentHandler.cs(36): warning MT4174: Unable to locate the block to delegate conversion method for the method MyWatchKit2IntentsExtension.IntentHandler.ResolveRecipients's parameter #2. [MyWatchKit2Extension/MyWatchKit2Extension.csproj]

The method signature probably changed from a beta release to the corresponding
stable release, and this method was never updated.
2020-02-11 15:27:08 +01:00
Rolf Bjarne Kvinge 29b9e75db9
Remove code that refers to /Developer/MonoTouch. (#7840)
It's about time.
2020-02-11 15:26:15 +01:00
Manuel de la Pena bd171282cf
[XHarness] USe static variables for common test names. (#7837)
One of the reason why we lost the TestReport was because the xml added
from the new code did not use the same name for the log as the expected
one (https://github.com/xamarin/xamarin-macios/pull/7835/files#diff-03773861bcef485bf343300f31b60b0eR374).

If we are going to be using the description as a way to decide what is
going to be done with it, lets use static vars so that we do not have
logs added with the wrong name.
2020-02-11 06:42:21 -05:00
Manuel de la Pena 072c262b9b
[XHarness] Do write the TestReport when we have xUnit results. (#7835)
Add code to write the TestReport when we have xunit results. Also
refactored code for the NUnit format to not use LINQ, it will use less
memory and in the future we can move to async (not now since it might
raise other problems).

fixes: https://github.com/xamarin/xamarin-macios/issues/7826
2020-02-10 21:44:33 -05:00
Manuel de la Pena aed935a918
[Jenkins] Do not notarize on PRs. (#7836)
It was added as a backup and has not been needed. With the updates to
catalina it makes builds fail on CI.
2020-02-10 19:25:44 -05:00
Sebastien Pouliot 7cbf90c5c6
[tests] Add cecil-based unit tests (#7825)
Only one to start... it's been discussed before but we generally
found other ways to do them. Let's continue to pick the best place
but we now have more options :)
2020-02-10 17:23:12 -05:00
Rolf Bjarne Kvinge 4c496a87ed
[msbuild] Make sure DeviceSpecificOutputPath is a relative path. (#7832)
It might be absolute at least sometimes when building with dotnet, and making
sure it's always a relative path simplifies the code.
2020-02-10 22:31:18 +01:00
Rolf Bjarne Kvinge 999ba8e278
[builds] Make sure downloaded files have a newer timestamp than any other file from previous builds. (#7833)
This makes sure we actually use the new files we downloaded.
2020-02-10 22:30:52 +01:00
Marius Ungureanu f841b1eb51
Use sizeof instead of Marshal.Sizeof (#7558) 2020-02-10 14:41:31 -05:00
Sebastien Pouliot f0e80eb11e
[objcruntime] Fix CS0105 warning in Registrar.cs (#7821)
```
src/ObjCRuntime/Registrar.cs(57,7): warning CS0105: The using directive for 'Xamarin.Bundler' appeared previously in this namespace
```
2020-02-10 08:11:54 -05:00
Sebastien Pouliot 482a63dc56
Update sampletester docs and fix typos (#7822) 2020-02-10 08:10:40 -05:00
Manuel de la Pena f27d428773
[Harness] Just try to generate the report when is NUnit. 2020-02-07 20:23:04 -05:00
Manuel de la Pena c169895499 [Harness] Just try to generate the report when is NUnit.
Use the xml parsing helper methods to decide if the xml can be parsed
and if we will be able to generate the report. That way we avoid an
exception that makes the CI noise.
2020-02-07 17:00:26 -05:00
Sebastien Pouliot afe664fd95
[jenkins] Switch to use the catalina bot group (#7819) 2020-02-07 13:02:15 -05:00
Manuel de la Pena c6650dfb14
[master] Bump mono to pickup needed nunitlite changes. (#7812)
* [master] Bump mono to pickup needed nunitlite changes.

Commits are:

* [interp] context can be uninitialized for get_resume_state callback (#18535) mono/mono@455cf7d
* [2019-12] [debugger] Native thread not executing managed code considered as terminated (#18504) mono/mono@a979811
* [jit] Compute has_references correctly for gshared types whose constraint is a generic valuetype. Also emit write barriers correctly for these types. (#18562) mono/mono@f9e5a6d
* [2019-12] Bump msbuild to track mono-2019-10 (#18577) mono/mono@01be275
* [runtime] Disable lldb backtrace display on osx, it hangs on attaching in lldb. (#18591) mono/mono@ef8188a
* configure.ac: remove AC_SEARCH_LIBS for libintl (#18595)  mono/mono@e55302c
* Bump bockbuild for Pango patch 1e2d68b
* [corlib] Split corlib xunit tests even more for iOS (#18620)  mono/mono@8b72dbb
* [2019-12] [merp] MONO_DEBUG=no-gdb-stacktrace shouldn't disable MERP (#18611) mono/mono@4c93e38
* [aot] Avoid inflating gparams with byreflike types during generic sharing. (#18682) mono/mono@0011444
* Update deprecated query parameter to header (#18705) mono/mono@e65846b
* [NUnitLite] Bump nunitlite submodule. (#18733)  mono/mono@36073a0

Diff: 2edccc52a7...36073a0c74

Other commits need for this to land"


* Add a MONO define so that we get the extensions written for mono.
* Update the sources on iphone to remove the TextUI which is not used.
* BONUS: Remove an annoying warning when compiling NUnitLite
* Update the templates too which are use by xharness.
```
warning CS0659: 'ResultState' overrides Object.Equals(object o) but does not override Object.GetHashCode()
```
2020-02-07 09:56:41 -05:00
Jonathan Peppers bba8fe731f
[msbuild] remove {GAC} from $(AssemblySearchPaths) (#7815)
Fixes: https://developercommunity.visualstudio.com/content/problem/788505/xamarin-found-conflicts-between-different-versions.html
Fixes: http://work.azdo.io/1008385
Context: 73b93c2dc9/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets (L337-L341)

On Windows only, Xamarin.Forms projects hit the build warning:

    Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3277: Found conflicts between different versions of "System.Numerics" that could not be resolved.
    These reference conflicts are listed in the build log when log verbosity is set to detailed.

The difference appears to be the `{GAC}` search path is used on
Windows, but not Mac.

In fact, the output of `<ResolveAssemblyReference/>` on Mac reports:

    Unused locations
        {CandidateAssemblyFiles}
        {HintPathFromItem}
        {Registry:Software/Microsoft/Xamarin.iOS,v1.0,AssemblyFoldersEx}
        {AssemblyFolders}
        {GAC}
        bin/iPhoneSimulator/Debug/
    Used locations
        {TargetFrameworkDirectory}
        {RawFileName}

Compared to Windows:

    Used locations
        {TargetFrameworkDirectory}
        {GAC}
        {RawFileName}

For now, we should just remove `{GAC}` from the list as the safest fix.

Xamarin.Mac is already doing this:

f85556c1e5/msbuild/Xamarin.Mac.Tasks/Xamarin.Mac.Common.props (L121-L125)

Down the road, we could specify only the paths needed for performance
reasons. We have done this recently in Xamarin.Android:

5945e9a779/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets (L382-L386)

* Added a test assertion for this as well.
2020-02-07 08:54:29 -06:00