-
Notifications
You must be signed in to change notification settings - Fork 47
Added TestOption to change xml result file location #60
Added TestOption to change xml result file location #60
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good, but they need to be included on all supported platforms.
CreateXmlResultFile = true, | ||
|
||
// Choose a diffrent path for the xml result file | ||
// ResultFilePath = Path.Combine(Environment.ExternalStorageDirectory.Path, Environment.DirectoryDownloads, "Nunit", "Results.xml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be added to the iOS and UWP projects
@@ -1,5 +1,7 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" package="nunit.runner.tests" android:versionCode="3" android:versionName="3.0"> | |||
<uses-sdk android:minSdkVersion="15" /> | |||
<application android:label="NUnit" android:icon="@drawable/icon"></application> | |||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> | |||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Permissions need to be set for other platforms
@epsmae are you able to make the requested changes, or would you like someone else to do the updates? |
Was adding things to the 3.2 milestone - will also throw this in. It'll also fix #58 👍 |
I will do it in the next days! |
@ChrisMaddock - I think so, I did a simple test on an iphone and a windows 8.1 phone. As I hardly work with Xamarin IOS/ Windows Phone I would be Grateful if somebody could have a look and do some tests. |
Great, thanks! I'll try and take a look tonight. @rprouse, would you also mind taking a second look? |
I will also have a look. Someone will need to resolve conflicts. @epsmae if you can merge latest from master it would save us some time. If not, I can do it, but it might mean opening a new PR since you are working on a fork. You will still get credit for the changes you made though 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good except for minor changes that I have requested. Once it is good, do you want one of us to merge from master and resolve the conflicts or can you do it?
@@ -47,9 +49,10 @@ | |||
<WarningLevel>4</WarningLevel> | |||
<ConsolePause>false</ConsolePause> | |||
<MtouchArch>ARMv7, ARM64</MtouchArch> | |||
<CodesignKey>iPhone Developer</CodesignKey> | |||
<CodesignKey>iPhone Developer: Christian Schmid (R65G567HMV)</CodesignKey> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be removed.
@@ -25,6 +25,8 @@ | |||
<MtouchLink>None</MtouchLink> | |||
<MtouchDebug>true</MtouchDebug> | |||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements> | |||
<CodesignKey>iPhone Developer: Christian Schmid (R65G567HMV)</CodesignKey> | |||
<CodesignProvision>dccfb495-a21d-4e42-8f9b-09f3126395e5</CodesignProvision> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be removed.
<MtouchDebug>true</MtouchDebug> | ||
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements> | ||
<CodesignProvision>dccfb495-a21d-4e42-8f9b-09f3126395e5</CodesignProvision> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should revert all changes in this file.
@@ -53,7 +53,11 @@ public MainPage() | |||
//TcpWriterParameters = new TcpWriterInfo("192.168.0.108", 13000), | |||
|
|||
// Creates a NUnit Xml result file on the host file system using PCLStorage library. | |||
CreateXmlResultFile = false | |||
CreateXmlResultFile = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've removed WP81 since you started this PR. Someone will need to resolve the merge conflicts. Sorry.
@@ -60,7 +60,7 @@ protected override void OnCreate(Bundle savedInstanceState) | |||
CreateXmlResultFile = true, | |||
|
|||
// Choose a diffrent path for the xml result file | |||
// ResultFilePath = Path.Combine(Environment.ExternalStorageDirectory.Path, Environment.DirectoryDownloads, "Nunit", "Results.xml") | |||
ResultFilePath = Path.Combine(Environment.ExternalStorageDirectory.Path, Environment.DirectoryDownloads, "Nunit_123", "Results.xml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change Nunit_123
back?
await folder.CreateFolderAsync(segments[i + 1], CreationCollisionOption.OpenIfExists); | ||
#if __DROID__ | ||
IFolder folder = await FileSystem.Current.GetFolderFromPathAsync(path, CancellationToken.None); | ||
#elif __IOS__ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the Android and IOS code is the same, please change the first #if
to #if __DROID__ || __IOS__
#elif __IOS__ | ||
IFolder folder = await FileSystem.Current.GetFolderFromPathAsync(path, CancellationToken.None); | ||
#else | ||
IFolder folder = await FileSystem.Current.GetFolderFromPathAsync(path.Replace('/', '\\'), CancellationToken.None); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious, did you do the path replacement because it wasn't working? I thought Windows accepted the Linux path separators, but I might be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It crashed on the windows phone so I had to replace the slashes. It also doesn't work with Uri, I always thought it doesn't matter on the platform.
/// <summary> | ||
/// File path for the xml result file | ||
/// Default is [LocalStorage]/NUnitTestOutput/TestResults.xml | ||
/// </summary> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm reading right, I think this comment is out-dated, default is now just in localstorage? Looks like the behaviour was changed since the comment was written. ☺
8f894a4
to
3542be4
Compare
Sorry, I did something foolish. Is it possible to reopen the pull request? |
The pull request is linked to the branch on your repo - I can't currently reopen it as Just push the code back to your branch, and you/we should be able to reopen it. If it all goes wrong, just open up an new PR, don't worry about it. 😄 You haven't accidentally deleted the changes completely, have you? I think I still have a copy locally if so. 😄 |
The changes you have up so far look good. Someone just needs to resolve merge conflicts. @epsmae can you do that, or would you like one of us to do it? |
All looks good to me - merged! Thanks @epsmae! |
@ChrisMaddock When a IPhone is connected it is listed in iTunes ( V9.1 and later). As the UIFileSharingEnabled key is set files can be transfered from / to the device within the app shared folder. |
We are running nunit test with a build server on an network android emulator.
For a more convenient access to the result file the destination file path and name should be settable. The default file location is on the app internal storage, which is more complex to access.