How to Pass -X Switch to SonarQube Scanner for MSBuild? - sonarqube-msbuild-runner

Log message states
`ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.`
How do I pass -X switch to Sonar Runner from MSBuild.SonarQube.Runner.exe. Is it in the begin command or end command?
My search is not yielding an answer for this how-to.

When make the call for the SonarQube runner add the following parameter:
/d:sonar.verbose=true

Related

azure devop selfhosted agent, newman command not recognized

Trying to run my postman collection in azure devops inside a self-hosted agent. When I try to run the command inside the agent "newman run postman_collection.json -e postman_environment.json -r cli,htmlextra" it's running fine. But when I run the same through a a command line script task in release pipeline it's throwing the error "newman is not recognized..". I also tried to have a npm task for newman installation i.e. "npm install -g newman" it's also throwing the erro "##[error]Unable to locate executable file: 'newman'. Please verify either the file path exists or the file can be found within a d...."
azure devop selfhosted agent, newman command not recognized
According to the error message "##[error]Unable to locate executable file: 'newman" when you using the npm install -g newman, you could try to add C:\Users\[BUILDSERVER-USERNAME]\AppData\Roaming\npm to the PATH variable for the [BUILDSERVER-USERNAME] user.
You could refer to this document How to fix the Newman task for Team Foundation Server silently failing for some more details.
Besides, when we use command line to install the newman, it will take a few minutes to install it, so we need to wait for a few minutes before we using the command line:
"newman run postman_collection.json -e postman_environment.json -r cli,htmlextra"
You could add powershell task to sleep a few minutes:
echo "Sleeping for 10 mins..."
Start-Sleep -s 600

How to change URL from CI/CD in Gitlab on Automation Testing using Robot Framework

I have 3 env (dev/test/prod) and I want to change the URL from the gitlab-ci.yml so I can choose from CI/CD which env I want to run the tests.
Currently I run:
- robot -v BROWSER:Chrome -d results/Chrome test/test.robot
I can't find any info on this. Is it possible?
You can pass URL though command line, try below solution
- robot -v url:http://your_url -v BROWSER:Chrome -d results/Chrome test/test.robot

How to fix missing swagger input or config?

I am facing issue while generating code via swagger cli using csharp-dotnet2 template.
It is almost same issue as mentioned Here
I am able to generate the code from https://editor.swagger.io/
but when I am using swagger cli as i need to modify the template
I have tried generating code with different version of swagger and currently using swagger-codegen-cli-3.0.27.jar. but it is not working.
Please check attached screenshot here
Command
java -cp swagger-codegen-cli-3.0.27.jar io.swagger.codegen.Codegen -i vendor.yaml -l csharp-dotnet2 -o outputdir.
Use this command instead:
java -jar swagger-codegen-cli-3.0.27.jar generate -i vendor.yaml -l csharp-dotnet2 -o outputdir

Is is possible to modify the maven console output to hide the [INFO] logging?

I was wondering if it was possible to modify the output from maven to for example hide the lines that start with [INFO] or to be able to see lines that start with [DEBUG]?
I don't think there is a way to configure it as a logger but mvn -q hides the [INFO] lines and mvn -X shows the debug messages.
Update in 2015: newer versions of maven have added a config file where this is finally possible although as a global per install configuration, check on your $mavenInstallationDir/conf/logging/simplelogger.properties if the file doesn't exist then your maven version is probably too old, I believe it was added on the 3.1 release
You can activate debug output using -X or --debug. For example:
mvn -X install
You can hide INFO messages using -q or --quiet. For example:
mvn -q install
try grepping the output, e.g.
mvn help:evaluate -Dexpression=project.version | grep -v "^\["
From their own docs, you want this:
RESULT=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo $RESULT
For reference, see: https://maven.apache.org/plugins/maven-help-plugin/evaluate-mojo.html#forceStdout

Maven:Output Build log

In Ant we have the provision to send the Build details to a log file by specifying the log file as a param while invoking the Ant build like ant -l $BUILDLOG
Do we have a similar functionality in Maven ?
I added > mvn_build_log.txt to the end of my command to output the mvn build output.
Not in maven 2. But it was added in maven 3 (currently in alpha) in the same form. e.g. mvn -l $BUILDLOG.