Building Springboot 2.6.3 from source - unable to exclude tests - spring-boot

I am attempting to build the spring-boot 2.6.3 packages from source as per the spring-boot instruction on the official github page by running .gradlew publishToMavenLocal -x test , with tests excluded. However, this is failing because one of the executed tasks spring-boot-project/spring-boot-actuator-autoconfigure:asciiDoctor has a dependency on its tests!
Hence the build fails if the tests are excluded.
Are there any workarounds to this ?

Related

java test failure on a specific agent

I am encountering an issue with a Maven build job on Jenkins -
when it runs on "agent2" it succeeds!
when the same job runs on "agent2" it fails a specific test every time...
the code is the same in both runs.
we use Maven Integration plugin.
artifact resolve from artifactory.
edit with more info:
java 1.8, a junit test that uses assert - on one agent gets an expected value - while on the other not. there are no clear-to-the-eye differences between the agents - trying to find out what this difference may be. the code is pulled from bitbucket and then built with maven(clean install)
any ideas?
Thanks!

Running API tests in Teamcity build step

I have a Spring Boot Maven app. There is a bunch of API tests using RestAssured, inside the project. These tests are not marked as #SpringBootTest, therefore when running them, the context of the application is not raising so to make tests pass the application must be up and running before.
I'm creating a Teamcity build in which I want to:
Start the app
Run RestAssured tests
Create an artifact
I'm using an Agent with maven installed.
The question is:
How can I create a build step where I run the application on a defined port and then run api tests
against it?
What I've tried is creating such build steps:
Command line: mvn spring-boot:run & sleep 50s mvn test
Maven step/command line: mvn clean package -DskipTests
I thought the spring boot application will start and tests will be ready to start after some time. On successful step 1 I create an artifact.
The problem is that the build step is never exited because of spring boot app running (blocking terminal).

Why does gradle not find the resources?

I'm currently trying to migrate a project from Gradle 3.5 to the latest Gradle version 4.9. and I'm running into the problem, that Gradle doesn't find the resources that it needs to execute the junit tests. These resources are generated upfront and contain some configuration files and referential data.
The project uses a combination of npm and Gradle to compile. Usually we run a npm script which executes a couple of tasks sequentially using run-s, e.g. webpack builds to generate some static resources. At the end we compile everything together using Gradle. The last Gradle task also executes the junit tests. This step fails and makes the whole build fail. The Gradle runner complains that some resources are not found, although the get properly copied to the right places.
When I execute ./gradlew test --rerun-tasks (Yes, we use the wrapper, which has been properly upgraded, too) right after the last Gradle build step failed, it executed the junit tests successfully.
I know, that the directory structure changed in Gradle 4.x, but this doesn't seem to be the problem.
My suspicion is, that it has something to do with how we normally run the whole build process. Something in the combination with npm.

How to use rerunFailingTestsCount on Maven install

I am running my cucumber Scenarios using tymers parallel execution plugin. for that I need use Maven installn to create test runners and to run those runners. I used rerunFailingTest count in maven surefire 2.19.1 and Junit 4.12. but it is not working while nusing maven Install. If I use maven test test ru nners are not generations and my execution is not processing.
can any one please helpi me to resolve this issue to use rerunFailingTestsCount in mven install

Unit test data success/failure/count not being passed to SonarQube

I use sonarqube for analyzing a project with mixed Java / Groovy tests. The Java tests are run via TestNG, whereas the Groovy tests are run via JUnit. When running the Gradle "sonarqube" task, I get the following in build log (with --debug option):
14:38:53.842 [DEBUG] [org.sonarqube.gradle.SonarQubeTask] Class not found in resource cache : a.b.c.SomeSpec
14:38:53.842 [WARN] [org.sonarqube.gradle.SonarQubeTask] Resource not found: a.b.c.SomeSpec
This is only logged for Groovy tests.
I use two separate tasks to run JUnit / TestNG tests, and a JacocoMerge task from the Gradle Jacoco plugin to merge the binary reports from those tests. As a result, Sonarqube displays the coverage percentage correctly, however, when displaying the list of unit tests, all JUnit (hence, Groovy in my case) tests are missing.
I read No Unit Test Success data for tests written in Groovy and tried using the latest version of the plugin, however, the issue still persists. Is there any way to get both coverage AND unit test information to be displayed properly in Sonarqube using the SonarQube Gradle plugin?
I used SonarQube version 5.6.3., sonarQube Groovy plugin version 1.4 and sonarqube-gradle-plugin version 2.2

Resources