Allure gradle integration - gradle

I'm trying to integrate Allure reports into a Gradle build. It seems there is no direct support for Gradle overall (all Maven) and only some recent support for TestNG. Digging further I see a number of issues with Gradle not supporting JUnit listeners, but they do support TestNG listeners (because TestNG does). I've tried a gradle integration following the Maven pom as guideline for the JUnit plugin, but it obviously produces no output.
So I guess my question is :
Will there be any gradle support coming soon or will we have to wait for Gradle to enable some sort of JUNit listener facility first?
If none of the above, has anyone done a custom integration ?

Allure TestNG Gradle example here https://github.com/allure-examples/allure-gradle-testng-example
It's works because TestNG supports Java SPI for adding test listeners. But JUnit does't have such feature. You can check out the following PR to JUnit https://github.com/junit-team/junit/pull/923
If you need Gradle support for JUnit right now you can try to implement Gradle Test Listener (http://www.gradle.org/docs/current/javadoc/org/gradle/api/tasks/testing/TestListener.html)
Hope it helps

Related

Is it possible to integrate Maven Surefire with a custom testing framework?

From the Surefire documentation I understand that it can auto-detect basically only JUnit & TestNG. Is it possible to connect it to another testing framework?
Would appreciate links to any samples.

Adding a gatling test to a Spring Boot gradle project on IntelliJ

I have a Spring Boot 2 application written in Kotlin (could be Java). The project uses gradle (not maven). The application exposes HTTP endpoints that I want to load test using gatling.
I created a MySimulation.scala file under src/test/gatling. IntelliJ suggested and I accepted the intallation of the Scala IntelliJ plugin. So, I got syntax highliting on the scala editor. :^)
I'd like to have code assist (drill down, code completion) for the scala gatling tests.
What other tools/plugins/configuration do I need to add?
(I have the gatling bundle already installed on my computer. IntelliJ version is 2018.2.4.)

RestAssured Spring Boot Test returning 404s

I am building an API using Spring Boot and Katharsis. When writing integration tests using RestAssured my tests are passing in STS but getting 404s in Maven. I'm not sure what the difference might be or why it isn't working.
Running the API things are working as expected.
I was wondering if anyone had any thoughts?
Code Repo is here: https://github.com/Holmes89/liturgical-project
So the problem had to do with the fact Reflections wasn't populating my ResourcesRepository on test startup. I found a similar problem here:
Unit test using the Reflections google library fails only when executed by Maven
And used the following link to configure the Maven Surefire Plugin:
http://maven.apache.org/surefire/maven-surefire-plugin/examples/class-loading.html
Adding the following config helped:
<useSystemClassLoader>false</useSystemClassLoader>

How to instrument fragment bundles JUNIT tests using Cobertura?

We are trying to measure our code coverage of JUNIT test cases using Cobertura. Our application is a Java stack which was designed by OSGI model. Due to fragment bundle implementation of my test Cobertura is not able to calculate the code coverage against my source code. We are using surefire plugin in Maven.
Kindly share your thoughts/inputs about it.
When we started developing based on OSGi we replaced Cobertura to Jacoco as it can work as a Java agent. It also has a maven plugin.
Jacoco works until there is bytecode weaving in the runtime as in that case the hashcode of the classes will be changed. E.g.: If you use Aries-Proxy, Jacoco will not work.

RepositorySystemSession Null in Maven 3 Plugin Unit Test

I am attempting to write a unit test for a Maven 3 Plugin with a dependency on Aether using the Maven Plugin Testing Harness. When executing my tests though the RepositorySystemSession is null and after an extensive search I can not figure out how to inject a session into the unit tests plugin harness.
I am using Maven 3.0.3 core APIs, Maven Plugin Test Harness 2.0 and Aether 1.12. I have tried other various combinations but appear to be missing a critical component somewhere along the line.
The code base for the example can be found here: http://www.sonatype.com/people/2011/01/how-to-use-aether-in-maven-plugins/.
The documentation for the plugin harness can be found here: http://maven.apache.org/plugin-testing/maven-plugin-testing-harness/getting-started/index.html.
My example code can be seen here:
MyAetherMojo
MyAetherMojoTest
Any ideas on how to get the RepositorySystemSession injected into the container for the unit test?
TIA,
Scott ES
The plugin testing harness does not support Aether testing. You have to use the Maven Invoker Plugin as demonstrated in the How To Use Aether in Maven Plugins demo code.

Resources