Using: Java, IntelliJ Community Edition, Azure DevOps, Ubuntu agent
Goal: To see accurate charted results of tests run either automatically when a pipeline is triggered, manually, or locally if a test is run locally in IDE
Steps so far:
tried in-built vs test as there was tons of documentation on it but it seems that's only for windows agents (and possibly only .net?) neither of which is an option. Link1. Link2.
installed cucumber-html-report app to azure devops
added cucumber dependencies to pom.xml and added the following code main runner
#CucumberOptions(features="classpath:LoginTest.feature", plugin={"pretty", "html:target/cucumber-html-report", "json:target/cucumber.json", "junit:target/cucumber.xml", "rerun:target/rerun.txt"})
tests run and output but when you open the file, there's no formatting (just raw js, html, etc)
I've spent so long on what seems like such a simple task. I suspect it's at least in part due to the fact that I'm still familiarising myself with Cucumber and Azure DevOps so I'm hoping someone will see something I've missed. At this point I've thrown everything I could find on Google at it and nothing has worked successfully. Any and all help is very much appreciated
I got the answer. It was this section:
"html:target/cucumber-html-report",
It was missing the .html at the end which is why I seemed to be following the instructions, getting some output, but not producing the expected result
Related
Using Intelliji Community Edition 2022.03 on windows 11, working with Maven 3.6.3 and Java-8.
Been experiencing strange issue: I cannot run single Junit||Blueprint test if that test has problem, the IDE always try to build the whole test file and then failed at that single problematic test. So the situation end up being I have to run all the test successfully in order to run single test. I am sure it is related to my local environment, because my colleges have no such problem we have everything the same. and I also have no such problem in linux VM.
I have tried
install unintall different versions of IDE
Modify test to not build before run, works, but if I change code, no auto detection, so barely
Any wise men got some ideas please ?
vscode 1.52 redhat 7.7
I believe I have all the extensions I need installed ( although the maven extension failed to install it looks like the pom file was read ). When I open a junit test case I see "run all Tests". When I select it I get an error
set "java.testMethod"" in ./vscode/settings.json
I've searched the web and the vscode documentation but am not finding a reference to java.testMethod so I don't have any idea what to set it to. I am also puzzled that it refers to .vscode/settings.json when that file is under .config/Code/User
I have met the same problem. And it was solved. The reason is that the class did not import the reference. You can check it.
Had very similar issue and it turns out finally that some extensions which I unconsciously installed were fine by the time there was an update.After reintsalling only needed extensions all went back to working mode.Be sure the Test Runner for java (should be in Extension Pack for Java) is enabled.
I've been at this for a couple days now but it seems the examples don't work or perhaps I have an environment issue so I'm hoping someone can help.
Here's what I've tried and works:
I have Eclipse Neon on Mac.
Installed All Google API SDKs available from the guide below as well
as here:
https://developers.google.com/eclipse/docs/install-eclipse-4.6
I followed this Quickstart succesfully:
https://cloud.google.com/dataflow/docs/quickstarts/quickstart-java-eclipse
So I have an Eclipse Dataflow Project that is able to read and write to CloudStorage. Awesome stuff.
GOAL/ISSUE
I now want to take the data from GCS, convert it into a BigQuery Dataset. For each file I'd like to create a new data set. Those details aren't really important for the question, although it would be a nice cherry on top, because where I'm stuck is a simple Hello World example of BigQuery with Eclipse or even CLI Tools. Any working examples would be appreciated or a simple nudge to existing documentation that has working samples. Again maybe it's how I'm compiling with Eclipse or Maven but I don't see any way to load a Google API based project.
ECLIPSE
In Eclipse I tried a bunch of things to simply test out BigQuery API:
loading a new Java Project by loading the google-cloud-java-master repository found https://github.com/GoogleCloudPlatform/google-cloud-java
Eclipse Screenshot
I proceeded to try to load the examples from the "google-cloud-examples" directory. This seems to have an issue because when I right click the CreateTableAndLoadData Class and choose to Run it, I get an error saying "Selection does not contain Main type". Which makes me feel stupid because there is a main function there.
GOOGLE EXAMPLES from java-doc-samples
I then moved on to Trying Google's own examples which are actually in a different repo called java-doc-sampleshttps://github.com/GoogleCloudPlatform/java-docs-samples/blob/master/bigquery/cloud-client/src/main/java/com/example/bigquery/SimpleApp.java
Google doc: https://cloud.google.com/bigquery/create-simple-app-api#bigquery-simple-app-query-java
I loaded these into Eclipse but I got a ton of errors during compilation.
Main errors:
Either com.google.cloud wasn't able to resolve or the package com.google.cloud.examples.bigquery.snippets wouldn't resolve. I could not get any of it to compile. The Class names were a bit different so I tried changing those with Eclipse auto-suggest but in the end BigQueryOptions.getDefaultInstance() ended up being an undefined method.
CLI gcloud
In the CLI I tried MVN compiling and running the google-cloud-exmaples/...CreateTableAndLoadData.java
mvn -X compile exec:java
-Dexec.mainClass=com.google.cloud.examples.bigquery.snippets.CreateTableAndLoadData
-Dexec.args="--project=myuniqueproject \
--stagingLocation=gs://myuniquebucket/staging/ \
--runner=BlockingDataflowPipelineRunner"
but I get these errors:
[ERROR] Failed to execute goal on project google-cloud-examples: Could
not resolve dependencies for project
com.google.cloud:google-cloud-examples:jar:0.8.2-alpha-SNAPSHOT: The
following artifacts could not be resolved:
com.google.cloud:google-cloud:jar:0.8.2-alpha-SNAPSHOT,
com.google.cloud:google-cloud-nio:jar:0.8.2-alpha-SNAPSHOT: Could not
find artifact com.google.cloud:google-cloud:jar:0.8.2-alpha-SNAPSHOT
-> [Help 1]
I now want to take the data from GCS, convert it into a Bigquery Dataset
I'm going to assume you meant "Table" and not "Dataset". A dataset is a collection of BigQuery tables.
You could save yourself a lot of work, and simply use a federated source to read the file(s) directly from GCS into BigQuery.
More info -> https://cloud.google.com/bigquery/external-data-sources
Recently I've upgraded SonarQube from 3.5 to 4.5.4 (LTS) and now there are a few users complaining that there are some reports missing on their project dashboards. The reports/numbers missing widgets are: lines of code and complexity. Unit tests coverage displays nothing. Other widgets (like technical debt, issues, directory tangle index) display 0 which also is suspicious. The project is in Java using the Sonar way profile.
The user does:
mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install
mvn sonar:sonar -Dsonar.login=login -Dsonar.password=***** -Dcom.sun.jndi.ldap.connect.pool.prefsize=0 -Dcom.sun.jndi.ldap.connect.pool.timeout=3600000
The sonar:sonar step shows "0 files indexed".
The log is huge so I don't want to paste it here. I could not find anything helpful in it. What do I need to do to have all reports I used to have?
I have a test project where most of the missing data is displayed "out of the box".
Starting with version 4.3, SonarQube no longer runs automated tests. It expects Jenkins/CI system to run the tests, create the JUnit/PMD/Jacoco/Clover etc. reports, and then tell SonarQube where to find them. (In older versions of SonarQube, this behavior could be achieved by setting the "reuseReports" flag to true.)
If the build is not configured to generate the reports, it will need to be adjusted to do so.
I'm using Cobertura 2.3.0 from http://cobertura.github.io/cobertura/ to analyze my project for test coverage, and I'm getting a
Error: Could not find or load main class net.sourceforge.cobertura.instrument.Main
When trying to execute cobertura-instrument.bat from the command line. I've looked at this batch file and it's trying to load several JARs from the %COBERTURA_HOME%/lib folder that don't exist. I've manually downloaded these JARs but am getting other strange errors.
java.lang.IncompatibleClassChangeError: class net.sourceforge.cobertura.instrument.pass1.DetectIgnoredCodeClassVisitor has interface org.objectweb.asm.ClassVisitor as super class
Is it possible that this release was incorrectly updated? I don't see a way to make this work any other way. Further, does anybody know of a working test-coverage utility, preferably a working different version of Cobertura?
I've tried Nounit and several others, but have not gotten the type of clean output that I know Cobertura can produce.
Answering my own question in hopes it can help somebody.
At time of writing, there is a known bug with Cobertura throwing a ClassNotFoundException in certain circumstances. See the following issue tracker page: https://github.com/cobertura/cobertura/issues/74#issuecomment-41383903
For the time being, I've gone with EclEmma Eclipse plugin for EMMA for my test code coverage, and got nice, pretty results the way I wanted.