Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup/Installation of a SMB Server for JUnit Testing in SMB Module #3804

Closed
GregBragg opened this issue May 19, 2022 · 0 comments
Closed

Setup/Installation of a SMB Server for JUnit Testing in SMB Module #3804

GregBragg opened this issue May 19, 2022 · 0 comments

Comments

@GregBragg
Copy link
Contributor

GregBragg commented May 19, 2022

I wonder if we can look into using a Testcontainers with Samba Docker image for these kinds of JUnit tests: https://hub.docker.com/r/dperson/samba ...

I did look into an embedded SMB Server for our JUnit tests, such as like what we have for the (S)FTP modules, however there is none available. I would like to see a Samba container setup for the build process to use so that we can enable all of the JUnit tests to be run.

For localhost testing against an external SMB share, current practice is to update the JUnit test classes with a different config while the SMB Module code is under development.

Originally posted by @GregBragg in #3802 (comment)

oxcafedead added a commit to oxcafedead/spring-integration that referenced this issue Jul 11, 2022
Instead of manual SMB server setup and preparation, make it all
automated using convenient Testcontainers library and a bit of extra
code executed before tests.

More detailed,
* Change `localhost` to `127.0.0.1` for a proper integration with
docker container
* A few new config values to support container environment, like tmpFs,
share permissions and a dynamic port value
* Introduce Testcontainers API for container management
* Few configuration changes to support docker container usage
* Automatic dirs and files layout creation in `@BeforeAll`
* A few bugfixes where the assertion has not been done actually
* Couple of small changes related to assertions readability as well
oxcafedead added a commit to oxcafedead/spring-integration that referenced this issue Jul 11, 2022
Optimize imports and remove one unused exception declaration
oxcafedead added a commit to oxcafedead/spring-integration that referenced this issue Jul 11, 2022
Fix code styling according to the standards
oxcafedead added a commit to oxcafedead/spring-integration that referenced this issue Jul 11, 2022
Instead of manual SMB server setup and preparation, make it all
automated using convenient Testcontainers library and a bit of extra
code executed before tests.

More detailed,
* Change `localhost` to `127.0.0.1` for a proper integration with
docker container
* A few new config values to support container environment, like tmpFs,
share permissions and a dynamic port value
* Introduce Testcontainers API for container management
* Few configuration changes to support docker container usage
* Automatic dirs and files layout creation in `@BeforeAll`
* A few bugfixes where the assertion has not been done actually
* Couple of small changes related to assertions readability as well
oxcafedead added a commit to oxcafedead/spring-integration that referenced this issue Jul 12, 2022
Instead of manual SMB server setup and preparation, make it all
automated using convenient Testcontainers library and a bit of extra
code executed before tests.

More detailed,
* Change `localhost` to `127.0.0.1` for a proper integration with
docker container
* A few new config values to support container environment, like tmpFs,
share permissions and a dynamic port value
* Introduce Testcontainers API for container management
* Few configuration changes to support docker container usage
* Automatic dirs and files layout creation in `@BeforeAll`
* A few bugfixes where the assertion has not been done actually
* Couple of small changes related to assertions readability as well
oxcafedead added a commit to oxcafedead/spring-integration that referenced this issue Jul 12, 2022
Migrate to another docker image, elswork/samba

The previous docker image did not have proper versioned tags. We had to
use `latest` tag and this is not a very robust approach, so to avoid it
we have to either use a particular sha digest (which has drawbacks as
puts a lock on a particular CPU architecture) or use some different
image which is a much better solution.
oxcafedead added a commit to oxcafedead/spring-integration that referenced this issue Jul 12, 2022
oxcafedead added a commit to oxcafedead/spring-integration that referenced this issue Jul 12, 2022
Instead of manual SMB server setup and preparation, make it all
automated using convenient Testcontainers library and a bit of extra
code executed before tests.

More detailed,
* Change `localhost` to `127.0.0.1` for a proper integration with
docker container
* A few new config values to support container environment, like tmpFs,
share permissions and a dynamic port value
* Introduce Testcontainers API for container management
* Few configuration changes to support docker container usage
* Automatic dirs and files layout creation in `@BeforeAll`
* A few bugfixes where the assertion has not been done actually
* Couple of small changes related to assertions readability as well
oxcafedead added a commit to oxcafedead/spring-integration that referenced this issue Jul 12, 2022
Migrate to another docker image, elswork/samba

The previous docker image did not have proper versioned tags. We had to
use `latest` tag and this is not a very robust approach, so to avoid it
we have to either use a particular sha digest (which has drawbacks as
puts a lock on a particular CPU architecture) or use some different
image which is a much better solution.
@artembilan artembilan added this to the 6.0.0-M4 milestone Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants