Xamarin test cloud submit app and config file - xamarin

When submitting an app and test assembly to Xamarin Test Cloud using test-cloud.exe (version Xamarin.UITest.1.3.9.1500-dev) we also need to submit an App.config file (as our test assembly relies on configurable appSettings).
Initially I had hoped that everything within the bin directory (either Debug / Release depending on --assembly-dir provided) would be uploaded to Test Cloud.
This does not appear to be the case, my App.config file (XamarinMobileTests.dll.config) present in the bin directory is not uploaded.
So, to address this issue, I have attempted 2 potential solutions, none of which I have had any success with, these are as follows:
Using the --data parameter with the submit command (--data XamarinMobileTests\bin\Release\XamarinMobileTests.dll.config). This always seems to return an error: "Data files must be located in the assembly directory or a sub folder."
I have attempted to put this file in various locations, with no luck.
Specify appSetting values within the --test-params parameter. This executes the submit command without error and instantiates a test run in test cloud. However, the Xamarin.UiTest Sdk does not seem to have any support for accessing the --test-params specified. My only option seems to be using the Xamarin Web Api, figuring out the test run (also not available via the Sdk) and then fetching the test-params from the test run meta-data.
The documentation on their site is extremely limited for these parameters.
Has anyone experienced similar issues in the past or found a potential solution?
Ideally, the config file is uploaded by default. However, if this is not an option, then solution 1 would be my preferred choice.

Turns out the issue was with a trailing "\" on the --assembly-dir that was causing the config file specified in --data to not be uploaded.
Changing:
".\XamarinMobileTests\bin\Release\"
to:
".\XamarinMobileTests\bin\Release"
Resolved the issue and the config file was successfully uploaded.
It looks as if the test-cloud.exe does some flakey comparisons on file paths.

Related

Azure Pipeline File Transformation is not working. Why?

I'm still trying to create my first Azure Pipeline CI / CD. My CI part is working fine, my CD is also working except I cannot apply my Web.config file transformations.
Let me first show you what I have then I will ask several questions below. The build with generated artifact. I also copy manually my 3 config files.
Wen I open my WebAPI.zip file here is the path and content:
Here is my pipeline project
And the details of my staging phase:
When I run this full pipeline my config file is never transformed but I get no error. I just get a
2019-05-02T03:27:23.5778958Z ##[warning]Unable to apply transformation
for the given package.
I also have the debug log with full information but it doesn't give me much information for now. I will add it here later.
Questions
Azure Pipeline File Transformation is not working. Why?
Is it because the File Tranform task only look for config file in zip?
Is this system then just ignoring my tranformation file in root of artifact?
So I think my manual copy of config transformation file is obsolete?
How can I then add my transformation file into my zip?
In my csproj I already set all my tranformation files on Build action content, copy always, this is ignored too, is it normal?
EDIT 1
One more important question: Is it possible to simply ask the deployment system to ignore or not deploy my config file. It is not something I want to deploy every time. I like the idea I have to do it manually or from alternative deployment system. With this solution I can have some other issues if I save a version or build variable in my config file. Then is it possible to modify a already deployed file after deployment? I'm looking for workaround here. Example: I read a value in my existing config file then I increment this value by one or simply replace this value with another?
EDIT 2
I'm now able to add the config file to the WebApi.zip package on root and/or in bin folder. I followed the comment of Shayki Abramczyk bu using the xml transform of deploy. Still not working. And the errors messages are so poor. Seriously Microsoft? Is your transformation system even working? I see question similar to mine everywhere.
And now I get
The file is correct, transform works fine from Visual Studio Publish tool. I really think the xml transform tool from Microsoft in Azure is just not working.
EDIT 3
Is it possible to issues from my transformmations come from NLog because of the name and then special rule I apply on it?

C++ project using Windows Event Log

I´m trying to learn the concept of writing events to Windows Event Log using Manifest and I followed the documentation provided by Microsoft.
I´ll describe the steps I took and where it went wrong. Hopefully someone can tell me whats missing or what I'm doing wrong.
Created a Instrumentation Manifest using ECManGen.exe proving information about the provider (C++ Console application), e.g. path to .exe-file. Created channels for all the type (Debug, Administration, Operational, and Analytic). Finally created an event that I
later wanted to write to log. (Also created Tasks and Keywords to organize the Event).
Created a new project in Visual Studio 2013 (C++ Console Application) and included the Manifest (.man) file.
Changed the build settings for the Manifest file to Custom build tool and set command line to mc -v -h . "%(FullPath)" and output to %(Filename).rc;%(Filename).h;.
I then built the project with no problems generating the .rc-file, .h-file, and .bin-files.
After the build I included the all the files to the project generated in Step 4 and rebuild. The rebuild generated the .res-file out of the .rc-file and the resource tab looks like this:
Project
-Manifest.rc
-11
The last step was to register the provider with wevtutil im Manifest.man and this is where I get the error. I received the following error:
Warning: Publisher GGSProvider resources are not accessible.
Failed to open metadata for publisher GGSEventManifest.man. The system cannot find the file specified.
Does anyone see what is wrong or can provide a simple step-by-step guide?
Thanks for any contribution!
The resourceFileName and messageFileName attributes in your manifest file must point to the full path of your dll. You cannot use environment variables in that path.
See http://msdn.microsoft.com/en-us/library/windows/desktop/dd996926(v=vs.85).aspx.
I did the following steps but with an DLL-project and it works fine. Can someone explain this behavior?
The next task is to create an event!

