hendisantika / springboot-adminlte3-template

Spring Boot Admin LTE 3 Template
23 stars 21 forks source link

GitHub actions failed on some unit tests #4

Closed craph closed 2 years ago

craph commented 2 years ago

Hello @hendisantika ,

It looks like there are some issues in GitHub actions about tests. Did you seen it ? https://github.com/hendisantika/springboot-adminlte3-template/runs/6898159474?check_suite_focus=true

It looks like the test part about Hikari is not correctly working

what this code does : https://github.com/hendisantika/springboot-adminlte3-template/blob/main/src/test/java/com/hendisantika/SpringbootAdminlte3TemplateApplicationTests.java

@SpringBootTest
class SpringbootAdminlte3TemplateApplicationTests {

    @Test
    void contextLoads() {
    }

}

I suppose something is missing here may be bean declaration because the JUnit test is KO

Thank you very much. Best regards,

hendisantika commented 2 years ago

It can be skipped it.

craph commented 2 years ago

Do you know why the actions is failing on the tests ?

hendisantika commented 2 years ago

Because Spring Boot can't connect to MySQL Container.

craph commented 2 years ago

I suppose for the test you need to have an application.properties in the path : src/test/resources
When Spring Boot try to configure the context it will look in src/test/resources to find configuration to instanciate the database part.

craph commented 2 years ago

Otherwise this link can help to configure mysql : https://ovirium.com/blog/how-to-make-mysql-work-in-your-github-actions/

craph commented 2 years ago

I guess this is the application.properties that is missing in src/test/ressources

craph commented 2 years ago

did you try to only add missing application.properties in src/test/ressources first ?

hendisantika commented 2 years ago

It is working now @craph. You can check it now. Thanks by the way.

craph commented 2 years ago

what was the issue ? the missing config file in src/test/ressources ?

hendisantika commented 2 years ago

Yes, it is.