I am using below library versions in my SpringBoot project and cucumber for integrations tests,
Java - 11.0.11
Maven - 3.8.1
SpringBoot - 2.3.12.RELEASE
Cucumber - 6.10.4
Junit5 Jupiter - 5.4.0
Failsafe plugin - 3.0.0-M5
Although cucumber feature tests are being picked up and executed, I am not seeing any execution report from fail-safe plugin,
[INFO] --- maven-failsafe-plugin:3.0.0-M5:integration-test (default) # my-project ---
[INFO] Failsafe report directory: /Users/ZZZ/my-project/target/failsafe-reports
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.3.12.RELEASE)
2021-07-08 INFO 77791 --- [ main] Started SpringContext in 4.018 seconds (JVM running for 6.525)
Scenario: some scenario # /some_scenario.feature:2
Given some precondition
When some action is taken
Then something should have happened
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
I am wondering what's missing in my setup which is leading to fail-safe plugin output like this,
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
More worrying thing is that even if any cucumber test fails, fail-safe is not reporting anything and maven build succeeds. This could easily lead to false positives.
fixed by reverting both surefire and failsafe plugin to 2.22.2
Related
The application stands up on the default profile, but should be on herok. What's wrong with my setup?
Procfile:
web: java -Dspring.profiles.active=heroku -jar build/libs/todo-api-all.jar
aplication-heroku.properties:
spring.jpa.generate-ddl=true
spring.jpa.show-sql=true
# App Properties
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:postgresql://localhost:5432/test
spring.datasource.username=xxxx
spring.datasource.password=xxxx
logs:
2022-03-17T22:16:37.062638+00:00 heroku[web.1]: Starting process with command `java -Dspring.profiles.active=heroku -jar build/libs/todo-api-all.jar`
2022-03-17T22:16:37.769060+00:00 app[web.1]: Setting JAVA_TOOL_OPTIONS defaults based on dyno size. Custom settings will override them.
2022-03-17T22:16:37.772288+00:00 app[web.1]: Picked up JAVA_TOOL_OPTIONS: -XX:+UseContainerSupport -Xmx300m -Xss512k -XX:CICompilerCount=2 -Dfile.encoding=UT
F-8
2022-03-17T22:16:38.078366+00:00 app[web.1]:
2022-03-17T22:16:38.078397+00:00 app[web.1]: . ____ _ __ _ _
2022-03-17T22:16:38.078410+00:00 app[web.1]: /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
2022-03-17T22:16:38.078428+00:00 app[web.1]: ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2022-03-17T22:16:38.078446+00:00 app[web.1]: \\/ ___)| |_)| | | | | || (_| | ) ) ) )
2022-03-17T22:16:38.078463+00:00 app[web.1]: ' |____| .__|_| |_|_| |_\__, | / / / /
2022-03-17T22:16:38.078481+00:00 app[web.1]: =========|_|==============|___/=/_/_/_/
2022-03-17T22:16:38.080265+00:00 app[web.1]: :: Spring Boot ::
2022-03-17T22:16:38.080285+00:00 app[web.1]:
2022-03-17T22:16:38.151045+00:00 app[web.1]: 22:16:38.149 [main] INFO be.ordina.jworks.todoapi.TodoApplication - Starting TodoApplication using Java 17.0.2 o
n b96d702f-a867-4f6c-a1e7-a1c9c48b6f27 with PID 4 (/app/build/libs/todo-api-all.jar started by u47513 in /app)
2022-03-17T22:16:38.151382+00:00 app[web.1]: 22:16:38.151 [main] DEBUG be.ordina.jworks.todoapi.TodoApplication - Running with Spring Boot, Spring
2022-03-17T22:16:38.152810+00:00 app[web.1]: 22:16:38.152 [main] INFO be.ordina.jworks.todoapi.TodoApplication - No active profile set, falling back to 1 def
ault profile: "default"
2022-03-17T22:16:38.153431+00:00 app[web.1]: 22:16:38.153 [main] DEBUG org.springframework.boot.SpringApplication - Loading source class be.ordina.jworks.tod
oapi.TodoApplication
I'm trying to run an AWS Lambda using Docker image build by paketobuildpacks/builder using spring-native + spring-cloud-function-aws, but it's not handling incoming values, justs starts and returns an error, did I missed something?
Log output:
START RequestId: f7a451f1-f43b-4ba0-be3d-58526bfa0d10 Version: $LATEST
2021-06-30 00:20:58.229 INFO 8 --- [ main] o.s.nativex.NativeListener : This application is bootstrapped with code generated with Spring AOT
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.5.1)
2021-06-30 00:20:58.251 INFO 8 --- [ main] o.s.boot.SpringApplication : Starting application using Java 11.0.11 on 169.254.41.117 with PID 8 (started by sbx_user1051 in /workspace)
2021-06-30 00:20:58.251 INFO 8 --- [ main] o.s.boot.SpringApplication : No active profile set, falling back to default profiles: default
2021-06-30 00:20:58.551 INFO 8 --- [ main] o.s.boot.SpringApplication : Started application in 0.42 seconds (JVM running for 0.421)
END RequestId: f7a451f1-f43b-4ba0-be3d-58526bfa0d10
REPORT RequestId: f7a451f1-f43b-4ba0-be3d-58526bfa0d10 Duration: 840.41 ms Billed Duration: 841 ms Memory Size: 128 MB Max Memory Used: 29 MB
RequestId: f7a451f1-f43b-4ba0-be3d-58526bfa0d10 Error: Runtime exited without providing a reason
Runtime.ExitError
Find my configs below:
Gradle Plugins:
kotlin("jvm")
kotlin("plugin.spring")
id("io.spring.dependency-management")
id("org.springframework.boot")
id("org.springframework.experimental.aot")
id("org.graalvm.buildtools.native")
Dependencies:
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.springframework.cloud:spring-cloud-function-adapter-aws")
implementation("com.amazonaws:aws-lambda-java-events:2.0.2")
implementation("com.amazonaws:aws-lambda-java-core:1.1.0")
GraalVM plugin config:
tasks.withType<BootBuildImage> {
builder = "paketobuildpacks/builder:tiny"
environment = mapOf("BP_NATIVE_IMAGE" to "true")
}
App sources:
#SpringBootApplication
class LinkGeneratorApplication: ApplicationContextInitializer<GenericApplicationContext> {
override fun initialize(applicationContext: GenericApplicationContext) {
applicationContext.registerBean(
"function",
FunctionRegistration::class.java,
{
FunctionRegistration(Function<Input, Result> { Result("Here") })
.type(
FunctionType
.from(Input::class.java)
.to(Result::class.java)
.type
)
}
)
}
}
data class Input(val sellerId: String, val ownerId: String, val market: String)
data class Result(val message: String)
fun main(args: Array<String>) {
runApplication<LinkGeneratorApplication>(*args)
}
I am currently using spring-boot with the org.testcontainers library to pass test in docker . But I noticed that the following message appears several times :
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.20.RELEASE)
It appears up to 4 times , 2 of them with the following message :
11:33:23.733 [main] INFO org.springframework.web.context.support.GenericWebApplicationContext - Refreshing org.springframework.web.context.support.GenericWebApplicationContext#13ffeba4: startup date [Wed Jun 16 11:33:23 CEST 2021]; root of context hierarchy
Some messages that have caught my attention, first time that appears (the only one I think necessary)
11:31:48.515 [main] INFO org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer - Tomcat initialized with port(s): 0 (http)
11:31:49.019 [localhost-startStop-1] INFO org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 5416 ms
2 : It does not appear Why?
3:
11:35:06.738 [main] INFO org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer - Tomcat initialized with port(s): 0 (http)
11:35:06.764 [localhost-startStop-1] INFO org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 1569 ms
4:
11:36:19.343 [main] INFO org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer - Tomcat initialized with port(s): 0 (http)
11:36:19.362 [localhost-startStop-1] INFO org.springframework.web.context.ContextLoader - Root WebApplicationContext: initialization completed in 454 ms
The message always pops up after a specific test, for example the third time during this test.
#Category(OneTest.class)
public class PasswordEncryptionTest
{
#Test
public void passwordEncryptionTest()
{
PasswordEncryption passwordEncryption = new PasswordEncryption();
try
{
String password = "passwordExample";
String encrypted = passwordEncryption.encryptPassword(password.toCharArray());
String decrypted = passwordEncryption.decryptPassword(encrypted.toCharArray());
assertEquals(password, decrypted);
}
catch (PasswordDecryptionException e)
{
e.printStackTrace();
fail(e.getMessage());
}
}
}
Is this normal ? Because it is the message that appears when you start the application and that it appears 4 times, that is what I noticed.
Can it be affecting the performance of the tests?
Pd: They are messages, after passing the tests many times, in different environments, they are not the result of chance. I have seen no relationship in the times between the different appearances. (It does not follow a time pattern)
spring-boot 1.5.20
junit47
org.testcontainers 1.13.0
Docker windows 2.2.0.3
I am running a fat jar packaged by quarkus with jvm param -Duser.language=en
but it seems , not accepted by quarkus. Any suggestion / hints for solving this problem?
java -jar MyApp.jar -Duser.language=en
__ ____ __ _____ ___ __ ____ ______
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2021-03-11 09:57:38,910 INFO [org.apa.cam.qua.cor.CamelBootstrapRecorder] (main) bootstrap runtime: org.apache.camel.quarkus.main.CamelMainRuntime
2021-03-11 09:57:38,914 INFO [org.apa.cam.qua.mai.CamelMainRuntime] (main) Starting camel-quarkus with args: [-Duser.language=en]
Unknown option: -Duser.language=en
Try java -Duser.language=en -jar MyApp.jar.
Arguments before -jar are handled by the JVM, while arguments after -jar are supposed to be handled by the application.
In CI part most of the times I prefer standard maven phases to execute build steps. In these cases I override application.properties e.g.: -Dlogging.level.root=OFF -Dspring.main.banner-mode=off to turn off debugging logs and save some precious build time.
In some pipelines I prefer to use maven release plugin and I noticed that these flags does not work there.
e.g.: mvn release:prepare -Dspring.main.banner-mode=off
[INFO]
[INFO] . ____ _ __ _ _
[INFO] /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
[INFO] ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
[INFO] \\/ ___)| |_)| | | | | || (_| | ) ) ) )
[INFO] ' |____| .__|_| |_|_| |_\__, | / / / /
[INFO] =========|_|==============|___/=/_/_/_/
[INFO] :: Spring Boot :: (v2.1.4.RELEASE)
[INFO]
Still display spring banner
Any suggestion?