Publishing test results through command line test runner in VSTS - automated-tests

I'm trying to use vstest.console.exe with the TfsPublisher logger in VSTS (cloud).
There's a URL example shown in the article for TFS onsite, but I'm trying to work out what parameters to use for my VSTS build. The example is:
/logger:TfsPublisher;Collection=http://localhost:8080/tfs/DefaultCollection;TeamProject=MyProject;BuildName=DailyBuild_20121130.1
But I just get an error saying the build cannot be found in the project, e.g.
Error: Build "1234" cannot be found under team project "MyProject".
I believe the problem is the BuildName parameter. My project and build definition have no spaces in the names. I have tried various values, e.g.:
BuildName=%BUILD_BUILDID% (resolves to number, e.g. 1234)
BuildName=%BUILD_DEFINITIONNAME% (resolves to build definition name OK)
BuildName=%BUILD_BUILDURI% (resolves to url, e.g. vstfs:///Build/Build/1234)
The error message confirms that the environment variables seem to be resolving OK, but I can't determine what I should substitute for "DailyBuild_20121130.1" in my case.
Updated: My vstest.console.exe logger parameter currently looks like
/logger:TfsPublisher;Collection=%SYSTEM_TEAMFOUNDATIONCOLLECTIONURI%;TeamProject=%SYSTEM_TEAMPROJECT%;BuildName=%BUILD_BUILDNUMBER%

I effectively got the result I wanted using the Trx logger and one of the "Publish Test Results" build steps:
vstest.console.exe ... /logger:Trx

The build name is generated by "Build number format" under build definition "General" tab. You can get it from "BUILD_BUILDNUMBER" variable.

Related

How do I use JARs stored in Artifactory in spark submits?

I am trying to configure the spark-submits to use JARs that are stored in artifactory.
I've tried a few ways to do this
Attempt 1: Changing the --jars parameter to point to the https end point
Result 1: 401 Error. Credentials are being passed like so: https://username:password#jfrog-endpoint. The link was tested using wget and it authenticates and downloads the JAR fine.
Error
Attempt 2: Using a combination of --packages --repositories
Result 2: URL doesn't resolve to the right location of the jar
Attempt 3:Using combination of --packages and modified ivysettings.xml (containing repo and artifact pattern)
ivy settings
Result 3: URL resolves correctly but still results in "Not Found"
After some research it looks like the error might say "Not Found" and the it looks like it has "tried" the repo, it could still very well be a 401 error.
Error
Any ideas would be helpful! Links i've explored:
Can i do spark-submit application jar directly from maven/jfrog artifactory
spark resolve external packages behind corporate artifactory
How to pass jar file (from Artifactory) in dcos spark run?
https://godatadriven.com/blog/spark-packages-from-a-password-protected-repository/
https://spark.apache.org/docs/latest/submitting-applications.html#advanced-dependency-management
You can use https://username:password#jfrog.com/rep, however you need to specify port.
https://username:password#jfrog.com:443/repo
I discovered this using Artifactory's "set me up" tool for package type Ivy. If you look in the resolver url it specifies the port.

Crashlytics NDK How to Enable native symbol uploading

I am tring to enable crashlytics for my NDK android app. Ive followed the the guide here. I got stuck on Step 2.
Step 2: Enable native symbol uploading To produce readable stack:
traces from NDK crashes, Crashlytics needs to know about the symbols
in your native binaries. Our Gradle plugin includes the
uploadCrashlyticsSymbolFileBUILD_VARIANT task to automate this process
(to access this task, make sure nativeSymbolUploadEnabled is set to
true).
For method names to appear in your stack traces, you must explicitly
invoke the uploadCrashlyticsSymbolFileBUILD_VARIANT task after each
build of your NDK library. For example:
>./gradlew app:assembleBUILD_VARIANT\
app:uploadCrashlyticsSymbolFileBUILD_VARIANT
What does For method names to appear in your stack traces, you must explicitly invoke the uploadCrashlyticsSymbolFileBUILD_VARIANT task after each build of your NDK library.mean? I also saw that they left a line with gradlew. Is this a command on a command line? I am very lost. Can anyone help me achieve step 2?
I was also at a lost, but finally understand.
This command should be like this.
At first, move to the directory
cd /YourProjectRootPath/proj.android/
You can find gradlew file in this directory.
Then execute gradlew to run two tasks.
Task1: assembleDebug or assembleRelease
Task2: uploadCrashlyticsSymbolFileDebug or uploadCrashlyticsSymbolFileRelease
the command is, (Example of debug)
./gradlew XXXXXX:assembleDebug XXXXXX:uploadCrashlyticsSymbolFileDebug
Please replace "XXXXXX" to your "app name".
If you don't know what is your app name, please run the command below.
./gradlew tasks --all
You can see all task names and can find these two tasks.
XXXXXX:assembleDebug
XXXXXX:uploadCrashlyticsSymbolFileDebug
This "XXXXXX" is your "app name".
I don't know why Google describes such a complicated command using ">" and "\", but it's just a simple command,
./gradlew <TASK1> <TASK2>
When you add "nativeSymbolUploadEnabled true" to your gradle file like mentioned in Step1 this will instruct the gradle plugin to generate a new task with the format "uploadCrashlyticsSymbolFileBUILD_VARIANT" for each build type and architectures. Check this screenshot where I only have one build type "release" but also have three architectures. The tasks generated are:
uploadCrashlyticsSymbolFileArm8Release
uploadCrashlyticsSymbolFileUniversalRelease
uploadCrashlyticsSymbolFileX86_64Release
To run these tasks, you will need to either execute the command in a terminal updated for the desired build variant, e.g.
>./gradlew app:assembleX86_64\
app:uploadCrashlyticsSymbolFileX86_64Release
Or manually calling those tasks in the gradle tab. They need to be executed in this order (first the assemble and then the uploadCrashlyticsSymbolFile...) to make sure the binaries have been created for Crashlytics to generate and upload the symbol files.
To answer your question: What does For method names to appear in your stack traces, you must explicitly invoke the uploadCrashlyticsSymbolFileBUILD_VARIANT task after each build of your NDK library.mean? Crashlytics will need the symbol files in order to convert the crash report into a readable stack trace with method names and line numbers.

RedundantNameQualifier error when Running Resharper CLI inspect tool

I'm using Resharper inspect CLI tool for static code analysis(JetBrains.ReSharper.CommandLineTools.2018.3.1\InspectCode.exe) on a dotnet core 2.1 console application I've created. Within the solution, there is a separate project which is just a package used in the console app.
Layout is as follows:
When I run the inspectCode.exe as follows:
JetBrains.ReSharper.CommandLineTools.2018.3.1\InspectCode.exe "AI.DL.Backup\AI.DL.Backup.csproj" /o:"CodeInspection_20222.xml" /profile:"AI.DL.Backup.sln.DotSettings"
I get the following issue:
Output xml report has the following:
<IssueType WikiUrl="https://www.jetbrains.com/resharperplatform/help?Keyword=RedundantNameQualifier" Severity="WARNING" Description="Redundant name qualifier" CategoryId="CodeRedundancy" Category="Redundancies in Code" Id="RedundantNameQualifier"/>
<Issue Message="Qualifier is redundant" Line="5" Offset="146-154" File="AI.DL.Backup\src\AI.DL.Backup\Startup.cs" TypeId="RedundantNameQualifier"/>
The problem seems to be that it cannot find the dll project referenced and is throwing code analysis error (code HAS been built already, so bin/obj folders exist with relevant dlls/packages required).
Ling 5 (as specified) is just the using statement for the separate package, which it cannot resolve and is deeming to be redundant.
using AI.DL.DocumentManagement;
using AI.DL.DocumentManagement.Stores;
Going by the generated XML report, I can see that it can't find the namespace within the separate package. Why would this be? Anyone seen this before?
I was able to work around this issue when I repointed the "inspect.exe" to my solution file instead of individual project!

Time stamping output files throws error for report

call pybot --timestampoutputs --log mylog.html --report NONE tests.html
[ ERROR ] Parsing 'tests.html' failed: Data source does not exist.
I want to create report with time stamp but throws error. Any example as how to generate reports with unique name with time-date.
The error you report, "Data source does not exist", is not because of your use of the --timestampoutputs option. It's because robot can't find "tests.html".
--timestampoutputs works fine when you give it a valid test suite. For example, when I ran the code in your question I ended up with a log file named mylog-20150220-053904.html.

MSDeploy Parameter

I am trying to pass application pool password as a command line argument to msdeploy.exe. Also, I am passing setParameter file as another command line agrument. The overall command line looks like this
msdeploy.exe -verb:sync -source:package=D:\package.zip,encryptPassword="password" dest:auto,computername=mycompuetrname -setParam:name="AppPoolPassword",value="mypassword" -setParamFile="D:\Test.setParameters.xml"
Other things to be noted, Test.setParameters.xml file does NOT have AppPoolPassword param, because I want to pass that as command line as mentioned above.
When I execute the above command, I get an error which says "ApplicationPoolPassword cannot be null". If I do not specify the parameters.xml file but just specify AppPoolIdentity and AppPoolPassword on the command line the command is successful and creates the necessary web site structure.
My question is does setParamFile overrides the -setParam command line paramters? I did google search but did not find anything which confirms that. Anyone who has experienced this, please help.
Thanks
Regarding setParamFile overriding setParam, you've got it backwards. The setParam parameter takes precedence over the setParamFile.
Regarding the error, it looks like your parameter names are off. The error references parameter name "ApplicationPoolPassword". Your command is using the parameter name "AppPoolPassword". Try changing the command to use the name "ApplicationPoolPassword".

Resources