why is xcode 5 not finding a header file for newrelic enough though the library is there?

I added the newrelic objective-c library to my project and it worked fine. Compiled no issues. Checked everything into git and did a git pull from another machine. It compiles fine on that machine too.
But on our QA machine it gives the error
'NewRelicAgent/NewRelicAgent.h' file not found.
The QA machine is also using xcode 5 but there must be some difference I can't figure out.
The library is there under Frameworks. The header file is there I can see it! Any ideas?
One small difference I noticed is on my machine in the finder the icon for the library is:
A lego peice. But on the QA machine it's just a normal folder icon.
How did you add the framework? If you added it to the Build Phases pane, the headers dir should have been added to the header search path.
I have found that for whatever reason, when I add a third party framework, it works if you make a folder, not just a group, and then put the framework file in there. So the flow would be:
Make a group called thirdparty
Go to the inspector and make sure that the checkbox is checked for it to use a folder, and that there is a real folder there
Add it on the build phases pane, pointing to it in the folder
Then try and use an import. If it doesn't work, double check that the header dir was added. I did this many times with OCHamcrest.

VS2010 not embedding files into assembly

For some reason in VS2010 I can't embed any file into an assembly. These files have their Build Action property set to Embedded Resource as they should, but when the assembly is executed it founds no resources. For example, the following test code:
string[] list = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames();
string msg = (list.Length > 0) ? "Full" : "Empty";
MessageBox.Show(msg);
always shows "Empty" because GetManifestResourceNames() always returns an empty list.
This issue affects a project using nettiers in which is not convenient for that particular case to include the stored procedures into the DB, so they must be taken from the Procedures.xml file, which BTW is automatically set with Build Action= Embedded Resource after the classes generation, and then of course when a function tries to get any SQL script from it, the program fails.
I also created a couple of test projects where I tried to embed an xml and a gif, always with no success.
Update: The problem seems to be only for C#. I reproduced the test project in VB.Net and there the file does get embedded. I've noticed that in the output window, in the C# case, the compiler command line doesn't include the /resource option (which should be there followed with the name of the file to embed) whereas for the VB case it does appear.
Are there any global settings or configuration files anywhere for C# I should check? (The build options for the project have nothing strange there)
Does anyone have an idea of what may be happening and how to fix this?
Finally, I found the cause:
There was a wrong line inside the Microsoft.CSharp.targets file (located inside c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319). There was a tag written as:
<EmbeddedResourceF Include="#(_Temporary)" />
instead of
<EmbeddedResource Include="#(_Temporary)" />
Writing it right restored the ability to embed files
How that F appeared and why that file got altered in first place, I dont know... Despite being a .NET programmer for several years I just became aware today of the ".targets" files after searching the web about this issue, as never have had the need to look about the MSBuild stuff.

CruiseControl.NET Emails not containing build results or errors

I have some failing builds and the build data is missing from the emails sent from CCNET?
It contains tests run and modifications but no build or error data?
I don't think I have messed up the xsl's.. any thoughts?
UPDATE :
Yes i've looked at
http://confluence.public.thoughtworks.org/display/CCNET/Email+Publisher
and Yes in the publishers section i've called xmllogger before email
UPDATE :
I'm not sure if this means anything but.. in the compile.xsl it looks for
/cruisecontrol//buildresults//message
but there is no 'buildresults' node??
It just goes..
cruisecontrol --> build --> msbuild (then warnings, project, messages etc etc)
UPDATE :
Have the following in ccservice.exe.config. No mention of msbuild??
xsl\header.xsl
xsl\compile.xsl
xsl\unittests.xsl
xsl\fit.xsl
xsl\modifications.xsl
xsl\fxcop-summary.xsl
-- Lee
I had a similar problem yesterday with a new install of cruisecontrol as a service.
Make sure you have specified the correct xsl files in the ccnetservice.exe.config (if you are running the service) and ccnet.exe.config if you running the console version.
you need to restart the service/console app once these are updated.
HTH
Edit:
Are you using the standard msbuild logger, or Rodemeyer's one? If you are using Rodemeyer's, you need to use diffrent XSL transforms (msbuild2ccnet.xsl) to normal (compile.xsl, msbuild.xsl). There is a guide for that here
Check that your output is making it to the build log, located in server\<projectName>\artifacts.
If you have modified the xsl, make sure its in the correct folder (webdashboard\xsl and server\xsl). You can test the xsl works fine by copying the build log file (see server\<projectName>\artifacts directory). to a file, and adding the relevant XSL includes to the header then opening the XML file in a web browser)
EDIT:
in the <xslFiles> section of ccservice.exe.config, add another line like this:
<file name="xsl\compile-msbuild.xsl" />
or
<file name="xsl\msbuild.xsl" />
as i am not using the standard logger (you are though), i am uncertain as to which of those is needed. try one, then if that doesnt work, try the other!

Resources