From bbaf37228047760536b03967027815997b11b991 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Thu, 8 Dec 2016 11:44:52 -0800 Subject: [PATCH 01/47] Create bindings for analytics callbacks in iOS --- .../Contoso.Forms.Demo.iOS/Main.cs | 2 - .../Contoso.Forms.Puppet.iOS/AppDelegate.cs | 21 +++++- ...Microsoft.Azure.Mobile.iOS.Bindings.csproj | 4 +- .../ApiDefinition.cs | 66 +++++++++++++++++++ 4 files changed, 88 insertions(+), 5 deletions(-) diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Main.cs b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Main.cs index 3bb6c0d62..a8029a81d 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Main.cs +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Main.cs @@ -15,8 +15,6 @@ static void Main(string[] args) // if you want to use a different Application Delegate class from "AppDelegate" // you can specify it here. UIApplication.Main(args, null, "AppDelegate"); - - } } } diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/AppDelegate.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/AppDelegate.cs index 49222b53b..0b10f3f33 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/AppDelegate.cs +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/AppDelegate.cs @@ -1,5 +1,6 @@ using Foundation; using Microsoft.Azure.Mobile; +using Microsoft.Azure.Mobile.Analytics.iOS.Bindings; using UIKit; namespace Contoso.Forms.Puppet.iOS @@ -10,7 +11,7 @@ public class AppDelegate : Xamarin.Forms.Platform.iOS.FormsApplicationDelegate public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions) { Xamarin.Forms.Forms.Init(); - + MSAnalytics.SetDelegate(new AnalyticsDelegate()); MobileCenter.SetServerUrl("https://in-integration.dev.avalanch.es"); MobileCenter.Configure("b889c4f2-9ac2-4e2e-ae16-dae54f2c5899"); @@ -18,4 +19,22 @@ public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary return base.FinishedLaunching(uiApplication, launchOptions); } } + + public class AnalyticsDelegate : MSAnalyticsDelegate + { + public override void WillSendEventLog(MSAnalytics analytics, MSEventLog eventLog) + { + System.Console.WriteLine("Will send event********"); + } + + public override void DidSucceedSendingEventLog(MSAnalytics analytics, MSEventLog eventLog) + { + System.Console.WriteLine("did send event********"); + } + + public override void DidFailSendingEventLog(MSAnalytics analytics, MSEventLog eventLog, NSError error) + { + System.Console.WriteLine("failed to send event********"); + } + } } diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj index 5d7c4faad..ac5a5b396 100644 --- a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj +++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj @@ -28,7 +28,7 @@ prompt 4 true - + diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs index ca5d1681a..97b1c0b2a 100644 --- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs +++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs @@ -26,6 +26,11 @@ interface MSAnalytics [Export("trackEvent:withProperties:")] void TrackEvent(string eventName, NSDictionary properties); + // +(void)setDelegate:(id _Nullable)delegate; + [Static] + [Export("setDelegate:")] + void SetDelegate([NullAllowed] MSAnalyticsDelegate analyticsDelegate); + //// +(void)trackPage:(NSString *)pageName; //[Static] //[Export("trackPage:")] @@ -46,4 +51,65 @@ interface MSAnalytics //[Export("isAutoPageTrackingEnabled")] //bool IsAutoPageTrackingEnabled(); } + + // @protocol MSAnalyticsDelegate + [Protocol, Model] + [BaseType(typeof(NSObject))] + interface MSAnalyticsDelegate + { + //@optional - (void)analytics:(MSAnalytics*)analytics willSendEventLog:(MSEventLog*)eventLog; + [Export("analytics:willSendEventLog:")] + void WillSendEventLog(MSAnalytics analytics, MSEventLog eventLog); + + //@optional - (void)analytics:(MSAnalytics*)analytics didSucceedSendingEventLog:(MSEventLog*)eventLog; + [Export("analytics:didSucceedSendingEventLog:")] + void DidSucceedSendingEventLog(MSAnalytics analytics, MSEventLog eventLog); + + //@optional - (void)analytics:(MSAnalytics*)analytics didFailSendingEventLog:(MSEventLog*)eventLog withError:(NSError*)error; + [Export("analytics:didFailSendingEventLog:withError:")] + void DidFailSendingEventLog(MSAnalytics analytics, MSEventLog eventLog, NSError error); + + ////@optional - (void)analytics:(MSAnalytics*)analytics willSendPageLog:(MSPageLog*)pageLog; + //[Export("analytics:willSendPageLog:")] + //void WillSendPageLog(MSAnalytics analytics, MSPageLog pageLog); + + ////@optional - (void)analytics:(MSAnalytics*)analytics didSucceedSendingPageLog:(MSPageLog*)pageLog; + //[Export("analytics:didSucceedSendingPageLog:")] + //void DidSucceedSendingPageLog(MSAnalytics analytics, MSPageLog pageLog); + + ////@optional - (void)analytics:(MSAnalytics*)analytics didFailSendingPageLog:(MSPageLog*)pageLog withError:(NSError*)error; + //[Export("analytics:didFailSendingPageLog:withError:")] + //void DidFailSendingPageLog(MSAnalytics analytics, MSPageLog pageLog, NSError error); + } + + // @interface MSLogWithProperties : MSAbstractLog + [BaseType(typeof(NSObject))] + interface MSLogWithProperties + { + //@property(nonatomic) NSDictionary* properties; + [Export("properties")] + NSDictionary Properties { get; set; } + } + + //@interface MSEventLog : MSLogWithProperties + [BaseType(typeof(MSLogWithProperties))] + interface MSEventLog : MSLogWithProperties + { + //@property(nonatomic) NSString *eventId; + [Export("eventId")] + string EventId { get; set; } + + //@property(nonatomic) NSString *name; + [Export("name")] + string Name { get; set; } + } + + //@interface MSPageLog : MSLogWithProperties + [BaseType(typeof(MSLogWithProperties))] + interface MSPageLog : MSLogWithProperties + { + //@property(nonatomic) NSString *name; + [Export("name")] + string Name { get; set; } + } } \ No newline at end of file From ff54285be991be4b3de4053aff7e380c5a4d6b73 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Thu, 8 Dec 2016 13:56:12 -0800 Subject: [PATCH 02/47] Uncomment part of iOS binding csproj --- .../Microsoft.Azure.Mobile.iOS.Bindings.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj index ac5a5b396..5d7c4faad 100644 --- a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj +++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS.Bindings/Microsoft.Azure.Mobile.iOS.Bindings.csproj @@ -28,7 +28,7 @@ prompt 4 true - + From 5d78d577d28cfd4b2358c1e7244615d580348059 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Fri, 9 Dec 2016 09:26:18 -0800 Subject: [PATCH 03/47] Test android analytics callbacks in puppet --- .../Contoso.Forms.Puppet.Droid.csproj | 24 +++++++++---------- .../MainActivity.cs | 22 +++++++++++++++++ build.cake | 2 +- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Contoso.Forms.Puppet.Droid.csproj b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Contoso.Forms.Puppet.Droid.csproj index f210013ca..ef727a2ef 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Contoso.Forms.Puppet.Droid.csproj +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Contoso.Forms.Puppet.Droid.csproj @@ -108,18 +108,6 @@ {92313C69-3BC4-4276-A1C8-100C86183F12} Contoso.Forms.Puppet - - {93E4ADA5-8D7A-44BF-9549-0AD76AB86E8F} - Microsoft.Azure.Mobile.Analytics.Android - - - {34771DC0-9684-45BE-9C9C-5A686468722C} - Microsoft.Azure.Mobile.Analytics.Android.Bindings - - - {C3B5BA33-DA39-400D-B5B3-85C68354FD74} - Microsoft.Azure.Mobile.Android.Bindings - {119C1730-E109-4BC9-AA89-9DCA2C50BFD5} Microsoft.Azure.Mobile.Android @@ -132,6 +120,18 @@ {42D541D7-B7C9-45A7-8D4D-8FB5A00668B3} Microsoft.Azure.Mobile.Crashes.Android.Bindings + + {C3B5BA33-DA39-400D-B5B3-85C68354FD74} + Microsoft.Azure.Mobile.Android.Bindings + + + {93E4ADA5-8D7A-44BF-9549-0AD76AB86E8F} + Microsoft.Azure.Mobile.Analytics.Android + + + {34771DC0-9684-45BE-9C9C-5A686468722C} + Microsoft.Azure.Mobile.Analytics.Android.Bindings + diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs index de302b334..248371cb1 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs @@ -2,6 +2,8 @@ using Android.Content.PM; using Android.OS; using Microsoft.Azure.Mobile; +using Com.Microsoft.Azure.Mobile.Analytics; +using Com.Microsoft.Azure.Mobile.Analytics.Ingestion.Models; namespace Contoso.Forms.Puppet.Droid { @@ -17,10 +19,30 @@ protected override void OnCreate(Bundle savedInstanceState) Xamarin.Forms.Forms.Init(this, savedInstanceState); + AndroidAnalytics.SetListener(new AndroidAnalyticsListener()); + MobileCenter.SetServerUrl("https://in-integration.dev.avalanch.es"); MobileCenter.Configure("7f222d3c-0f5e-421b-93e7-f862c462e07e"); LoadApplication(new App()); } } + + public class AndroidAnalyticsListener : Java.Lang.Object, IAnalyticsListener + { + public void OnSendingFailed(EventLog eventLog, Java.Lang.Exception e) + { + System.Console.WriteLine("OnSendingFailed*****"); + } + + public void OnSendingSucceeded(EventLog eventLog) + { + System.Console.WriteLine("OnSendingSucceeded*****"); + } + + public void OnBeforeSending(EventLog eventLog) + { + System.Console.WriteLine("OnBeforeSending*****"); + } + } } diff --git a/build.cake b/build.cake index 4112f2f66..e3a84a4ef 100644 --- a/build.cake +++ b/build.cake @@ -19,7 +19,7 @@ class MobileCenterModule { } // SDK versions -var ANDROID_SDK_VERSION = "0.3.2"; +var ANDROID_SDK_VERSION = "0.3.3-6+a915706"; var IOS_SDK_VERSION = "0.3.3"; // URLs for downloading binaries. From 5ee6835266d6a216ea7afbfdfe2bebd026906974 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Fri, 9 Dec 2016 14:06:56 -0800 Subject: [PATCH 04/47] Modify visibility for Analytics.setListener in Android bindings --- .../Contoso.Forms.Puppet.Droid/MainActivity.cs | 1 + .../Transforms/Metadata.xml | 3 ++- build.cake | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs index 248371cb1..668fe604a 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs @@ -4,6 +4,7 @@ using Microsoft.Azure.Mobile; using Com.Microsoft.Azure.Mobile.Analytics; using Com.Microsoft.Azure.Mobile.Analytics.Ingestion.Models; +using Com.Microsoft.Azure.Mobile.Analytics.Channel; namespace Contoso.Forms.Puppet.Droid { diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android.Bindings/Transforms/Metadata.xml b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android.Bindings/Transforms/Metadata.xml index 271c2abc9..2cc79ba68 100644 --- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android.Bindings/Transforms/Metadata.xml +++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android.Bindings/Transforms/Metadata.xml @@ -2,4 +2,5 @@ AndroidAnalytics - \ No newline at end of file + public + diff --git a/build.cake b/build.cake index e3a84a4ef..e197bcf2c 100644 --- a/build.cake +++ b/build.cake @@ -19,7 +19,7 @@ class MobileCenterModule { } // SDK versions -var ANDROID_SDK_VERSION = "0.3.3-6+a915706"; +var ANDROID_SDK_VERSION = "0.3.3-10+b91ad04"; var IOS_SDK_VERSION = "0.3.3"; // URLs for downloading binaries. From 16986d9cd102e4847997edd5b885507a89c35414 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Fri, 9 Dec 2016 14:50:47 -0800 Subject: [PATCH 05/47] Change puppet app to use new android analytics callbacks --- .../Contoso.Forms.Puppet.Droid/MainActivity.cs | 12 ++++++++---- build.cake | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs index 668fe604a..b561b9069 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs @@ -5,6 +5,7 @@ using Com.Microsoft.Azure.Mobile.Analytics; using Com.Microsoft.Azure.Mobile.Analytics.Ingestion.Models; using Com.Microsoft.Azure.Mobile.Analytics.Channel; +using Com.Microsoft.Azure.Mobile.Ingestion.Models; namespace Contoso.Forms.Puppet.Droid { @@ -31,19 +32,22 @@ protected override void OnCreate(Bundle savedInstanceState) public class AndroidAnalyticsListener : Java.Lang.Object, IAnalyticsListener { - public void OnSendingFailed(EventLog eventLog, Java.Lang.Exception e) + public void OnSendingFailed(ILog log, Java.Lang.Exception e) { System.Console.WriteLine("OnSendingFailed*****"); } - public void OnSendingSucceeded(EventLog eventLog) + public void OnSendingSucceeded(ILog log) { System.Console.WriteLine("OnSendingSucceeded*****"); } - public void OnBeforeSending(EventLog eventLog) + public void OnBeforeSending(ILog log) { - System.Console.WriteLine("OnBeforeSending*****"); + EventLog eventLog = log as EventLog; + if (eventLog != null) { + System.Console.WriteLine("OnBeforeSendingEventLog*****"); + } } } } diff --git a/build.cake b/build.cake index e197bcf2c..e3e1fdf10 100644 --- a/build.cake +++ b/build.cake @@ -19,7 +19,7 @@ class MobileCenterModule { } // SDK versions -var ANDROID_SDK_VERSION = "0.3.3-10+b91ad04"; +var ANDROID_SDK_VERSION = "0.3.3-11+a072843"; var IOS_SDK_VERSION = "0.3.3"; // URLs for downloading binaries. From 281e09f96ddec63494fee0923cbe8794bc202708 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Thu, 15 Dec 2016 13:36:11 -0800 Subject: [PATCH 06/47] Break test script into two parts --- .../Contoso.Forms.Test.csproj | 24 ++-- Tests/Contoso.Forms.Test/packages.config | 6 +- Tests/Droid/Contoso.Forms.Test.Droid.csproj | 44 ++++--- Tests/Droid/packages.config | 6 +- Tests/UITests/Tests.cs | 124 +++++++++--------- Tests/iOS/Contoso.Forms.Test.iOS.csproj | 65 +++++---- Tests/iOS/packages.config | 6 +- scripts/get-ui-test-results.sh | 103 +++++++++++++++ scripts/mobile-center-login.sh | 36 +++++ scripts/run-ui-tests.sh | 109 +++++++-------- 10 files changed, 333 insertions(+), 190 deletions(-) create mode 100755 scripts/get-ui-test-results.sh create mode 100755 scripts/mobile-center-login.sh diff --git a/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj b/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj index 1298715f7..86d7d7a59 100644 --- a/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj +++ b/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj @@ -1,4 +1,5 @@ - + + Debug AnyCPU @@ -72,6 +73,18 @@ + + ../../packages/Microsoft.Azure.Mobile.0.5.0-SNAPSHOT/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.dll + True + + + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-SNAPSHOT/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.dll + True + + + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-SNAPSHOT/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll + True + ..\..\packages\Xamarin.Forms.2.3.3.175\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Core.dll @@ -81,15 +94,6 @@ ..\..\packages\Xamarin.Forms.2.3.3.175\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Xaml.dll - - ..\..\packages\Microsoft.Azure.Mobile.0.5.0-r0003-1ca4f82\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.dll - - - ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0-r0003-1ca4f82\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll - - - ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0-r0003-1ca4f82\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll - diff --git a/Tests/Contoso.Forms.Test/packages.config b/Tests/Contoso.Forms.Test/packages.config index 7b350bf29..b487948f9 100644 --- a/Tests/Contoso.Forms.Test/packages.config +++ b/Tests/Contoso.Forms.Test/packages.config @@ -1,7 +1,7 @@  - - - + + + \ No newline at end of file diff --git a/Tests/Droid/Contoso.Forms.Test.Droid.csproj b/Tests/Droid/Contoso.Forms.Test.Droid.csproj index 97503140e..a32f6941e 100644 --- a/Tests/Droid/Contoso.Forms.Test.Droid.csproj +++ b/Tests/Droid/Contoso.Forms.Test.Droid.csproj @@ -1,4 +1,4 @@ - + Debug @@ -41,6 +41,30 @@ x86;x86_64;armeabi;armeabi-v7a;arm64-v8a + + ../../packages/Microsoft.Azure.Mobile.0.5.0-SNAPSHOT/lib/MonoAndroid403/Microsoft.Azure.Mobile.dll + True + + + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-SNAPSHOT/lib/MonoAndroid403//Microsoft.Azure.Mobile.Analytics.dll + True + + + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-SNAPSHOT/lib/MonoAndroid403//Microsoft.Azure.Mobile.Analytics.Android.Bindings.dll + True + + + ../../packages/Microsoft.Azure.Mobile.0.5.0-SNAPSHOT/lib/MonoAndroid403/Microsoft.Azure.Mobile.Android.Bindings.dll + True + + + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-SNAPSHOT/lib/MonoAndroid403/Microsoft.Azure.Mobile.Crashes.dll + True + + + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-SNAPSHOT/lib/MonoAndroid403/Microsoft.Azure.Mobile.Crashes.Android.Bindings.dll + True + @@ -84,24 +108,6 @@ ..\..\packages\Xamarin.Forms.2.3.3.175\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll - - ..\..\packages\Microsoft.Azure.Mobile.0.5.0-r0003-1ca4f82\lib\MonoAndroid403\Microsoft.Azure.Mobile.Android.Bindings.dll - - - ..\..\packages\Microsoft.Azure.Mobile.0.5.0-r0003-1ca4f82\lib\MonoAndroid403\Microsoft.Azure.Mobile.dll - - - ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0-r0003-1ca4f82\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.Android.Bindings.dll - - - ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0-r0003-1ca4f82\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.dll - - - ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0-r0003-1ca4f82\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.Android.Bindings.dll - - - ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0-r0003-1ca4f82\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.dll - diff --git a/Tests/Droid/packages.config b/Tests/Droid/packages.config index 7ef863696..18e9ee94e 100644 --- a/Tests/Droid/packages.config +++ b/Tests/Droid/packages.config @@ -1,8 +1,8 @@  - - - + + + diff --git a/Tests/UITests/Tests.cs b/Tests/UITests/Tests.cs index 8a0ed49f6..7bec1b4ba 100644 --- a/Tests/UITests/Tests.cs +++ b/Tests/UITests/Tests.cs @@ -22,72 +22,78 @@ public void BeforeEachTest() } [Test] - public void TestEnablingAndDisablingServices() + public void ThisWillFail() { - ServiceStateHelper.app = app; - app.Tap(TestStrings.GoToTogglePageButton); + Assert.IsTrue(false); + } - /* Test setting enabling all services */ - ServiceStateHelper.MobileCenterEnabled = true; - Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); - ServiceStateHelper.AnalyticsEnabled = true; - Assert.IsTrue(ServiceStateHelper.AnalyticsEnabled); - ServiceStateHelper.CrashesEnabled = true; - Assert.IsTrue(ServiceStateHelper.CrashesEnabled); + //[Test] + //public void TestEnablingAndDisablingServices() + //{ + // ServiceStateHelper.app = app; + // app.Tap(TestStrings.GoToTogglePageButton); - /* Test that disabling MobileCenter disables everything */ - ServiceStateHelper.MobileCenterEnabled = false; - Assert.IsFalse(ServiceStateHelper.MobileCenterEnabled); - Assert.IsFalse(ServiceStateHelper.AnalyticsEnabled); - Assert.IsFalse(ServiceStateHelper.CrashesEnabled); + // /* Test setting enabling all services */ + // ServiceStateHelper.MobileCenterEnabled = true; + // Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); + // ServiceStateHelper.AnalyticsEnabled = true; + // Assert.IsTrue(ServiceStateHelper.AnalyticsEnabled); + // ServiceStateHelper.CrashesEnabled = true; + // Assert.IsTrue(ServiceStateHelper.CrashesEnabled); - /* Test disabling individual services */ - ServiceStateHelper.MobileCenterEnabled = true; - Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); - ServiceStateHelper.AnalyticsEnabled = false; - Assert.IsFalse(ServiceStateHelper.AnalyticsEnabled); - ServiceStateHelper.CrashesEnabled = false; - Assert.IsFalse(ServiceStateHelper.CrashesEnabled); + // /* Test that disabling MobileCenter disables everything */ + // ServiceStateHelper.MobileCenterEnabled = false; + // Assert.IsFalse(ServiceStateHelper.MobileCenterEnabled); + // Assert.IsFalse(ServiceStateHelper.AnalyticsEnabled); + // Assert.IsFalse(ServiceStateHelper.CrashesEnabled); - /* Test that enabling MobileCenter enabling everything, regardless of previous states */ - ServiceStateHelper.MobileCenterEnabled = true; - Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); - Assert.IsTrue(ServiceStateHelper.AnalyticsEnabled); - Assert.IsTrue(ServiceStateHelper.CrashesEnabled); - } + // /* Test disabling individual services */ + // ServiceStateHelper.MobileCenterEnabled = true; + // Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); + // ServiceStateHelper.AnalyticsEnabled = false; + // Assert.IsFalse(ServiceStateHelper.AnalyticsEnabled); + // ServiceStateHelper.CrashesEnabled = false; + // Assert.IsFalse(ServiceStateHelper.CrashesEnabled); - [Test] - public void SendEvents() - { - app.Tap(TestStrings.GoToAnalyticsPageButton); - app.Tap(TestStrings.SendEventButton); - app.Tap(TestStrings.AddPropertyButton); - app.Tap(TestStrings.AddPropertyButton); - app.Tap(TestStrings.AddPropertyButton); - app.Tap(TestStrings.AddPropertyButton); - app.Tap(TestStrings.AddPropertyButton); - app.Tap(TestStrings.SendEventButton); - /* TODO This test is incomplete */ - } + // /* Test that enabling MobileCenter enabling everything, regardless of previous states */ + // ServiceStateHelper.MobileCenterEnabled = true; + // Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); + // Assert.IsTrue(ServiceStateHelper.AnalyticsEnabled); + // Assert.IsTrue(ServiceStateHelper.CrashesEnabled); + //} - [Test] - public void DivideByZero() - { - /* Crash the application with a divide by zero exception and then restart*/ - app.Tap(TestStrings.GoToCrashesPageButton); - app.Tap(TestStrings.DivideByZeroCrashButton); - app = AppInitializer.StartApp(platform); - app.Tap(TestStrings.GoToCrashResultsPageButton); + //[Test] + //public void SendEvents() + //{ + // app.Tap(TestStrings.GoToAnalyticsPageButton); + // app.Tap(TestStrings.SendEventButton); + // app.Tap(TestStrings.AddPropertyButton); + // app.Tap(TestStrings.AddPropertyButton); + // app.Tap(TestStrings.AddPropertyButton); + // app.Tap(TestStrings.AddPropertyButton); + // app.Tap(TestStrings.AddPropertyButton); + // app.Tap(TestStrings.SendEventButton); + // /* TODO This test is incomplete */ + //} - /* Ensure that the callbacks were properly called */ - CrashResultsHelper.app = app; - Assert.IsTrue(CrashResultsHelper.SendingErrorReportWasCalled); - Assert.IsTrue(CrashResultsHelper.SentErrorReportWasCalled); - Assert.IsFalse(CrashResultsHelper.FailedToSendErrorReportWasCalled); - Assert.IsTrue(CrashResultsHelper.ShouldProcessErrorReportWasCalled); - Assert.IsTrue(CrashResultsHelper.ShouldAwaitUserConfirmationWasCalled); - Assert.IsTrue(CrashResultsHelper.GetErrorAttachmentWasCalled); - /* TODO verify the last session error report */ - } + //[Test] + //public void DivideByZero() + //{ + // /* Crash the application with a divide by zero exception and then restart*/ + // app.Tap(TestStrings.GoToCrashesPageButton); + // app.Tap(TestStrings.DivideByZeroCrashButton); + // app = AppInitializer.StartApp(platform); + // app.Tap(TestStrings.GoToCrashResultsPageButton); + + // /* Ensure that the callbacks were properly called */ + // CrashResultsHelper.app = app; + // Assert.IsTrue(CrashResultsHelper.SendingErrorReportWasCalled); + // Assert.IsTrue(CrashResultsHelper.SentErrorReportWasCalled); + // Assert.IsFalse(CrashResultsHelper.FailedToSendErrorReportWasCalled); + // Assert.IsTrue(CrashResultsHelper.ShouldProcessErrorReportWasCalled); + // Assert.IsTrue(CrashResultsHelper.ShouldAwaitUserConfirmationWasCalled); + // Assert.IsTrue(CrashResultsHelper.GetErrorAttachmentWasCalled); + // /* TODO verify the last session error report */ + //} } } diff --git a/Tests/iOS/Contoso.Forms.Test.iOS.csproj b/Tests/iOS/Contoso.Forms.Test.iOS.csproj index 68ea439c2..ddc8c6f1f 100644 --- a/Tests/iOS/Contoso.Forms.Test.iOS.csproj +++ b/Tests/iOS/Contoso.Forms.Test.iOS.csproj @@ -1,4 +1,4 @@ - + Debug @@ -31,7 +31,8 @@ false - + + true bin\iPhone\Release __UNIFIED__;__MOBILE__;__IOS__;ENABLE_TEST_CLOUD; @@ -49,7 +50,8 @@ true - + + true bin\iPhoneSimulator\Release __UNIFIED__;__MOBILE__;__IOS__;ENABLE_TEST_CLOUD; @@ -83,10 +85,35 @@ ARMv7, ARMv7s, ARM64 HttpClientHandler Default - + + true - + + + ../../packages/Microsoft.Azure.Mobile.0.5.0-SNAPSHOT/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.dll + True + + + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-SNAPSHOT/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.dll + True + + + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-SNAPSHOT/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll + True + + + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-SNAPSHOT/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll + True + + + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-SNAPSHOT/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll + True + + + ../../packages/Microsoft.Azure.Mobile.0.5.0-SNAPSHOT/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.iOS.Bindings.dll + True + @@ -106,24 +133,6 @@ ..\..\packages\Xamarin.Forms.2.3.3.175\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll - - ..\..\packages\Microsoft.Azure.Mobile.0.5.0-r0003-1ca4f82\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.dll - - - ..\..\packages\Microsoft.Azure.Mobile.0.5.0-r0003-1ca4f82\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.iOS.Bindings.dll - - - ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0-r0003-1ca4f82\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll - - - ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0-r0003-1ca4f82\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll - - - ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0-r0003-1ca4f82\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll - - - ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0-r0003-1ca4f82\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll - @@ -152,13 +161,13 @@ - - + + $(CreateIpaDependsOn); CopyIpa - - + + - + \ No newline at end of file diff --git a/Tests/iOS/packages.config b/Tests/iOS/packages.config index 267d9d994..94d19ed41 100644 --- a/Tests/iOS/packages.config +++ b/Tests/iOS/packages.config @@ -1,8 +1,8 @@  - - - + + + \ No newline at end of file diff --git a/scripts/get-ui-test-results.sh b/scripts/get-ui-test-results.sh new file mode 100755 index 000000000..322b5d54c --- /dev/null +++ b/scripts/get-ui-test-results.sh @@ -0,0 +1,103 @@ +#!/bin/bash + +USERNAME="$MOBILE_CENTER_USERNAME" # 'MOBILE_CENTER_USERNAME' environment variable must be set +PASSWORD="$MOBILE_CENTER_PASSWORD" # 'MOBILE_CENTER_PASSWORD' environment variable must be set +ANDROID_APP_NAME="mobilecenter-xamarin-testing-app-android" +IOS_APP_NAME="mobilecenter-xamarin-testing-app-ios" +ANDROID_APP="$USERNAME/$ANDROID_APP_NAME" +IOS_APP="$USERNAME/$IOS_APP_NAME" + +# Define results constants +ANDROID_PORTAL_URL="https://mobile.azure.com/users/$USERNAME/apps/$ANDROID_APP_NAME/test/runs/" +IOS_PORTAL_URL="https://mobile.azure.com/users/$USERNAME/apps/$IOS_APP_NAME/test/runs/" + +# Log in to mobile center +./mobile-center-login.sh +if [ $? -ne 0 ]; then + exit 1 +fi + +# Need to know whether we are on bitrise for environment variables +# This is indicated by having no arguments +if ! [ -z ${1+x} ]; then # not from bitrise + ANDROID_TEST_RUN_ID="$1" + IOS_TEST_RUN_ID="$2" +else + ANDROID_TEST_RUN_ID="$ANDROID_TEST_RUN_ID_ENV" + IOS_TEST_RUN_ID="$IOS_TEST_RUN_ID_ENV" +fi + +# Define text attributes +RED=$(tput setaf 1) +GREEN=$(tput setaf 2) +BOLD=$(tput bold) +UNATTRIBUTED=$(tput sgr0) + +#test_status {TEST_RUN_ID} {APP_NAME} +#return codes: 0 == in progress, 1 == passed, 2 == failed +test_status() { + TEST_STATUS_DONE_TEXT="Current test status: Done" + RESULTS_FILE="results_file.txt" + RESULT=0 + mobile-center test status --test-run-id "$1" --app "$2" > $RESULTS_FILE + RETURN_CODE=$? + if grep -q "$TEST_STATUS_DONE_TEXT" "$RESULTS_FILE"; then + RESULT=1 + fi + rm $RESULTS_FILE + if [ $RESULT -eq 0 ]; then # still running + echo 0 + fi + if [ $RESULT -eq 1 ]; then + if [ $RETURN_CODE -eq 0 ]; then # passed + echo 1 + fi + if [ $RETURN_CODE -ne 0 ]; then # failed + echo 2 + fi + fi +} + +IOS_RESULT=0 +ANDROID_RESULT=0 +while [ $IOS_RESULT -eq 0 ] || [ $ANDROID_RESULT -eq 0 ]; do + echo "Checking results..." + if [ $IOS_RESULT -eq 0 ]; then + IOS_RESULT=$(test_status "$IOS_TEST_RUN_ID" "$IOS_APP") + if [ $IOS_RESULT -ne 0 ]; then + echo "iOS test is done." + fi + fi + if [ $ANDROID_RESULT -eq 0 ]; then + ANDROID_RESULT=$(test_status "$ANDROID_TEST_RUN_ID" "$ANDROID_APP") + if [ $ANDROID_RESULT -ne 0 ]; then + echo "Android test is done." + fi + fi + if [ $IOS_RESULT -eq 0 ] || [ $ANDROID_RESULT -eq 0 ]; then + echo "Waiting 10 seconds..." + sleep 10 + fi +done + +# Print results +print_results () { + if [ $2 -eq 1 ]; then + echo "${BOLD}$1 test results: ${GREEN}passed! ${UNATTRIBUTED}" + fi + if [ $2 -eq 2 ]; then + echo "${BOLD}$1 test results: ${RED}failed. ${UNATTRIBUTED}" + fi +} + +print_results "Android" $ANDROID_RESULT +print_results "iOS" $IOS_RESULT + +echo "Full iOS test results at $IOS_PORTAL_URL$IOS_TEST_RUN_ID" +echo "Full Android test results at $ANDROID_PORTAL_URL$ANDROID_TEST_RUN_ID" + +if [ $IOS_RESULT -eq 2 ] || [ $ANDROID_RESULT -eq 2 ]; then + exit 1 +fi + +exit 0 diff --git a/scripts/mobile-center-login.sh b/scripts/mobile-center-login.sh new file mode 100755 index 000000000..02e7762e9 --- /dev/null +++ b/scripts/mobile-center-login.sh @@ -0,0 +1,36 @@ +USERNAME="$MOBILE_CENTER_USERNAME" # 'MOBILE_CENTER_USERNAME' environment variable must be set +PASSWORD="$MOBILE_CENTER_PASSWORD" # 'MOBILE_CENTER_PASSWORD' environment variable must be set + +# Download and install NPM if it is not already installed +npm -v &>/dev/null +if [ $? -ne 0 ]; then + # Install npm + echo "Installing npm..." + brew install npm + if [ $? -ne 0 ]; then + echo "An error occured while downloading npm." + exit 1 + fi +fi + +# Is Mobile Center CLI installed? +npm list -g mobile-center-cli >/dev/null +if [ $? -ne 0 ]; then + # Install Mobile Center CLI + echo "Installing Mobile Center CLI..." + npm install -g mobile-center-cli + if [ $? -ne 0 ]; then + echo "An error occured while installing Mobile Center CLI." + exit 1 + fi +fi + +# Log in to Mobile Center +echo "Logging in to mobile center..." +mobile-center login -u "$USERNAME" -p "$PASSWORD" +if [ $? -ne 0 ]; then + echo "An error occured while logging into Mobile Center." + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/scripts/run-ui-tests.sh b/scripts/run-ui-tests.sh index 85f567276..d8ab5d097 100755 --- a/scripts/run-ui-tests.sh +++ b/scripts/run-ui-tests.sh @@ -13,7 +13,7 @@ BUILD_SCRIPT=build.sh TEST_APK=$1 TEST_IPA=$2 BUILD_TARGET=$3 - +FROM_BITRISE=0 # If there are no arguments, use default values if [ -z ${1+x} ]; then TEST_APK=$SCRIPT_DIR/../Tests/Droid/bin/Release/com.contoso.contoso_forms_test.apk @@ -21,6 +21,12 @@ if [ -z ${1+x} ]; then BUILD_TARGET=TestApps fi +# Need to know whether we are on bitrise for environment variables +# This is indicated by a fourth argument - if there is one, we are on bitrise +if ! [ -z ${4+x} ]; then + FROM_BITRISE=1 +fi + # Define test parameters LOCALE="en-US" USERNAME="$MOBILE_CENTER_USERNAME" # 'MOBILE_CENTER_USERNAME' environment variable must be set @@ -36,46 +42,13 @@ TEST_SERIES="master" # Define results constants ANDROID_PORTAL_URL="https://mobile.azure.com/users/$USERNAME/apps/$ANDROID_APP_NAME/test/runs/" IOS_PORTAL_URL="https://mobile.azure.com/users/$USERNAME/apps/$IOS_APP_NAME/test/runs/" -ANDROID_RESULTS_FILE="android_results.txt" -IOS_RESULTS_FILE="ios_results.txt" -MORE_INFORMATION_TEXT="For more information, visit " - -# Define text attributes -RED=$(tput setaf 1) -GREEN=$(tput setaf 2) -BOLD=$(tput bold) -UNATTRIBUTED=$(tput sgr0) - -# Download and install NPM if it is not already installed -npm -v &>/dev/null -if [ $? -ne 0 ]; then - # Install npm - echo "Installing npm..." - brew install npm - if [ $? -ne 0 ]; then - echo "An error occured while downloading npm." - exit 1 - fi -fi +ANDROID_INFORMATION_FILE="android_info.txt" +IOS_INFORMATION_FILE="ios_info.txt" -# Is Mobile Center CLI installed? -npm list -g mobile-center-cli >/dev/null +# Log in to mobile center +./mobile-center-login.sh if [ $? -ne 0 ]; then - # Install Mobile Center CLI - echo "Installing Mobile Center CLI..." - npm install -g mobile-center-cli - if [ $? -ne 0 ]; then - echo "An error occured while installing Mobile Center CLI." - exit 1 - fi -fi - -# Log in to Mobile Center -echo "Logging in to mobile center..." -mobile-center login -u "$USERNAME" -p "$PASSWORD" -if [ $? -ne 0 ]; then - echo "An error occured while logging into Mobile Center." - exit 1 + exit 1 fi # Build tests @@ -91,13 +64,12 @@ fi popd # Run Android tests -echo "[$(date)] Running Android tests..." +echo "Initiating Android tests..." mobile-center test run uitest --app $ANDROID_APP\ --devices $ANDROID_DEVICES --app-path $TEST_APK\ --test-series $TEST_SERIES --locale $LOCALE\ - --build-dir $UITEST_BUILD_DIR > $ANDROID_RESULTS_FILE + --build-dir $UITEST_BUILD_DIR --async true > $ANDROID_INFORMATION_FILE ANDROID_RETURN_CODE=$? -echo "[$(date)] Android tests completed." ANDROID_TEST_RUN_ID=$( while read -r line do @@ -105,17 +77,25 @@ do echo $(echo $line | cut -d'"' -f 2) break fi -done < $ANDROID_RESULTS_FILE) -rm $ANDROID_RESULTS_FILE +done < $ANDROID_INFORMATION_FILE) +rm $ANDROID_INFORMATION_FILE + +# Print results of Android test initiation +if [ $ANDROID_RETURN_CODE -ne 0 ]; then + echo "Android test failed to initiate." +fi +if [ $ANDROID_RETURN_CODE -eq 0 ]; then + echo "Android test run id: $ANDROID_TEST_RUN_ID" + echo "Android test results: $ANDROID_PORTAL_URL$ANDROID_TEST_RUN_ID" +fi # Run iOS tests -echo "Running iOS tests..." +echo "Initiating iOS tests..." mobile-center test run uitest --app $IOS_APP\ --devices $IOS_DEVICES --app-path $TEST_IPA\ --test-series $TEST_SERIES --locale $LOCALE\ - --build-dir $UITEST_BUILD_DIR > $IOS_RESULTS_FILE + --build-dir $UITEST_BUILD_DIR --async true > $IOS_INFORMATION_FILE IOS_RETURN_CODE=$? -echo "[$(date)] iOS tests completed." IOS_TEST_RUN_ID=$( while read -r line do @@ -123,27 +103,26 @@ do echo $(echo $line | cut -d'"' -f 2) break fi -done < $IOS_RESULTS_FILE) -rm $IOS_RESULTS_FILE - -# Print results -print_results () { - if [ $2 -eq 0 ]; then - echo "${BOLD}$1 test results: ${GREEN}passed! ${UNATTRIBUTED}" - fi - if [ $2 -ne 0 ]; then - echo "${BOLD}$1 test results: ${RED}failed. ${UNATTRIBUTED}" - fi -} +done < $IOS_INFORMATION_FILE) +rm $IOS_INFORMATION_FILE -print_results "Android" $ANDROID_RETURN_CODE -echo "${BOLD}$MORE_INFORMATION_TEXT$ANDROID_PORTAL_URL$ANDROID_TEST_RUN_ID.${UNATTRIBUTED}" - -print_results "iOS" $IOS_RETURN_CODE -echo "${BOLD}$MORE_INFORMATION_TEXT$IOS_PORTAL_URL$IOS_TEST_RUN_ID.${UNATTRIBUTED}" +# Print results of iOS test initiation +if [ $IOS_RETURN_CODE -ne 0 ]; then + echo "iOS test failed to initiate." +fi +if [ $IOS_RETURN_CODE -eq 0 ]; then + echo "iOS test run id: $IOS_TEST_RUN_ID" + echo "iOS test results: $IOS_PORTAL_URL$ANDROID_TEST_RUN_ID" +fi -# If iOS or Android tests failed, exit failure. Otherwise exit success +# If iOS or Android tests failed to be initiated, exit failure. Otherwise exit success if [ $IOS_RETURN_CODE -ne 0 ] || [ $ANDROID_RETURN_CODE -ne 0 ]; then exit 1 fi + +if [ FROM_BITRISE -eq 1 ]; then + envman add --key ANDROID_TEST_RUN_ID_ENV --value "$ANDROID_TEST_RUN_ID" + envman add --key IOS_TEST_RUN_ID_ENV --value "$IOS_TEST_RUN_ID" +fi + exit 0 From c3e42800cbc14535e2662bea64a1c2b9ed698425 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Thu, 15 Dec 2016 13:58:02 -0800 Subject: [PATCH 07/47] Change test packages to avoid using snapshot --- Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj | 6 +++--- Tests/Contoso.Forms.Test/packages.config | 6 +++--- Tests/Droid/packages.config | 6 +++--- Tests/iOS/Contoso.Forms.Test.iOS.csproj | 12 ++++++------ Tests/iOS/packages.config | 6 +++--- scripts/run-ui-tests.sh | 2 ++ 6 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj b/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj index 86d7d7a59..8bccb5da6 100644 --- a/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj +++ b/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj @@ -74,15 +74,15 @@ - ../../packages/Microsoft.Azure.Mobile.0.5.0-SNAPSHOT/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.dll + ../../packages/Microsoft.Azure.Mobile.0.5.0-r0005-646d713/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.dll True - ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-SNAPSHOT/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.dll + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-r0005-646d713/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Analytics.dll True - ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-SNAPSHOT/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-r0005-646d713/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll True diff --git a/Tests/Contoso.Forms.Test/packages.config b/Tests/Contoso.Forms.Test/packages.config index b487948f9..8fda305b4 100644 --- a/Tests/Contoso.Forms.Test/packages.config +++ b/Tests/Contoso.Forms.Test/packages.config @@ -1,7 +1,7 @@  - - - + + + \ No newline at end of file diff --git a/Tests/Droid/packages.config b/Tests/Droid/packages.config index 18e9ee94e..1437374d4 100644 --- a/Tests/Droid/packages.config +++ b/Tests/Droid/packages.config @@ -1,8 +1,8 @@  - - - + + + diff --git a/Tests/iOS/Contoso.Forms.Test.iOS.csproj b/Tests/iOS/Contoso.Forms.Test.iOS.csproj index ddc8c6f1f..446466f6e 100644 --- a/Tests/iOS/Contoso.Forms.Test.iOS.csproj +++ b/Tests/iOS/Contoso.Forms.Test.iOS.csproj @@ -91,27 +91,27 @@ - ../../packages/Microsoft.Azure.Mobile.0.5.0-SNAPSHOT/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.dll + ../../packages/Microsoft.Azure.Mobile.0.5.0-r0005-646d713/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.dll True - ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-SNAPSHOT/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.dll + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-r0005-646d713/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.dll True - ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-SNAPSHOT/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-r0005-646d713/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll True - ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-SNAPSHOT/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-r0005-646d713/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll True - ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-SNAPSHOT/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-r0005-646d713/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll True - ../../packages/Microsoft.Azure.Mobile.0.5.0-SNAPSHOT/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.iOS.Bindings.dll + ../../packages/Microsoft.Azure.Mobile.0.5.0-r0005-646d713/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.iOS.Bindings.dll True diff --git a/Tests/iOS/packages.config b/Tests/iOS/packages.config index 94d19ed41..3c7c16184 100644 --- a/Tests/iOS/packages.config +++ b/Tests/iOS/packages.config @@ -1,8 +1,8 @@  - - - + + + \ No newline at end of file diff --git a/scripts/run-ui-tests.sh b/scripts/run-ui-tests.sh index d8ab5d097..1d58dd941 100755 --- a/scripts/run-ui-tests.sh +++ b/scripts/run-ui-tests.sh @@ -13,6 +13,7 @@ BUILD_SCRIPT=build.sh TEST_APK=$1 TEST_IPA=$2 BUILD_TARGET=$3 +CLEAN_TARGET="clean" FROM_BITRISE=0 # If there are no arguments, use default values if [ -z ${1+x} ]; then @@ -55,6 +56,7 @@ fi echo "Building target \"$BUILD_TARGET\"..." pushd .. +sh $BUILD_SCRIPT -t $CLEAN_TARGET # clean so that we don't accidentally update to snapshot sh $BUILD_SCRIPT -t $BUILD_TARGET if [ $? -ne 0 ]; then echo "An error occured while building tests." From 8969d60e858636be1fa15bf796ff1da887b40cfa Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Thu, 15 Dec 2016 15:51:05 -0800 Subject: [PATCH 08/47] Fix issue in run-ui-tests where variable reference was not prefixed with $ --- scripts/get-ui-test-results.sh | 1 - scripts/run-ui-tests.sh | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/get-ui-test-results.sh b/scripts/get-ui-test-results.sh index 322b5d54c..ceda8f539 100755 --- a/scripts/get-ui-test-results.sh +++ b/scripts/get-ui-test-results.sh @@ -1,7 +1,6 @@ #!/bin/bash USERNAME="$MOBILE_CENTER_USERNAME" # 'MOBILE_CENTER_USERNAME' environment variable must be set -PASSWORD="$MOBILE_CENTER_PASSWORD" # 'MOBILE_CENTER_PASSWORD' environment variable must be set ANDROID_APP_NAME="mobilecenter-xamarin-testing-app-android" IOS_APP_NAME="mobilecenter-xamarin-testing-app-ios" ANDROID_APP="$USERNAME/$ANDROID_APP_NAME" diff --git a/scripts/run-ui-tests.sh b/scripts/run-ui-tests.sh index 1d58dd941..bf23387c7 100755 --- a/scripts/run-ui-tests.sh +++ b/scripts/run-ui-tests.sh @@ -31,7 +31,6 @@ fi # Define test parameters LOCALE="en-US" USERNAME="$MOBILE_CENTER_USERNAME" # 'MOBILE_CENTER_USERNAME' environment variable must be set -PASSWORD="$MOBILE_CENTER_PASSWORD" # 'MOBILE_CENTER_PASSWORD' environment variable must be set IOS_DEVICES=8551ba4e # just one device. For a suite of 40, use 118f9d2f ANDROID_DEVICES=f0b8289c # just one device. For a suite of 40, use f47808f1 ANDROID_APP_NAME="mobilecenter-xamarin-testing-app-android" @@ -122,7 +121,7 @@ if [ $IOS_RETURN_CODE -ne 0 ] || [ $ANDROID_RETURN_CODE -ne 0 ]; then exit 1 fi -if [ FROM_BITRISE -eq 1 ]; then +if [ $FROM_BITRISE -eq 1 ]; then envman add --key ANDROID_TEST_RUN_ID_ENV --value "$ANDROID_TEST_RUN_ID" envman add --key IOS_TEST_RUN_ID_ENV --value "$IOS_TEST_RUN_ID" fi From 3395289c1add31935aa12bc072dea8112d7b1465 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Thu, 15 Dec 2016 16:00:40 -0800 Subject: [PATCH 09/47] Remove from_bitrise logic --- scripts/get-ui-test-results.sh | 3 --- scripts/run-ui-tests.sh | 13 +------------ 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/scripts/get-ui-test-results.sh b/scripts/get-ui-test-results.sh index ceda8f539..6598db4d9 100755 --- a/scripts/get-ui-test-results.sh +++ b/scripts/get-ui-test-results.sh @@ -21,9 +21,6 @@ fi if ! [ -z ${1+x} ]; then # not from bitrise ANDROID_TEST_RUN_ID="$1" IOS_TEST_RUN_ID="$2" -else - ANDROID_TEST_RUN_ID="$ANDROID_TEST_RUN_ID_ENV" - IOS_TEST_RUN_ID="$IOS_TEST_RUN_ID_ENV" fi # Define text attributes diff --git a/scripts/run-ui-tests.sh b/scripts/run-ui-tests.sh index bf23387c7..6c52d9992 100755 --- a/scripts/run-ui-tests.sh +++ b/scripts/run-ui-tests.sh @@ -14,7 +14,7 @@ TEST_APK=$1 TEST_IPA=$2 BUILD_TARGET=$3 CLEAN_TARGET="clean" -FROM_BITRISE=0 + # If there are no arguments, use default values if [ -z ${1+x} ]; then TEST_APK=$SCRIPT_DIR/../Tests/Droid/bin/Release/com.contoso.contoso_forms_test.apk @@ -22,12 +22,6 @@ if [ -z ${1+x} ]; then BUILD_TARGET=TestApps fi -# Need to know whether we are on bitrise for environment variables -# This is indicated by a fourth argument - if there is one, we are on bitrise -if ! [ -z ${4+x} ]; then - FROM_BITRISE=1 -fi - # Define test parameters LOCALE="en-US" USERNAME="$MOBILE_CENTER_USERNAME" # 'MOBILE_CENTER_USERNAME' environment variable must be set @@ -121,9 +115,4 @@ if [ $IOS_RETURN_CODE -ne 0 ] || [ $ANDROID_RETURN_CODE -ne 0 ]; then exit 1 fi -if [ $FROM_BITRISE -eq 1 ]; then - envman add --key ANDROID_TEST_RUN_ID_ENV --value "$ANDROID_TEST_RUN_ID" - envman add --key IOS_TEST_RUN_ID_ENV --value "$IOS_TEST_RUN_ID" -fi - exit 0 From 4f379ca89eb7ff7f4e20804e9c53f2f85a097e3a Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Thu, 15 Dec 2016 16:25:05 -0800 Subject: [PATCH 10/47] Create script to test environment variable settings on bitrise --- scripts/bitrise_test.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 scripts/bitrise_test.sh diff --git a/scripts/bitrise_test.sh b/scripts/bitrise_test.sh new file mode 100755 index 000000000..3b36d8e50 --- /dev/null +++ b/scripts/bitrise_test.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +envman add --key TEST_ENV --value "This is the test" From 5db8b0cf60fe3cb9e993f7577c6902fff9eb497a Mon Sep 17 00:00:00 2001 From: Guillaume Perrot Date: Thu, 15 Dec 2016 16:54:03 -0800 Subject: [PATCH 11/47] Start version 0.5.1 --- Apps/Contoso.Android.Puppet/Properties/AndroidManifest.xml | 2 +- Apps/Contoso.Android.Puppet/Properties/AssemblyInfo.cs | 4 ++-- .../Contoso.Forms.Puppet.Droid/Properties/AndroidManifest.xml | 2 +- .../Contoso.Forms.Puppet.UWP/Properties/AssemblyInfo.cs | 2 +- Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/Info.plist | 4 ++-- Apps/Contoso.iOS.Puppet/Info.plist | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Microsoft.Azure.Mobile.Android/Properties/AssemblyInfo.cs | 4 ++-- SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/WrapperSdk.cs | 2 +- .../Microsoft.Azure.Mobile.iOS/Properties/AssemblyInfo.cs | 4 ++-- .../Microsoft.Azure.Mobile/Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Microsoft.Azure.Mobile.Crashes/Properties/AssemblyInfo.cs | 4 ++-- Tests/Droid/Properties/AndroidManifest.xml | 2 +- Tests/iOS/Info.plist | 4 ++-- 19 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Apps/Contoso.Android.Puppet/Properties/AndroidManifest.xml b/Apps/Contoso.Android.Puppet/Properties/AndroidManifest.xml index ab688fee9..f1056103f 100644 --- a/Apps/Contoso.Android.Puppet/Properties/AndroidManifest.xml +++ b/Apps/Contoso.Android.Puppet/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/Apps/Contoso.Android.Puppet/Properties/AssemblyInfo.cs b/Apps/Contoso.Android.Puppet/Properties/AssemblyInfo.cs index 81d33cae2..3c8af02ee 100644 --- a/Apps/Contoso.Android.Puppet/Properties/AssemblyInfo.cs +++ b/Apps/Contoso.Android.Puppet/Properties/AssemblyInfo.cs @@ -27,5 +27,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: AssemblyInformationalVersion("0.5.0-SNAPSHOT")] +[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyInformationalVersion("0.5.1-SNAPSHOT")] diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AndroidManifest.xml b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AndroidManifest.xml index d43b036c0..876658e6b 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AndroidManifest.xml +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Properties/AssemblyInfo.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Properties/AssemblyInfo.cs index 82e58077e..a5f7cc530 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Properties/AssemblyInfo.cs +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.UWP/Properties/AssemblyInfo.cs @@ -25,5 +25,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] +[assembly: AssemblyFileVersion("0.5.1.0")] [assembly: ComVisible(false)] diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/Info.plist b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/Info.plist index 3249201e2..418b54279 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/Info.plist +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/Info.plist @@ -5,9 +5,9 @@ CFBundleIdentifier com.microsoft.azure.mobile.xamarin.forms.puppet CFBundleShortVersionString - 0.5.0 + 0.5.1 CFBundleVersion - 0.5.0 + 0.5.1 LSRequiresIPhoneOS MinimumOSVersion diff --git a/Apps/Contoso.iOS.Puppet/Info.plist b/Apps/Contoso.iOS.Puppet/Info.plist index 12d81199d..9532714a2 100644 --- a/Apps/Contoso.iOS.Puppet/Info.plist +++ b/Apps/Contoso.iOS.Puppet/Info.plist @@ -7,9 +7,9 @@ CFBundleIdentifier com.microsoft.azure.mobile.xamarin.puppet CFBundleShortVersionString - 0.5.0 + 0.5.1 CFBundleVersion - 0.5.0 + 0.5.1 LSRequiresIPhoneOS MinimumOSVersion diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Android.Bindings/Properties/AssemblyInfo.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Android.Bindings/Properties/AssemblyInfo.cs index 433f8aa61..dd588a6d8 100644 --- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Android.Bindings/Properties/AssemblyInfo.cs +++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Android.Bindings/Properties/AssemblyInfo.cs @@ -25,5 +25,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: AssemblyInformationalVersion("0.5.0-SNAPSHOT")] +[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyInformationalVersion("0.5.1-SNAPSHOT")] diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/Properties/AssemblyInfo.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/Properties/AssemblyInfo.cs index aba22b463..9bc5e4d1f 100644 --- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/Properties/AssemblyInfo.cs +++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Android/Properties/AssemblyInfo.cs @@ -25,5 +25,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: AssemblyInformationalVersion("0.5.0-SNAPSHOT")] +[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyInformationalVersion("0.5.1-SNAPSHOT")] diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/WrapperSdk.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/WrapperSdk.cs index 657c379e4..0486084f5 100644 --- a/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/WrapperSdk.cs +++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.Shared/WrapperSdk.cs @@ -5,6 +5,6 @@ public static class WrapperSdk public const string Name = "mobilecenter.xamarin"; /* We can't use reflection for assemblyInformationalVersion on iOS with "Link All" optimization. */ - internal const string Version = "0.5.0-SNAPSHOT"; + internal const string Version = "0.5.1-SNAPSHOT"; } } diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/Properties/AssemblyInfo.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/Properties/AssemblyInfo.cs index 054599523..25dada138 100644 --- a/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/Properties/AssemblyInfo.cs +++ b/SDK/MobileCenter/Microsoft.Azure.Mobile.iOS/Properties/AssemblyInfo.cs @@ -24,5 +24,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: AssemblyInformationalVersion("0.5.0-SNAPSHOT")] +[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyInformationalVersion("0.5.1-SNAPSHOT")] diff --git a/SDK/MobileCenter/Microsoft.Azure.Mobile/Properties/AssemblyInfo.cs b/SDK/MobileCenter/Microsoft.Azure.Mobile/Properties/AssemblyInfo.cs index fa95e4dd7..6a121ba81 100644 --- a/SDK/MobileCenter/Microsoft.Azure.Mobile/Properties/AssemblyInfo.cs +++ b/SDK/MobileCenter/Microsoft.Azure.Mobile/Properties/AssemblyInfo.cs @@ -25,5 +25,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: AssemblyInformationalVersion("0.5.0-SNAPSHOT")] +[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyInformationalVersion("0.5.1-SNAPSHOT")] diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Properties/AssemblyInfo.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Properties/AssemblyInfo.cs index 4257ee04f..3a4819873 100644 --- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Properties/AssemblyInfo.cs +++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.Android/Properties/AssemblyInfo.cs @@ -25,5 +25,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: AssemblyInformationalVersion("0.5.0-SNAPSHOT")] +[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyInformationalVersion("0.5.1-SNAPSHOT")] diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Properties/AssemblyInfo.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Properties/AssemblyInfo.cs index 190e78d7b..9d4911d67 100644 --- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Properties/AssemblyInfo.cs +++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS/Properties/AssemblyInfo.cs @@ -24,5 +24,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: AssemblyInformationalVersion("0.5.0-SNAPSHOT")] +[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyInformationalVersion("0.5.1-SNAPSHOT")] diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Properties/AssemblyInfo.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Properties/AssemblyInfo.cs index e845118aa..e127df0db 100644 --- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Properties/AssemblyInfo.cs +++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics/Properties/AssemblyInfo.cs @@ -25,5 +25,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: AssemblyInformationalVersion("0.5.0-SNAPSHOT")] +[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyInformationalVersion("0.5.1-SNAPSHOT")] diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/Properties/AssemblyInfo.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/Properties/AssemblyInfo.cs index b31b4704b..3b9ca2520 100644 --- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/Properties/AssemblyInfo.cs +++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.Android/Properties/AssemblyInfo.cs @@ -25,5 +25,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: AssemblyInformationalVersion("0.5.0-SNAPSHOT")] +[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyInformationalVersion("0.5.1-SNAPSHOT")] diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/Properties/AssemblyInfo.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/Properties/AssemblyInfo.cs index c20a78a82..ae950eee6 100644 --- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/Properties/AssemblyInfo.cs +++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes.iOS/Properties/AssemblyInfo.cs @@ -24,5 +24,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: AssemblyInformationalVersion("0.5.0-SNAPSHOT")] +[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyInformationalVersion("0.5.1-SNAPSHOT")] diff --git a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/Properties/AssemblyInfo.cs b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/Properties/AssemblyInfo.cs index 967eb7e3b..5191eb38a 100644 --- a/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/Properties/AssemblyInfo.cs +++ b/SDK/MobileCenterCrashes/Microsoft.Azure.Mobile.Crashes/Properties/AssemblyInfo.cs @@ -25,5 +25,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("0.0.0.0")] -[assembly: AssemblyFileVersion("0.5.0.0")] -[assembly: AssemblyInformationalVersion("0.5.0-SNAPSHOT")] +[assembly: AssemblyFileVersion("0.5.1.0")] +[assembly: AssemblyInformationalVersion("0.5.1-SNAPSHOT")] diff --git a/Tests/Droid/Properties/AndroidManifest.xml b/Tests/Droid/Properties/AndroidManifest.xml index 3e1113e9a..a489341dc 100644 --- a/Tests/Droid/Properties/AndroidManifest.xml +++ b/Tests/Droid/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/Tests/iOS/Info.plist b/Tests/iOS/Info.plist index 16b8a7028..c9fc85e53 100644 --- a/Tests/iOS/Info.plist +++ b/Tests/iOS/Info.plist @@ -9,9 +9,9 @@ CFBundleIdentifier com.contoso.contoso-forms-test CFBundleShortVersionString - 0.5.0 + 0.5.1 CFBundleVersion - 0.5.0 + 0.5.1 LSRequiresIPhoneOS MinimumOSVersion From 496ec0f5b60158c30cc6a130c5255d807e3ab7e4 Mon Sep 17 00:00:00 2001 From: Guillaume Perrot Date: Thu, 15 Dec 2016 18:20:41 -0800 Subject: [PATCH 12/47] Fix divide by zero demo button --- .../Contoso.Forms.Demo.Droid.csproj | 12 +++---- .../Contoso.Forms.Demo.Droid/packages.config | 2 +- .../Contoso.Forms.Demo.iOS.csproj | 36 +++++++++---------- .../Contoso.Forms.Demo.iOS/packages.config | 2 +- .../Contoso.Forms.Demo.csproj | 18 +++++----- .../ModulePages/CrashesContentPage.xaml.cs | 12 +++---- .../Contoso.Forms.Demo/packages.config | 2 +- .../ModulePages/CrashesContentPage.xaml.cs | 4 +-- 8 files changed, 42 insertions(+), 46 deletions(-) diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Contoso.Forms.Demo.Droid.csproj b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Contoso.Forms.Demo.Droid.csproj index 141f7a585..5bad100d2 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Contoso.Forms.Demo.Droid.csproj +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Contoso.Forms.Demo.Droid.csproj @@ -85,22 +85,22 @@ ..\..\..\packages\Xamarin.Forms.2.3.3.175\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll - ..\..\..\packages\Microsoft.Azure.Mobile.0.4.1\lib\MonoAndroid403\Microsoft.Azure.Mobile.Android.Bindings.dll + ..\..\..\packages\Microsoft.Azure.Mobile.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.Android.Bindings.dll - ..\..\..\packages\Microsoft.Azure.Mobile.0.4.1\lib\MonoAndroid403\Microsoft.Azure.Mobile.dll + ..\..\..\packages\Microsoft.Azure.Mobile.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.dll - ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.4.1\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.Android.Bindings.dll + ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.Android.Bindings.dll - ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.4.1\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.dll + ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.dll - ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.4.1\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.Android.Bindings.dll + ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.Android.Bindings.dll - ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.4.1\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.dll + ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.dll diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/packages.config b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/packages.config index 246a37f72..aac1785c7 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/packages.config +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/packages.config @@ -12,4 +12,4 @@ - + \ No newline at end of file diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Contoso.Forms.Demo.iOS.csproj b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Contoso.Forms.Demo.iOS.csproj index ccfc1d603..88bed6e32 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Contoso.Forms.Demo.iOS.csproj +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Contoso.Forms.Demo.iOS.csproj @@ -89,24 +89,6 @@ - - ..\..\..\packages\Microsoft.Azure.Mobile.0.4.1\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.0.4.1\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.iOS.Bindings.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.4.1\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.4.1\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.4.1\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.4.1\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll - ..\..\..\packages\Xamarin.Forms.2.3.3.175\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll @@ -119,6 +101,24 @@ ..\..\..\packages\Xamarin.Forms.2.3.3.175\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll + + ..\..\..\packages\Microsoft.Azure.Mobile.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.dll + + + ..\..\..\packages\Microsoft.Azure.Mobile.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.iOS.Bindings.dll + + + ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll + + + ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll + + + ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll + + + ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll + diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/packages.config b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/packages.config index 0629fb825..1a742142d 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/packages.config +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/packages.config @@ -4,4 +4,4 @@ - + \ No newline at end of file diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/Contoso.Forms.Demo.csproj b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/Contoso.Forms.Demo.csproj index 2565fd0da..622a04a4b 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/Contoso.Forms.Demo.csproj +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/Contoso.Forms.Demo.csproj @@ -74,15 +74,6 @@ - - ..\..\..\packages\Microsoft.Azure.Mobile.0.4.1\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.4.1\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.4.1\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll - ..\..\..\packages\Xamarin.Forms.2.3.3.175\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Core.dll @@ -92,6 +83,15 @@ ..\..\..\packages\Xamarin.Forms.2.3.3.175\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Xaml.dll + + ..\..\..\packages\Microsoft.Azure.Mobile.0.5.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.dll + + + ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll + + + ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll + diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/ModulePages/CrashesContentPage.xaml.cs b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/ModulePages/CrashesContentPage.xaml.cs index 22ea02087..41b152b84 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/ModulePages/CrashesContentPage.xaml.cs +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/ModulePages/CrashesContentPage.xaml.cs @@ -34,14 +34,10 @@ void TestCrash(object sender, EventArgs e) void DivideByZero(object sender, EventArgs e) { - try - { - int x = (42 / int.Parse("0")); - } - catch (Exception) - { - System.Diagnostics.Debug.WriteLine("CAUGHT THE EXCEPTION"); - } + /* This is supposed to cause a crash, so we don't care that the variable 'x' is never used */ +#pragma warning disable CS0219 + int x = (42 / int.Parse("0")); +#pragma warning restore CS0219 } void UpdateEnabled(object sender, ToggledEventArgs e) diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/packages.config b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/packages.config index 223f501fc..9971b3cfe 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/packages.config +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/packages.config @@ -4,4 +4,4 @@ - + \ No newline at end of file diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/CrashesContentPage.xaml.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/CrashesContentPage.xaml.cs index ab421712d..1bb001a90 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/CrashesContentPage.xaml.cs +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet/ModulePages/CrashesContentPage.xaml.cs @@ -33,9 +33,9 @@ void TestCrash(object sender, EventArgs e) void DivideByZero(object sender, EventArgs e) { /* This is supposed to cause a crash, so we don't care that the variable 'x' is never used */ - #pragma warning disable CS0219 +#pragma warning disable CS0219 int x = (42 / int.Parse("0")); - #pragma warning restore CS0219 +#pragma warning restore CS0219 } void UpdateEnabled(object sender, ToggledEventArgs e) From 72705b6d87167e3a5fe10fc55191152956903c01 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Thu, 15 Dec 2016 18:21:21 -0800 Subject: [PATCH 13/47] Remove bitrise test and add azure storage uploading for test ids --- scripts/bitrise_test.sh | 3 --- scripts/get-ui-test-results.sh | 23 ++++++++++++++++++++--- scripts/run-ui-tests.sh | 10 +++++++++- 3 files changed, 29 insertions(+), 7 deletions(-) delete mode 100755 scripts/bitrise_test.sh diff --git a/scripts/bitrise_test.sh b/scripts/bitrise_test.sh deleted file mode 100755 index 3b36d8e50..000000000 --- a/scripts/bitrise_test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -envman add --key TEST_ENV --value "This is the test" diff --git a/scripts/get-ui-test-results.sh b/scripts/get-ui-test-results.sh index 6598db4d9..08c769773 100755 --- a/scripts/get-ui-test-results.sh +++ b/scripts/get-ui-test-results.sh @@ -16,9 +16,26 @@ if [ $? -ne 0 ]; then exit 1 fi -# Need to know whether we are on bitrise for environment variables -# This is indicated by having no arguments -if ! [ -z ${1+x} ]; then # not from bitrise +if ! [ -z ${IN_BITRISE+x} ]; then # Then we are in bitrise environment + echo "Bitrise environment detected. Retrieving test run IDs from Azure Storage..." + + azure storage blob download -q $AZURE_STORAGE_CONTAINER $IOS_TEST_RUN_ID_FILE + if [ $? -ne 0 ]; then + echo "Error downloading iOS test run ID." + exit 1 + fi + azure storage blob download -q $AZURE_STORAGE_CONTAINER $ANDROID_TEST_RUN_ID_FILE + if [ $? -ne 0 ]; then + echo "Error downloading Android test run ID." + exit 1 + fi + + IOS_TEST_RUN_ID=$(cat "$IOS_TEST_RUN_ID_FILE") + $(echo "$IOS_TEST_RUN_ID") > $IOS_TEST_RUN_ID_FILE + $(echo "$ANDROID_TEST_RUN_ID") > $ANDROID_TEST_RUN_ID_FILE + + echo "Test run IDs successfully retrieved." +else # Not in bitrise environment ANDROID_TEST_RUN_ID="$1" IOS_TEST_RUN_ID="$2" fi diff --git a/scripts/run-ui-tests.sh b/scripts/run-ui-tests.sh index 6c52d9992..cfa8c5880 100755 --- a/scripts/run-ui-tests.sh +++ b/scripts/run-ui-tests.sh @@ -14,7 +14,7 @@ TEST_APK=$1 TEST_IPA=$2 BUILD_TARGET=$3 CLEAN_TARGET="clean" - +FROM_BITRISE=0 # If there are no arguments, use default values if [ -z ${1+x} ]; then TEST_APK=$SCRIPT_DIR/../Tests/Droid/bin/Release/com.contoso.contoso_forms_test.apk @@ -115,4 +115,12 @@ if [ $IOS_RETURN_CODE -ne 0 ] || [ $ANDROID_RETURN_CODE -ne 0 ]; then exit 1 fi +echo "Writing test run IDs to files..." +if ! [ -z ${IN_BITRISE+x} ]; then # Then we are in bitrise environment + echo "$IOS_TEST_RUN_ID" > $IOS_TEST_RUN_ID_FILE + echo "$ANDROID_TEST_RUN_ID" > $ANDROID_TEST_RUN_ID_FILE + azure storage blob upload -q $IOS_TEST_RUN_ID_FILE $AZURE_STORAGE_CONTAINER + azure storage blob upload -q $ANDROID_TEST_RUN_ID_FILE $AZURE_STORAGE_CONTAINER +fi + exit 0 From 194ef9d78098d648ddd303f35ae00561b68f1efb Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Thu, 15 Dec 2016 18:41:37 -0800 Subject: [PATCH 14/47] Fix bug where ids were not properly being set --- scripts/get-ui-test-results.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/get-ui-test-results.sh b/scripts/get-ui-test-results.sh index 08c769773..007ead7a0 100755 --- a/scripts/get-ui-test-results.sh +++ b/scripts/get-ui-test-results.sh @@ -31,9 +31,7 @@ if ! [ -z ${IN_BITRISE+x} ]; then # Then we are in bitrise environment fi IOS_TEST_RUN_ID=$(cat "$IOS_TEST_RUN_ID_FILE") - $(echo "$IOS_TEST_RUN_ID") > $IOS_TEST_RUN_ID_FILE - $(echo "$ANDROID_TEST_RUN_ID") > $ANDROID_TEST_RUN_ID_FILE - + ANDROID_TEST_RUN_ID=$(cat "$ANDROID_TEST_RUN_ID_FILE") echo "Test run IDs successfully retrieved." else # Not in bitrise environment ANDROID_TEST_RUN_ID="$1" From 530468d6a2088790e95095e79803e26b643fa761 Mon Sep 17 00:00:00 2001 From: Guillaume Perrot Date: Thu, 15 Dec 2016 18:45:36 -0800 Subject: [PATCH 15/47] Fix script updating demo app nuget dependencies --- .../Contoso.Forms.Demo.Droid.csproj | 42 +++++++++++-------- .../Properties/AndroidManifest.xml | 2 +- .../Contoso.Forms.Demo.iOS.csproj | 42 +++++++++++-------- .../Contoso.Forms.Demo.csproj | 21 ++++++---- build.cake | 7 ++++ scripts/update-demo-version.sh | 7 +--- 6 files changed, 70 insertions(+), 51 deletions(-) diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Contoso.Forms.Demo.Droid.csproj b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Contoso.Forms.Demo.Droid.csproj index 5bad100d2..f37cbdb68 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Contoso.Forms.Demo.Droid.csproj +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Contoso.Forms.Demo.Droid.csproj @@ -41,6 +41,30 @@ armeabi-v7a;armeabi;x86;arm64-v8a;x86_64 + + ../../../packages/Microsoft.Azure.Mobile.0.5.0/lib/MonoAndroid403/Microsoft.Azure.Mobile.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0/lib/MonoAndroid403//Microsoft.Azure.Mobile.Analytics.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0/lib/MonoAndroid403//Microsoft.Azure.Mobile.Analytics.Android.Bindings.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.0.5.0/lib/MonoAndroid403/Microsoft.Azure.Mobile.Android.Bindings.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0/lib/MonoAndroid403/Microsoft.Azure.Mobile.Crashes.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0/lib/MonoAndroid403/Microsoft.Azure.Mobile.Crashes.Android.Bindings.dll + True + @@ -84,24 +108,6 @@ ..\..\..\packages\Xamarin.Forms.2.3.3.175\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll - - ..\..\..\packages\Microsoft.Azure.Mobile.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.Android.Bindings.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.Android.Bindings.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.Crashes.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.Android.Bindings.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0\lib\MonoAndroid403\Microsoft.Azure.Mobile.Analytics.dll - diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Properties/AndroidManifest.xml b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Properties/AndroidManifest.xml index 1686f3112..bff171bf3 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Properties/AndroidManifest.xml +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@  - + diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Contoso.Forms.Demo.iOS.csproj b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Contoso.Forms.Demo.iOS.csproj index 88bed6e32..29b93abb7 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Contoso.Forms.Demo.iOS.csproj +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/Contoso.Forms.Demo.iOS.csproj @@ -85,6 +85,30 @@ Default + + ../../../packages/Microsoft.Azure.Mobile.0.5.0/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.0.5.0/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.iOS.Bindings.dll + True + @@ -101,24 +125,6 @@ ..\..\..\packages\Xamarin.Forms.2.3.3.175\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll - - ..\..\..\packages\Microsoft.Azure.Mobile.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.iOS.Bindings.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0\lib\Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll - diff --git a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/Contoso.Forms.Demo.csproj b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/Contoso.Forms.Demo.csproj index 622a04a4b..9e61f2053 100644 --- a/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/Contoso.Forms.Demo.csproj +++ b/Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/Contoso.Forms.Demo.csproj @@ -74,6 +74,18 @@ + + ../../../packages/Microsoft.Azure.Mobile.0.5.0/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Analytics.dll + True + + + ../../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll + True + ..\..\..\packages\Xamarin.Forms.2.3.3.175\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Core.dll @@ -83,15 +95,6 @@ ..\..\..\packages\Xamarin.Forms.2.3.3.175\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Xaml.dll - - ..\..\..\packages\Microsoft.Azure.Mobile.0.5.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll - - - ..\..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.0\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll - diff --git a/build.cake b/build.cake index 509be941b..36abd8fd5 100644 --- a/build.cake +++ b/build.cake @@ -169,6 +169,13 @@ Task("RestoreTestPackages").Does(() => NuGetUpdate("./Tests/Droid/packages.config"); }); +Task("UpdateDemoDependencies").Does(() => +{ + NuGetUpdate("./Apps/Contoso.Forms.Demo/Contoso.Forms.Demo/packages.config"); + NuGetUpdate("./Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.Droid/packages.config"); + NuGetUpdate("./Apps/Contoso.Forms.Demo/Contoso.Forms.Demo.iOS/packages.config"); +}); + // Cleaning up files/directories. Task("clean").Does(() => { diff --git a/scripts/update-demo-version.sh b/scripts/update-demo-version.sh index ad82fd29a..00bc1b09c 100755 --- a/scripts/update-demo-version.sh +++ b/scripts/update-demo-version.sh @@ -23,8 +23,5 @@ do versionName=$1 perl -pi -e 'undef $/; s/(CFBundleShortVersionString<\/key>\s*)([^<]*)/${1}$ENV{versionName}/' $file done -# Replace nuget package dependencies for Mobile Center -for file in `find Apps -name packages.config | grep Demo` -do - sed -E -i '' "s/(Microsoft.Azure.Mobile.*version=\")([^\"]*)/\1$1/g" $file -done \ No newline at end of file +# Update nuget package dependencies for Mobile Center +./build.sh -t UpdateDemoDependencies \ No newline at end of file From 898ca0f982f679df6fe07baeabcc629814352b21 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Fri, 16 Dec 2016 10:36:05 -0800 Subject: [PATCH 16/47] Clean up test scripts --- .../Contoso.Forms.Test.csproj | 6 +- Tests/Contoso.Forms.Test/packages.config | 6 +- Tests/Droid/Contoso.Forms.Test.Droid.csproj | 12 +- Tests/Droid/packages.config | 6 +- Tests/UITests/Tests.cs | 124 +++++++-------- Tests/iOS/Contoso.Forms.Test.iOS.csproj | 12 +- Tests/iOS/packages.config | 6 +- scripts/get-ui-test-results.sh | 146 ++++++++++------- scripts/run-ui-tests.sh | 147 ++++++++++-------- 9 files changed, 254 insertions(+), 211 deletions(-) diff --git a/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj b/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj index 8bccb5da6..c9f0522dd 100644 --- a/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj +++ b/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj @@ -74,15 +74,15 @@ - ../../packages/Microsoft.Azure.Mobile.0.5.0-r0005-646d713/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.dll + ../../packages/Microsoft.Azure.Mobile.0.5.1-r0002-f165ca7/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.dll True - ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-r0005-646d713/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Analytics.dll + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.1-r0002-f165ca7/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Analytics.dll True - ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-r0005-646d713/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.1-r0002-f165ca7/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll True diff --git a/Tests/Contoso.Forms.Test/packages.config b/Tests/Contoso.Forms.Test/packages.config index 8fda305b4..91efc8256 100644 --- a/Tests/Contoso.Forms.Test/packages.config +++ b/Tests/Contoso.Forms.Test/packages.config @@ -1,7 +1,7 @@  - - - + + + \ No newline at end of file diff --git a/Tests/Droid/Contoso.Forms.Test.Droid.csproj b/Tests/Droid/Contoso.Forms.Test.Droid.csproj index a32f6941e..29c5062bd 100644 --- a/Tests/Droid/Contoso.Forms.Test.Droid.csproj +++ b/Tests/Droid/Contoso.Forms.Test.Droid.csproj @@ -42,27 +42,27 @@ - ../../packages/Microsoft.Azure.Mobile.0.5.0-SNAPSHOT/lib/MonoAndroid403/Microsoft.Azure.Mobile.dll + ../../packages/Microsoft.Azure.Mobile.0.5.1-r0002-f165ca7/lib/MonoAndroid403/Microsoft.Azure.Mobile.dll True - ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-SNAPSHOT/lib/MonoAndroid403//Microsoft.Azure.Mobile.Analytics.dll + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.1-r0002-f165ca7/lib/MonoAndroid403//Microsoft.Azure.Mobile.Analytics.dll True - ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-SNAPSHOT/lib/MonoAndroid403//Microsoft.Azure.Mobile.Analytics.Android.Bindings.dll + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.1-r0002-f165ca7/lib/MonoAndroid403//Microsoft.Azure.Mobile.Analytics.Android.Bindings.dll True - ../../packages/Microsoft.Azure.Mobile.0.5.0-SNAPSHOT/lib/MonoAndroid403/Microsoft.Azure.Mobile.Android.Bindings.dll + ../../packages/Microsoft.Azure.Mobile.0.5.1-r0002-f165ca7/lib/MonoAndroid403/Microsoft.Azure.Mobile.Android.Bindings.dll True - ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-SNAPSHOT/lib/MonoAndroid403/Microsoft.Azure.Mobile.Crashes.dll + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.1-r0002-f165ca7/lib/MonoAndroid403/Microsoft.Azure.Mobile.Crashes.dll True - ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-SNAPSHOT/lib/MonoAndroid403/Microsoft.Azure.Mobile.Crashes.Android.Bindings.dll + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.1-r0002-f165ca7/lib/MonoAndroid403/Microsoft.Azure.Mobile.Crashes.Android.Bindings.dll True diff --git a/Tests/Droid/packages.config b/Tests/Droid/packages.config index 1437374d4..ccd9f7233 100644 --- a/Tests/Droid/packages.config +++ b/Tests/Droid/packages.config @@ -1,8 +1,8 @@  - - - + + + diff --git a/Tests/UITests/Tests.cs b/Tests/UITests/Tests.cs index 7bec1b4ba..8a0ed49f6 100644 --- a/Tests/UITests/Tests.cs +++ b/Tests/UITests/Tests.cs @@ -22,78 +22,72 @@ public void BeforeEachTest() } [Test] - public void ThisWillFail() + public void TestEnablingAndDisablingServices() { - Assert.IsTrue(false); - } - - //[Test] - //public void TestEnablingAndDisablingServices() - //{ - // ServiceStateHelper.app = app; - // app.Tap(TestStrings.GoToTogglePageButton); + ServiceStateHelper.app = app; + app.Tap(TestStrings.GoToTogglePageButton); - // /* Test setting enabling all services */ - // ServiceStateHelper.MobileCenterEnabled = true; - // Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); - // ServiceStateHelper.AnalyticsEnabled = true; - // Assert.IsTrue(ServiceStateHelper.AnalyticsEnabled); - // ServiceStateHelper.CrashesEnabled = true; - // Assert.IsTrue(ServiceStateHelper.CrashesEnabled); + /* Test setting enabling all services */ + ServiceStateHelper.MobileCenterEnabled = true; + Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); + ServiceStateHelper.AnalyticsEnabled = true; + Assert.IsTrue(ServiceStateHelper.AnalyticsEnabled); + ServiceStateHelper.CrashesEnabled = true; + Assert.IsTrue(ServiceStateHelper.CrashesEnabled); - // /* Test that disabling MobileCenter disables everything */ - // ServiceStateHelper.MobileCenterEnabled = false; - // Assert.IsFalse(ServiceStateHelper.MobileCenterEnabled); - // Assert.IsFalse(ServiceStateHelper.AnalyticsEnabled); - // Assert.IsFalse(ServiceStateHelper.CrashesEnabled); + /* Test that disabling MobileCenter disables everything */ + ServiceStateHelper.MobileCenterEnabled = false; + Assert.IsFalse(ServiceStateHelper.MobileCenterEnabled); + Assert.IsFalse(ServiceStateHelper.AnalyticsEnabled); + Assert.IsFalse(ServiceStateHelper.CrashesEnabled); - // /* Test disabling individual services */ - // ServiceStateHelper.MobileCenterEnabled = true; - // Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); - // ServiceStateHelper.AnalyticsEnabled = false; - // Assert.IsFalse(ServiceStateHelper.AnalyticsEnabled); - // ServiceStateHelper.CrashesEnabled = false; - // Assert.IsFalse(ServiceStateHelper.CrashesEnabled); + /* Test disabling individual services */ + ServiceStateHelper.MobileCenterEnabled = true; + Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); + ServiceStateHelper.AnalyticsEnabled = false; + Assert.IsFalse(ServiceStateHelper.AnalyticsEnabled); + ServiceStateHelper.CrashesEnabled = false; + Assert.IsFalse(ServiceStateHelper.CrashesEnabled); - // /* Test that enabling MobileCenter enabling everything, regardless of previous states */ - // ServiceStateHelper.MobileCenterEnabled = true; - // Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); - // Assert.IsTrue(ServiceStateHelper.AnalyticsEnabled); - // Assert.IsTrue(ServiceStateHelper.CrashesEnabled); - //} + /* Test that enabling MobileCenter enabling everything, regardless of previous states */ + ServiceStateHelper.MobileCenterEnabled = true; + Assert.IsTrue(ServiceStateHelper.MobileCenterEnabled); + Assert.IsTrue(ServiceStateHelper.AnalyticsEnabled); + Assert.IsTrue(ServiceStateHelper.CrashesEnabled); + } - //[Test] - //public void SendEvents() - //{ - // app.Tap(TestStrings.GoToAnalyticsPageButton); - // app.Tap(TestStrings.SendEventButton); - // app.Tap(TestStrings.AddPropertyButton); - // app.Tap(TestStrings.AddPropertyButton); - // app.Tap(TestStrings.AddPropertyButton); - // app.Tap(TestStrings.AddPropertyButton); - // app.Tap(TestStrings.AddPropertyButton); - // app.Tap(TestStrings.SendEventButton); - // /* TODO This test is incomplete */ - //} + [Test] + public void SendEvents() + { + app.Tap(TestStrings.GoToAnalyticsPageButton); + app.Tap(TestStrings.SendEventButton); + app.Tap(TestStrings.AddPropertyButton); + app.Tap(TestStrings.AddPropertyButton); + app.Tap(TestStrings.AddPropertyButton); + app.Tap(TestStrings.AddPropertyButton); + app.Tap(TestStrings.AddPropertyButton); + app.Tap(TestStrings.SendEventButton); + /* TODO This test is incomplete */ + } - //[Test] - //public void DivideByZero() - //{ - // /* Crash the application with a divide by zero exception and then restart*/ - // app.Tap(TestStrings.GoToCrashesPageButton); - // app.Tap(TestStrings.DivideByZeroCrashButton); - // app = AppInitializer.StartApp(platform); - // app.Tap(TestStrings.GoToCrashResultsPageButton); + [Test] + public void DivideByZero() + { + /* Crash the application with a divide by zero exception and then restart*/ + app.Tap(TestStrings.GoToCrashesPageButton); + app.Tap(TestStrings.DivideByZeroCrashButton); + app = AppInitializer.StartApp(platform); + app.Tap(TestStrings.GoToCrashResultsPageButton); - // /* Ensure that the callbacks were properly called */ - // CrashResultsHelper.app = app; - // Assert.IsTrue(CrashResultsHelper.SendingErrorReportWasCalled); - // Assert.IsTrue(CrashResultsHelper.SentErrorReportWasCalled); - // Assert.IsFalse(CrashResultsHelper.FailedToSendErrorReportWasCalled); - // Assert.IsTrue(CrashResultsHelper.ShouldProcessErrorReportWasCalled); - // Assert.IsTrue(CrashResultsHelper.ShouldAwaitUserConfirmationWasCalled); - // Assert.IsTrue(CrashResultsHelper.GetErrorAttachmentWasCalled); - // /* TODO verify the last session error report */ - //} + /* Ensure that the callbacks were properly called */ + CrashResultsHelper.app = app; + Assert.IsTrue(CrashResultsHelper.SendingErrorReportWasCalled); + Assert.IsTrue(CrashResultsHelper.SentErrorReportWasCalled); + Assert.IsFalse(CrashResultsHelper.FailedToSendErrorReportWasCalled); + Assert.IsTrue(CrashResultsHelper.ShouldProcessErrorReportWasCalled); + Assert.IsTrue(CrashResultsHelper.ShouldAwaitUserConfirmationWasCalled); + Assert.IsTrue(CrashResultsHelper.GetErrorAttachmentWasCalled); + /* TODO verify the last session error report */ + } } } diff --git a/Tests/iOS/Contoso.Forms.Test.iOS.csproj b/Tests/iOS/Contoso.Forms.Test.iOS.csproj index 446466f6e..8fc760d5e 100644 --- a/Tests/iOS/Contoso.Forms.Test.iOS.csproj +++ b/Tests/iOS/Contoso.Forms.Test.iOS.csproj @@ -91,27 +91,27 @@ - ../../packages/Microsoft.Azure.Mobile.0.5.0-r0005-646d713/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.dll + ../../packages/Microsoft.Azure.Mobile.0.5.1-r0002-f165ca7/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.dll True - ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-r0005-646d713/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.dll + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.1-r0002-f165ca7/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.dll True - ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.0-r0005-646d713/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll + ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.1-r0002-f165ca7/lib/Xamarin.iOS10//Microsoft.Azure.Mobile.Analytics.iOS.Bindings.dll True - ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-r0005-646d713/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.1-r0002-f165ca7/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll True - ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.0-r0005-646d713/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll + ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.1-r0002-f165ca7/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.iOS.Bindings.dll True - ../../packages/Microsoft.Azure.Mobile.0.5.0-r0005-646d713/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.iOS.Bindings.dll + ../../packages/Microsoft.Azure.Mobile.0.5.1-r0002-f165ca7/lib/Xamarin.iOS10/Microsoft.Azure.Mobile.iOS.Bindings.dll True diff --git a/Tests/iOS/packages.config b/Tests/iOS/packages.config index 3c7c16184..c5beb532a 100644 --- a/Tests/iOS/packages.config +++ b/Tests/iOS/packages.config @@ -1,8 +1,8 @@  - - - + + + \ No newline at end of file diff --git a/scripts/get-ui-test-results.sh b/scripts/get-ui-test-results.sh index 007ead7a0..766d4779b 100755 --- a/scripts/get-ui-test-results.sh +++ b/scripts/get-ui-test-results.sh @@ -1,65 +1,77 @@ #!/bin/bash +# Script usage: +# Running locally: ./get-ui-test-results.sh {ANDROID_TEST_RUN_ID} {IOS_TEST_RUN_ID} +# Running on bitrise: ./get-ui-test-results.sh + +# Define constants + +# Mobile Center constants USERNAME="$MOBILE_CENTER_USERNAME" # 'MOBILE_CENTER_USERNAME' environment variable must be set ANDROID_APP_NAME="mobilecenter-xamarin-testing-app-android" IOS_APP_NAME="mobilecenter-xamarin-testing-app-ios" ANDROID_APP="$USERNAME/$ANDROID_APP_NAME" IOS_APP="$USERNAME/$IOS_APP_NAME" - -# Define results constants ANDROID_PORTAL_URL="https://mobile.azure.com/users/$USERNAME/apps/$ANDROID_APP_NAME/test/runs/" IOS_PORTAL_URL="https://mobile.azure.com/users/$USERNAME/apps/$IOS_APP_NAME/test/runs/" -# Log in to mobile center -./mobile-center-login.sh -if [ $? -ne 0 ]; then - exit 1 -fi +# Text attribute constants +RED=$(tput setaf 1) +GREEN=$(tput setaf 2) +BOLD=$(tput bold) +UNATTRIBUTED=$(tput sgr0) -if ! [ -z ${IN_BITRISE+x} ]; then # Then we are in bitrise environment - echo "Bitrise environment detected. Retrieving test run IDs from Azure Storage..." +# Platform name constants +IOS_NAME="iOS" +ANDROID_NAME="Android" + +# Define functions - azure storage blob download -q $AZURE_STORAGE_CONTAINER $IOS_TEST_RUN_ID_FILE +# This function downloads a file containing specified file (containing a test run id) +# from Azure Storage +# Usage: download_file {FILE_NAME} {PLATFORM_NAME} +download_file() { + FILE_NAME="$1" + PLATFORM_NAME="$2" + azure storage blob download -q $AZURE_STORAGE_CONTAINER $FILE_NAME if [ $? -ne 0 ]; then - echo "Error downloading iOS test run ID." + echo "Error downloading $PLATFORM_NAME test run ID." exit 1 + fi +} + +# This function prints the test results for a given platform and return code +# Usage: print_results {PLATFORM_NAME} {RETURN_CODE} +print_results () { + PLATFORM_NAME="$1" + RETURN_CODE=$2 + if [ $RETURN_CODE -eq 1 ]; then + echo "${BOLD}$PLATFORM_NAME test results: ${GREEN}passed! ${UNATTRIBUTED}" fi - azure storage blob download -q $AZURE_STORAGE_CONTAINER $ANDROID_TEST_RUN_ID_FILE - if [ $? -ne 0 ]; then - echo "Error downloading Android test run ID." - exit 1 + if [ $RETURN_CODE -eq 2 ]; then + echo "${BOLD}$1 test results: ${RED}failed. ${UNATTRIBUTED}" fi +} - IOS_TEST_RUN_ID=$(cat "$IOS_TEST_RUN_ID_FILE") - ANDROID_TEST_RUN_ID=$(cat "$ANDROID_TEST_RUN_ID_FILE") - echo "Test run IDs successfully retrieved." -else # Not in bitrise environment - ANDROID_TEST_RUN_ID="$1" - IOS_TEST_RUN_ID="$2" -fi - -# Define text attributes -RED=$(tput setaf 1) -GREEN=$(tput setaf 2) -BOLD=$(tput bold) -UNATTRIBUTED=$(tput sgr0) - -#test_status {TEST_RUN_ID} {APP_NAME} -#return codes: 0 == in progress, 1 == passed, 2 == failed +# This function contacts the Mobile Center backend to determine the specified test's current +# status. Echoes 0 for in progress, 1 for passed, 2 for failed. +# Usage: test_status {TEST_RUN_ID} {APP_NAME} test_status() { + TEST_RUN_ID="$1" + APP_NAME="$2" + # If and only if we see this text in the report, test is done TEST_STATUS_DONE_TEXT="Current test status: Done" RESULTS_FILE="results_file.txt" - RESULT=0 - mobile-center test status --test-run-id "$1" --app "$2" > $RESULTS_FILE + TEST_DONE=0 + mobile-center test status --test-run-id $TEST_RUN_ID --app "$APP_NAME" > $RESULTS_FILE RETURN_CODE=$? if grep -q "$TEST_STATUS_DONE_TEXT" "$RESULTS_FILE"; then - RESULT=1 + TEST_DONE=1 fi rm $RESULTS_FILE - if [ $RESULT -eq 0 ]; then # still running + if [ $TEST_DONE -eq 0 ]; then # still running echo 0 - fi - if [ $RESULT -eq 1 ]; then + else if [ $RETURN_CODE -eq 0 ]; then # passed echo 1 fi @@ -69,22 +81,54 @@ test_status() { fi } +# Log in to mobile center +./mobile-center-login.sh +if [ $? -ne 0 ]; then + exit 1 +fi + +# If script is running in bitrise environment, then test run ids must be downloaded +if ! [ -z ${IN_BITRISE+x} ]; then # We are in bitrise environment + echo "Bitrise environment detected. Retrieving test run IDs from Azure Storage..." + # Download iOS test run ID from Azure Storage + download_file $IOS_TEST_RUN_ID_FILE $IOS_NAME + download_file $IOS_TEST_RUN_ID_FILE $ANDROID_NAME + IOS_TEST_RUN_ID=$(cat "$IOS_TEST_RUN_ID_FILE") + ANDROID_TEST_RUN_ID=$(cat "$ANDROID_TEST_RUN_ID_FILE") + echo "Test run IDs successfully retrieved." +else # Not in bitrise environment + # Make sure there are two arguments + if [ -z ${2+x} ]; then + echo "Error - usage: ./get-ui-test-results.sh {ANDROID_TEST_RUN_ID} {IOS_TEST_RUN_ID}" + exit 1 + fi + ANDROID_TEST_RUN_ID="$1" + IOS_TEST_RUN_ID="$2" +fi + +# Wait for results to become available, checking every ten seconds IOS_RESULT=0 ANDROID_RESULT=0 while [ $IOS_RESULT -eq 0 ] || [ $ANDROID_RESULT -eq 0 ]; do echo "Checking results..." - if [ $IOS_RESULT -eq 0 ]; then + + # Get iOS test status + if [ $IOS_RESULT -eq 0 ]; then #iOS is still running IOS_RESULT=$(test_status "$IOS_TEST_RUN_ID" "$IOS_APP") if [ $IOS_RESULT -ne 0 ]; then - echo "iOS test is done." + echo "$IOS_NAME test is done." fi fi - if [ $ANDROID_RESULT -eq 0 ]; then + + # Get android test status + if [ $ANDROID_RESULT -eq 0 ]; then #Android is still running ANDROID_RESULT=$(test_status "$ANDROID_TEST_RUN_ID" "$ANDROID_APP") if [ $ANDROID_RESULT -ne 0 ]; then - echo "Android test is done." + echo "$ANDROID_NAME test is done." fi fi + + # If tests are not done, wait ten seconds before continuing if [ $IOS_RESULT -eq 0 ] || [ $ANDROID_RESULT -eq 0 ]; then echo "Waiting 10 seconds..." sleep 10 @@ -92,23 +136,13 @@ while [ $IOS_RESULT -eq 0 ] || [ $ANDROID_RESULT -eq 0 ]; do done # Print results -print_results () { - if [ $2 -eq 1 ]; then - echo "${BOLD}$1 test results: ${GREEN}passed! ${UNATTRIBUTED}" - fi - if [ $2 -eq 2 ]; then - echo "${BOLD}$1 test results: ${RED}failed. ${UNATTRIBUTED}" - fi -} - -print_results "Android" $ANDROID_RESULT -print_results "iOS" $IOS_RESULT - -echo "Full iOS test results at $IOS_PORTAL_URL$IOS_TEST_RUN_ID" -echo "Full Android test results at $ANDROID_PORTAL_URL$ANDROID_TEST_RUN_ID" +print_results $ANDROID_NAME $ANDROID_RESULT +print_results $IOS_NAME $IOS_RESULT +echo "Full $IOS_NAME test results at $IOS_PORTAL_URL$IOS_TEST_RUN_ID" +echo "Full $ANDROID_NAME test results at $ANDROID_PORTAL_URL$ANDROID_TEST_RUN_ID" +# If either test was unsuccsessful, exit failure if [ $IOS_RESULT -eq 2 ] || [ $ANDROID_RESULT -eq 2 ]; then exit 1 fi - exit 0 diff --git a/scripts/run-ui-tests.sh b/scripts/run-ui-tests.sh index cfa8c5880..d0f7db948 100755 --- a/scripts/run-ui-tests.sh +++ b/scripts/run-ui-tests.sh @@ -1,25 +1,25 @@ #!/bin/bash -if ! [ -z ${1+x} ]; then - if [ -z ${2+x} ] || [ -z ${3+x} ]; then - echo "Error - usage: ./run-ui-tests.sh {PATH_TO_APK} {PATH_TO_IPA} {BUILD_TARGET}" - fi -fi - # Define directory and file locations SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) -UITEST_BUILD_DIR=$SCRIPT_DIR/../Tests/UITests/bin/Release -BUILD_SCRIPT=build.sh -TEST_APK=$1 -TEST_IPA=$2 -BUILD_TARGET=$3 +UITEST_BUILD_DIR="$SCRIPT_DIR/../Tests/UITests/bin/Release" +BUILD_SCRIPT="build.sh" CLEAN_TARGET="clean" -FROM_BITRISE=0 -# If there are no arguments, use default values -if [ -z ${1+x} ]; then - TEST_APK=$SCRIPT_DIR/../Tests/Droid/bin/Release/com.contoso.contoso_forms_test.apk - TEST_IPA=$SCRIPT_DIR/../Tests/iOS/bin/iPhone/Release/Contoso.Forms.Test.iOS.ipa - BUILD_TARGET=TestApps + +# Set default values for running locally +TEST_APK="$SCRIPT_DIR/../Tests/Droid/bin/Release/com.contoso.contoso_forms_test.apk" +TEST_IPA="$SCRIPT_DIR/../Tests/iOS/bin/iPhone/Release/Contoso.Forms.Test.iOS.ipa" +BUILD_TARGET="TestApps" + +# If script is running in bitrise environment, use arguments +if ! [ -z ${IN_BITRISE+x} ]; then # We are in bitrise environment + if [ -z ${3+x} ]; then # If there are not three arguments, exit failure + echo "Error - usage: ./run-ui-tests.sh {PATH_TO_APK} {PATH_TO_IPA} {BUILD_TARGET}" + exit 1 + fi + TEST_APK=$1 + TEST_IPA=$2 + BUILD_TARGET=$3 fi # Define test parameters @@ -38,6 +38,53 @@ ANDROID_PORTAL_URL="https://mobile.azure.com/users/$USERNAME/apps/$ANDROID_APP_N IOS_PORTAL_URL="https://mobile.azure.com/users/$USERNAME/apps/$IOS_APP_NAME/test/runs/" ANDROID_INFORMATION_FILE="android_info.txt" IOS_INFORMATION_FILE="ios_info.txt" +ANDROID_PLATFORM_NAME="Android" +IOS_PLATFORM_NAME="iOS" + +# Define functions + +# This function extracts the test run ID from an information file, and then echoes it +# Usage: get_test_run_id {INFORMATION_FILE} +get_test_run_id() { + INFORMATION_FILE="$1" + while read -r line + do + if [ $(expr "$line" : "Test run id: ") -ne 0 ]; then + echo $(echo $line | cut -d'"' -f 2) + break + fi + done < $INFORMATION_FILE +} + +# This function prints the results of test initialization +# Usage: print_initialization_results {RETURN_CODE} {PLATFORM_NAME} {PORTAL_URL} {TEST_RUN_ID} +print_initialization_results() { + RETURN_CODE=$1 + PLATFORM_NAME="$2" + PORTAL_URL="$3" + TEST_RUN_ID="$4" + if [ $RETURN_CODE -ne 0 ]; then + echo "$PLATFORM_NAME test failed to initiate." + fi + if [ $RETURN_CODE -eq 0 ]; then + echo "$PLATFORM_NAME test run ID: $TEST_RUN_ID" + echo "$PLATFORM_NAME test results: $PORTAL_URL$TEST_RUN_ID" + fi +} + +# This function initializes tests for the given parameters +# Usage: initialize_tests {APP_NAME} {DEVICES_CODE} {APP_PACKAGE} {INFORMATION_FILE} +initialize_tests() { + APP_NAME="$1" + DEVICES_CODE="$2" + APP_PACKAGE="$3" + INFORMATION_FILE="$4" + mobile-center test run uitest --app $APP_NAME\ + --devices $DEVICES_CODE --app-path $APP_PACKAGE\ + --test-series $TEST_SERIES --locale $LOCALE\ + --build-dir $UITEST_BUILD_DIR --async true > $INFORMATION_FILE + echo $? +} # Log in to mobile center ./mobile-center-login.sh @@ -46,10 +93,15 @@ if [ $? -ne 0 ]; then fi # Build tests -echo "Building target \"$BUILD_TARGET\"..." - pushd .. +echo "Cleaning..." sh $BUILD_SCRIPT -t $CLEAN_TARGET # clean so that we don't accidentally update to snapshot +if [ $? -ne 0 ]; then + echo "An error occured while cleaning." + popd + exit 1 +fi +echo "Building target \"$BUILD_TARGET\"..." sh $BUILD_SCRIPT -t $BUILD_TARGET if [ $? -ne 0 ]; then echo "An error occured while building tests." @@ -59,64 +111,27 @@ fi popd # Run Android tests -echo "Initiating Android tests..." -mobile-center test run uitest --app $ANDROID_APP\ - --devices $ANDROID_DEVICES --app-path $TEST_APK\ - --test-series $TEST_SERIES --locale $LOCALE\ - --build-dir $UITEST_BUILD_DIR --async true > $ANDROID_INFORMATION_FILE -ANDROID_RETURN_CODE=$? -ANDROID_TEST_RUN_ID=$( -while read -r line -do - if [ $(expr "$line" : "Test run id: ") -ne 0 ]; then - echo $(echo $line | cut -d'"' -f 2) - break - fi -done < $ANDROID_INFORMATION_FILE) +echo "Initializing Android tests..." +ANDROID_RETURN_CODE=$(initialize_tests $ANDROID_APP $ANDROID_DEVICES $TEST_APK $ANDROID_INFORMATION_FILE) +ANDROID_TEST_RUN_ID=$(get_test_run_id $ANDROID_INFORMATION_FILE) +print_initialization_results $ANDROID_RETURN_CODE "$ANDROID_PLATFORM_NAME" "$ANDROID_PORTAL_URL" "$ANDROID_TEST_RUN_ID" rm $ANDROID_INFORMATION_FILE -# Print results of Android test initiation -if [ $ANDROID_RETURN_CODE -ne 0 ]; then - echo "Android test failed to initiate." -fi -if [ $ANDROID_RETURN_CODE -eq 0 ]; then - echo "Android test run id: $ANDROID_TEST_RUN_ID" - echo "Android test results: $ANDROID_PORTAL_URL$ANDROID_TEST_RUN_ID" -fi - # Run iOS tests -echo "Initiating iOS tests..." -mobile-center test run uitest --app $IOS_APP\ - --devices $IOS_DEVICES --app-path $TEST_IPA\ - --test-series $TEST_SERIES --locale $LOCALE\ - --build-dir $UITEST_BUILD_DIR --async true > $IOS_INFORMATION_FILE -IOS_RETURN_CODE=$? -IOS_TEST_RUN_ID=$( -while read -r line -do - if [ $(expr "$line" : "Test run id: ") -ne 0 ]; then - echo $(echo $line | cut -d'"' -f 2) - break - fi -done < $IOS_INFORMATION_FILE) +echo "Initializing iOS tests..." +IOS_RETURN_CODE=$(initialize_tests $IOS_APP $IOS_DEVICES $TEST_IPA $IOS_INFORMATION_FILE) +IOS_TEST_RUN_ID=$(get_test_run_id $IOS_INFORMATION_FILE) +print_initialization_results $IOS_RETURN_CODE "$IOS_PLATFORM_NAME" "$IOS_PORTAL_URL" "$IOS_TEST_RUN_ID" rm $IOS_INFORMATION_FILE -# Print results of iOS test initiation -if [ $IOS_RETURN_CODE -ne 0 ]; then - echo "iOS test failed to initiate." -fi -if [ $IOS_RETURN_CODE -eq 0 ]; then - echo "iOS test run id: $IOS_TEST_RUN_ID" - echo "iOS test results: $IOS_PORTAL_URL$ANDROID_TEST_RUN_ID" -fi - # If iOS or Android tests failed to be initiated, exit failure. Otherwise exit success if [ $IOS_RETURN_CODE -ne 0 ] || [ $ANDROID_RETURN_CODE -ne 0 ]; then exit 1 fi -echo "Writing test run IDs to files..." +# If script is running in bitrise environment, upload test run IDs to Azure Storage if ! [ -z ${IN_BITRISE+x} ]; then # Then we are in bitrise environment + echo "Writing test run IDs to files..." echo "$IOS_TEST_RUN_ID" > $IOS_TEST_RUN_ID_FILE echo "$ANDROID_TEST_RUN_ID" > $ANDROID_TEST_RUN_ID_FILE azure storage blob upload -q $IOS_TEST_RUN_ID_FILE $AZURE_STORAGE_CONTAINER From d92ec8393df9edde8b711887a67d9048b5ba14ce Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Fri, 16 Dec 2016 11:07:10 -0800 Subject: [PATCH 17/47] Fix wrong file downloading for android test run id --- scripts/get-ui-test-results.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/get-ui-test-results.sh b/scripts/get-ui-test-results.sh index 766d4779b..10d498ede 100755 --- a/scripts/get-ui-test-results.sh +++ b/scripts/get-ui-test-results.sh @@ -92,7 +92,7 @@ if ! [ -z ${IN_BITRISE+x} ]; then # We are in bitrise environment echo "Bitrise environment detected. Retrieving test run IDs from Azure Storage..." # Download iOS test run ID from Azure Storage download_file $IOS_TEST_RUN_ID_FILE $IOS_NAME - download_file $IOS_TEST_RUN_ID_FILE $ANDROID_NAME + download_file $ANDROID_TEST_RUN_ID_FILE $ANDROID_NAME IOS_TEST_RUN_ID=$(cat "$IOS_TEST_RUN_ID_FILE") ANDROID_TEST_RUN_ID=$(cat "$ANDROID_TEST_RUN_ID_FILE") echo "Test run IDs successfully retrieved." From 6ca8292d822f31ae8175c7705ebb0c3560d25e8a Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Fri, 16 Dec 2016 11:16:16 -0800 Subject: [PATCH 18/47] Update native sdk versions in build.cake --- build.cake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.cake b/build.cake index e3e1fdf10..1e9737464 100644 --- a/build.cake +++ b/build.cake @@ -19,8 +19,8 @@ class MobileCenterModule { } // SDK versions -var ANDROID_SDK_VERSION = "0.3.3-11+a072843"; -var IOS_SDK_VERSION = "0.3.3"; +var ANDROID_SDK_VERSION = "0.3.3"; +var IOS_SDK_VERSION = "0.3.5"; // URLs for downloading binaries. /* From faeec8cf102199c373bc66e6e0e4385d64f0cf36 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Fri, 16 Dec 2016 11:56:58 -0800 Subject: [PATCH 19/47] Modify analytics callback logs in puppet and reformat analytics.ios ApiDefinition.cs --- .../MainActivity.cs | 9 +-- .../Contoso.Forms.Puppet.iOS/AppDelegate.cs | 6 +- .../ApiDefinition.cs | 56 +++++++++---------- 3 files changed, 34 insertions(+), 37 deletions(-) diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs index 53fc77d46..05419d1b6 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.Droid/MainActivity.cs @@ -35,20 +35,17 @@ public class AndroidAnalyticsListener : Java.Lang.Object, IAnalyticsListener { public void OnSendingFailed(ILog log, Java.Lang.Exception e) { - System.Console.WriteLine("OnSendingFailed*****"); + MobileCenterLog.Debug(App.LogTag, "Analytics listener OnSendingFailed with exception: " + e); } public void OnSendingSucceeded(ILog log) { - System.Console.WriteLine("OnSendingSucceeded*****"); + MobileCenterLog.Debug(App.LogTag, "Analytics listener OnSendingSucceeded"); } public void OnBeforeSending(ILog log) { - EventLog eventLog = log as EventLog; - if (eventLog != null) { - System.Console.WriteLine("OnBeforeSendingEventLog*****"); - } + MobileCenterLog.Debug(App.LogTag, "Analytics listener OnBeforeSendingEventLog"); } } } diff --git a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/AppDelegate.cs b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/AppDelegate.cs index 05d2de70f..abff90871 100644 --- a/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/AppDelegate.cs +++ b/Apps/Contoso.Forms.Puppet/Contoso.Forms.Puppet.iOS/AppDelegate.cs @@ -26,17 +26,17 @@ public class AnalyticsDelegate : MSAnalyticsDelegate { public override void WillSendEventLog(MSAnalytics analytics, MSEventLog eventLog) { - System.Console.WriteLine("Will send event********"); + MobileCenterLog.Debug(App.LogTag, "Will send event"); } public override void DidSucceedSendingEventLog(MSAnalytics analytics, MSEventLog eventLog) { - System.Console.WriteLine("did send event********"); + MobileCenterLog.Debug(App.LogTag, "Did send event"); } public override void DidFailSendingEventLog(MSAnalytics analytics, MSEventLog eventLog, NSError error) { - System.Console.WriteLine("failed to send event********"); + MobileCenterLog.Debug(App.LogTag, "Failed to send event with error: " + error); } } } diff --git a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs index 97b1c0b2a..b9e5ef48e 100644 --- a/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs +++ b/SDK/MobileCenterAnalytics/Microsoft.Azure.Mobile.Analytics.iOS.Bindings/ApiDefinition.cs @@ -16,41 +16,41 @@ interface MSAnalytics [Export("isEnabled")] bool IsEnabled(); - // +(void)trackEvent:(NSString *)eventName; - [Static] - [Export("trackEvent:")] - void TrackEvent(string eventName); + // +(void)trackEvent:(NSString *)eventName; + [Static] + [Export("trackEvent:")] + void TrackEvent(string eventName); - // +(void)trackEvent:(NSString *)eventName withProperties:(NSDictionary *)properties; - [Static] - [Export("trackEvent:withProperties:")] - void TrackEvent(string eventName, NSDictionary properties); + // +(void)trackEvent:(NSString *)eventName withProperties:(NSDictionary *)properties; + [Static] + [Export("trackEvent:withProperties:")] + void TrackEvent(string eventName, NSDictionary properties); // +(void)setDelegate:(id _Nullable)delegate; [Static] [Export("setDelegate:")] void SetDelegate([NullAllowed] MSAnalyticsDelegate analyticsDelegate); - //// +(void)trackPage:(NSString *)pageName; - //[Static] - //[Export("trackPage:")] - //void TrackPage(string pageName); - - //// +(void)trackPage:(NSString *)pageName withProperties:(NSDictionary *)properties; - //[Static] - //[Export("trackPage:withProperties:")] - //void TrackPage(string pageName, NSDictionary properties); - - //// +(void)setAutoPageTrackingEnabled:(BOOL)isEnabled; - //[Static] - //[Export("setAutoPageTrackingEnabled:")] - //void SetAutoPageTrackingEnabled(bool isEnabled); - - //// +(BOOL)isAutoPageTrackingEnabled; - //[Static] - //[Export("isAutoPageTrackingEnabled")] - //bool IsAutoPageTrackingEnabled(); - } + //// +(void)trackPage:(NSString *)pageName; + //[Static] + //[Export("trackPage:")] + //void TrackPage(string pageName); + + //// +(void)trackPage:(NSString *)pageName withProperties:(NSDictionary *)properties; + //[Static] + //[Export("trackPage:withProperties:")] + //void TrackPage(string pageName, NSDictionary properties); + + //// +(void)setAutoPageTrackingEnabled:(BOOL)isEnabled; + //[Static] + //[Export("setAutoPageTrackingEnabled:")] + //void SetAutoPageTrackingEnabled(bool isEnabled); + + //// +(BOOL)isAutoPageTrackingEnabled; + //[Static] + //[Export("isAutoPageTrackingEnabled")] + //bool IsAutoPageTrackingEnabled(); + } // @protocol MSAnalyticsDelegate [Protocol, Model] From 2d8f21d82940b8b8ec60c91305c11e9237f74503 Mon Sep 17 00:00:00 2001 From: Guillaume Perrot Date: Fri, 16 Dec 2016 12:21:09 -0800 Subject: [PATCH 20/47] Add ThirdPartyNotices --- ThirdPartyNotices.txt | 101 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 ThirdPartyNotices.txt diff --git a/ThirdPartyNotices.txt b/ThirdPartyNotices.txt new file mode 100644 index 000000000..3e01f784e --- /dev/null +++ b/ThirdPartyNotices.txt @@ -0,0 +1,101 @@ +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION +Do Not Translate or Localize + +Mobile Center SDK for Xamarin incorporates third party material from the projects listed below. The original copyright notice and the license under which Microsoft received such third party material are set forth below. Microsoft reserves all other rights not expressly granted, whether by implication, estoppel or otherwise. + +1. Cake bootstrapper script for PowerShell (https://github.com/cake-build/resources) +2. Glyphish icons (http://glyphish.com) + +%% Cake bootstrapper script for PowerShell NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +The MIT License (MIT) + +Copyright (c) Patrik Svensson, Mattias Karlsson, Gary Ewan Park and contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +========================================= +END OF Cake bootstrapper script for PowerShell NOTICES, INFORMATION, AND LICENSE + +%% Glyphish icons NOTICES, INFORMATION, AND LICENSE BEGIN HERE +========================================= +Thank you to Glyphish (http://www.glyphish.com/) for providing these free icons under the Creative Commons License below. + +License + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. + +1. Definitions + + "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. + "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. + "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. + "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. + "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. + "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. + "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. + "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. + "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. + +2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: + + to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; + to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; + to Distribute and Publicly Perform the Work including as incorporated in Collections; and, + to Distribute and Publicly Perform Adaptations. + + For the avoidance of doubt: + Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; + Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and, + Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License. + +The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved. + +4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: + + You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested. + If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. + Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +7. Termination + + This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. + Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. + +8. Miscellaneous + + Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. + Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. + If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. + No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. + This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. + The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. + +========================================= +END OF Glyphish icons NOTICES, INFORMATION, AND LICENSE + + From c43ceca7e8571bd6bfd6ed0ab17ca710f2a50479 Mon Sep 17 00:00:00 2001 From: Ela Malani Date: Fri, 16 Dec 2016 14:05:13 -0800 Subject: [PATCH 21/47] Update attachment text --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c73c34bf8..3560be95c 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ Note that the events must be subscribed to and callbacks must be set before Mobi }; ``` - * **Error attachment:** If you'd like to attach text/binary data to a crash report, implement this callback. Before sending the crash, our SDK will add the attachment to the crash report and you can view it on the Mobile Center portal. + * **Error attachment:** If you'd like to attach text/binary data to a crash report, implement this callback. Before sending the crash, our SDK will add the attachment to the crash report and you can view it on the Mobile Center portal. Note that attachment will show in the portal in the future as the UI is still not ready. ```csharp Crashes.GetErrorAttachment = (report) => From f4771a9659619310f3fafdb26f35570d5859b09a Mon Sep 17 00:00:00 2001 From: Ela Malani Date: Mon, 19 Dec 2016 14:16:24 -0800 Subject: [PATCH 22/47] Updating instructions to be more detailed --- README.md | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 3560be95c..1fee6563f 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,12 @@ Before you begin, please make sure that the following prerequisites are met: We support the following platforms: -* Xamarin.iOS -* Xamarin.Android -* Xamarin.Forms (iOS and Android) +* Xamarin.iOS + Choose this option if you want to use Xamarin only in iOS application. You need to create one app in Mobile Center portal with OS as `iOS` and platform as `Xamarin`. +* Xamarin.Android + Choose this option if you want to use Xamarin only in Android application. You need to create one app in Mobile Center portal with OS as `Android` and platform as `Xamarin`. +* Xamarin.Forms (iOS and Android) + Choose this option if you want to create cross platform app in iOS and Android. You need to create two apps in Mobile Center - one for each OS and select platform as `Xamarin`. ## 3. Setup @@ -52,19 +55,26 @@ Mobile Center SDK is designed with a modular approach – a developer only needs **For Xamarin.iOS and Xamarin.Android:** * Navigate to the Project -> 'Add NuGet Packages...' -* Search and select "Mobile Center Analytics" and "Mobile Center Crashes". Then Click 'Add Packages' +* Search for 'Mobile Center' and select "Mobile Center Analytics" and "Mobile Center Crashes". Then Click 'Add Packages' **For Xamarin.Forms** Multiplatform Xamarin.Forms app has three projects in your solution - portable class library or shared library, project.Droid, project.iOS . You need to add NuGet packages to each of these projects. * Navigate to the Project -> 'Add NuGet Packages...' -* Search and select "Mobile Center Analytics" and "Mobile Center Crashes". Then Click 'Add Packages' +* Search for 'Mobile Center' and select "Mobile Center Analytics" and "Mobile Center Crashes". Then Click 'Add Packages' ## For Xamarin for Visual Studio ## * Navigate Project -> Manage NuGet Packages... -* Search and select "Mobile Center Analytics" and "Mobile Center Crashes". Then Click 'Add Packages' +* Search for 'Mobile Center' and select "Mobile Center Analytics" and "Mobile Center Crashes". Then Click 'Add Packages' +## Using Package Manager Console ## + +* Open Package Manager Console in either Xamarin Studio or Visual Studio +* Type the following commands: + PM> Install-Package Microsoft.Azure.Mobile.Analytics + PM> Install-Package Microsoft.Azure.Mobile.Crashes + Now that you've integrated the SDK in your application, it's time to start the SDK and make use of Mobile Center services. **Note:** If you installed the "Mobile Center Crashes" package for iOS prior to version 0.3.0, your iOS project should contain the folder @@ -91,11 +101,11 @@ To start the SDK in your app, follow these steps: 2. **Start the SDK:** Mobile Center provides developers with two modules to get started – Analytics and Crashes. In order to use these modules, you need to opt in for the module(s) that you'd like, meaning by default no module is started and you will have to explicitly call each of them when starting the SDK. **Xamarin.iOS** - - Open AppDelegate.cs file and add the `Start` API in FinishedLaunching() method + + Open AppDelegate.cs file and add the `Start` API in FinishedLaunching() method ```csharp - MobileCenter.Start("{Your App Secret}", typeof(Analytics), typeof(Crashes)); + MobileCenter.Start("{Your Xamarin iOS App Secret}", typeof(Analytics), typeof(Crashes)); ``` **Xamarin.Android** @@ -103,25 +113,25 @@ To start the SDK in your app, follow these steps: Open MainActivity.cs file and add the `Start` API in OnCreate() method ```csharp - MobileCenter.Start("{Your App Secret}", typeof(Analytics), typeof(Crashes)); + MobileCenter.Start("{Your Xamarin Android App Secret}", typeof(Analytics), typeof(Crashes)); ``` **Xamarin.Forms** - Start SDK call is split into two methods for Xamarin.Forms. That's because you need two different AppSecrets - one for iOS and other for your Android app. Open App.xaml.cs file in your shared project and add the API below in the `App()` constructor. + For creating a cross platform Forms app targeting both iOS and Android platform, you need to create two applications in Mobile Center portal - one for each platform. Creating two apps will give you two AppSecrets - one for iOS and another for Android. Therefore, Start SDK call is split into two methods for Xamarin.Forms. Open App.xaml.cs file in your shared project and add the API below in the `App()` constructor. ```csharp MobileCenter.Start(typeof(Analytics), typeof(Crashes)); ``` - In the iOS project of the Forms app, open AppDelegate.cs and add the API in `FinishedLaunching()` method + In the iOS project of the Forms app, open AppDelegate.cs and add the API in `FinishedLaunching()` method. Make sure you call the API before `LoadApplication()` method is called. ```csharp - MobileCenter.Configure("{Your iOS App Secret}"); + MobileCenter.Configure("{Your Xamarin iOS App Secret}"); ``` - In the Droid project of the Forms app, open MainActivity.cs and add the API in `OnCreate()` method + In the Droid project of the Forms app, open MainActivity.cs and add the API in `OnCreate()` method. Make sure you call the API before `LoadApplication()` method is called. ```csharp - MobileCenter.Configure("{Your Android App Secret}"); + MobileCenter.Configure("{Your Xamarin Android App Secret}"); ``` You can also copy paste the code from the Overview page on Mobile Center portal once your app is selected. It already includes the App Secret so that all the data collected by the SDK corresponds to your application. Make sure to replace {Your App Secret} text with the actual value for your application. From 90ffd1c03347889fcf6e9fe5960a8de4dff251e8 Mon Sep 17 00:00:00 2001 From: Ela Malani Date: Fri, 23 Dec 2016 12:41:45 -0800 Subject: [PATCH 23/47] Address feedback for package console --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1fee6563f..178f7aa08 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ Multiplatform Xamarin.Forms app has three projects in your solution - portable c ## Using Package Manager Console ## -* Open Package Manager Console in either Xamarin Studio or Visual Studio +* Make sure Package Manager Console is opened in either Xamarin Studio or Visual Studio. You will have to install an add-in for Xamarin Studio. * Type the following commands: PM> Install-Package Microsoft.Azure.Mobile.Analytics PM> Install-Package Microsoft.Azure.Mobile.Crashes From ba4507bf2a63f0acf8c52c4589eb5dcd40e56d50 Mon Sep 17 00:00:00 2001 From: Alexander Chocron Date: Tue, 3 Jan 2017 16:15:59 -0800 Subject: [PATCH 24/47] Add crash uitests and checks to existing analytics test --- Tests/Contoso.Forms.Test.Strings/Strings.cs | 6 ++ .../Contoso.Forms.Test.csproj | 28 ++++--- Tests/Contoso.Forms.Test/EventData.cs | 23 ++++++ .../Module Pages/AnalyticsPage.xaml | 3 + .../Module Pages/AnalyticsPage.xaml.cs | 5 ++ .../Module Pages/AnalyticsResultsPage.xaml | 16 ++++ .../Module Pages/AnalyticsResultsPage.xaml.cs | 36 +++++++++ .../Module Pages/CrashesPage.xaml.cs | 10 ++- Tests/Contoso.Forms.Test/packages.config | 6 +- Tests/Droid/Contoso.Forms.Test.Droid.csproj | 42 +++++----- Tests/Droid/MainActivity.cs | 36 +++++++++ Tests/Droid/packages.config | 6 +- Tests/UITests/AnalyticsResultsHelper.cs | 41 ++++++++++ .../UITests/Contoso.Forms.Test.UITests.csproj | 2 + Tests/UITests/LastSessionErrorReportHelper.cs | 68 ++++++++++++++++ Tests/UITests/Tests.cs | 77 ++++++++++++++++++- Tests/iOS/AppDelegate.cs | 32 ++++++++ Tests/iOS/Contoso.Forms.Test.iOS.csproj | 44 +++++------ Tests/iOS/packages.config | 6 +- 19 files changed, 411 insertions(+), 76 deletions(-) create mode 100644 Tests/Contoso.Forms.Test/EventData.cs create mode 100644 Tests/Contoso.Forms.Test/Module Pages/AnalyticsResultsPage.xaml create mode 100644 Tests/Contoso.Forms.Test/Module Pages/AnalyticsResultsPage.xaml.cs create mode 100644 Tests/UITests/AnalyticsResultsHelper.cs create mode 100644 Tests/UITests/LastSessionErrorReportHelper.cs diff --git a/Tests/Contoso.Forms.Test.Strings/Strings.cs b/Tests/Contoso.Forms.Test.Strings/Strings.cs index f35f4d551..96222e531 100644 --- a/Tests/Contoso.Forms.Test.Strings/Strings.cs +++ b/Tests/Contoso.Forms.Test.Strings/Strings.cs @@ -90,5 +90,11 @@ public static class TestStrings public static readonly string SendEventButton = "SendEventButton"; public static readonly string AddPropertyButton = "AddPropertyButton"; public static readonly string ClearPropertiesButton = "ClearPropertiesButton"; + public static readonly string GoToAnalyticsResultsPageButton = "GoToAnalyticsResultsPageButton"; + + /* AnalyticsResultsPage */ + /* Automation Ids */ + public static readonly string EventPropertiesLabel = "EventPropertiesLabel"; + public static readonly string EventNameLabel = "EventNameLabel"; } } diff --git a/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj b/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj index c9f0522dd..73c8ca232 100644 --- a/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj +++ b/Tests/Contoso.Forms.Test/Contoso.Forms.Test.csproj @@ -47,6 +47,9 @@ MSBuild:UpdateDesignTimeXaml + + MSBuild:UpdateDesignTimeXaml + @@ -71,20 +74,12 @@ LastSessionErrorReportPage.xaml + + AnalyticsResultsPage.xaml + + - - ../../packages/Microsoft.Azure.Mobile.0.5.1-r0002-f165ca7/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.dll - True - - - ../../packages/Microsoft.Azure.Mobile.Analytics.0.5.1-r0002-f165ca7/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Analytics.dll - True - - - ../../packages/Microsoft.Azure.Mobile.Crashes.0.5.1-r0002-f165ca7/lib/portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10/Microsoft.Azure.Mobile.Crashes.dll - True - ..\..\packages\Xamarin.Forms.2.3.3.175\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Core.dll @@ -94,6 +89,15 @@ ..\..\packages\Xamarin.Forms.2.3.3.175\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20\Xamarin.Forms.Xaml.dll + + ..\..\packages\Microsoft.Azure.Mobile.0.5.1-r0007-c986f3a\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.dll + + + ..\..\packages\Microsoft.Azure.Mobile.Analytics.0.5.1-r0007-c986f3a\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Analytics.dll + + + ..\..\packages\Microsoft.Azure.Mobile.Crashes.0.5.1-r0007-c986f3a\lib\portable-net45+wp8+wpa81+win8+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Microsoft.Azure.Mobile.Crashes.dll + diff --git a/Tests/Contoso.Forms.Test/EventData.cs b/Tests/Contoso.Forms.Test/EventData.cs new file mode 100644 index 000000000..116144ebe --- /dev/null +++ b/Tests/Contoso.Forms.Test/EventData.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; + +namespace Contoso.Forms.Test +{ + public static class EventData + { + //TODO add bools for testing which callbacks were called and a reset method + + public static string Name; + public static Dictionary Properties; + + public static event Action UpdatedEvent; + + public static void Updated() + { + if (UpdatedEvent != null) + { + UpdatedEvent(); + } + } + } +} diff --git a/Tests/Contoso.Forms.Test/Module Pages/AnalyticsPage.xaml b/Tests/Contoso.Forms.Test/Module Pages/AnalyticsPage.xaml index 8a9018981..bb1cb6dfa 100644 --- a/Tests/Contoso.Forms.Test/Module Pages/AnalyticsPage.xaml +++ b/Tests/Contoso.Forms.Test/Module Pages/AnalyticsPage.xaml @@ -11,6 +11,9 @@