lookfirst / sardine

an easy to use webdav client for java
Other
579 stars 185 forks source link

Integrate testcontainers #366

Closed LotharSpiegel closed 1 year ago

LotharSpiegel commented 1 year ago

Proposition to resolve https://github.com/lookfirst/sardine/issues/261 (missing test setup) by using the testcontainers Java library. The proposed solution spins up a WebDAV server inside a Docker container during tests. By using this approach, the test setup becomes independent from external resources, as opposed to using a publicly hosted WebDAV server.

dkocher commented 1 year ago

It should then be possible to no longer exclude the tests marked with @IntegrationTest ^1.

dkocher commented 1 year ago

It should then be possible to no longer exclude the tests marked with @IntegrationTest 1.

Footnotes

  1. https://github.com/lookfirst/sardine/blob/master/pom.xml#L107

@lookfirst Probably we should keep as is and run only unit tests in the surefire plugin?

lookfirst commented 1 year ago

It should then be possible to no longer exclude the tests marked with @IntegrationTest 1.

Footnotes

  1. https://github.com/lookfirst/sardine/blob/master/pom.xml#L107

@lookfirst Probably we should keep as is and run only unit tests in the surefire plugin?

I love this PR. Sounds good to only run unit tests in maven and then run integration tests in this PR.

LotharSpiegel commented 1 year ago

It should then be possible to no longer exclude the tests marked with @IntegrationTest 1.

Footnotes

  1. https://github.com/lookfirst/sardine/blob/master/pom.xml#L107

@lookfirst Probably we should keep as is and run only unit tests in the surefire plugin?

I love this PR. Sounds good to only run unit tests in maven and then run integration tests in this PR.

Thank you for reviewing! So do you mean to leave the exclusion of integration tests as is in the maven-surefire-plugin? If I understand correctly, the integration tests are then executed in the maven-failsafe-plugin.

dkocher commented 1 year ago

I suggest to just run integration tests as is with the maven-failsafe-plugin but enable by default ^1.

dkocher commented 1 year ago

@LotharSpiegel Do you have experience with testcontainers running in the context of Github Actions using Github-hosted runners? It seems there is no Docker environment available.