-
Notifications
You must be signed in to change notification settings - Fork 641
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
FTP: run tests against (S)FTP server in Docker #1668
Conversation
Relevant Travis logs:
Not sure what's going on but it happens consistently. @ennru could you take a look please? On my local environment running |
I'm not sure about the Travis problem, will have a look tomorrow. |
* work with different file names to fix sporadic tests failures
Thank you, that did the trick. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, this makes me much more confident in the Ftp module's tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you once more for this effort, I really appreciate working with you. |
Awesome, my pleasure. |
Purpose
The purpose of this PR is to move tests from using an embedded FTP and SFTP server to using docker.
References
References #1663
Changes
Test files
All test classes related to setting up the embedded servers have been removed or simplified.
Some files have been renamed to remove the confusion between FPT and SFTP specific files.
There are now only two main classes that tests can extend:
BaseFtpSupport
for FTP and FTPS support andBaseSftpSupport
for SFTP support.Issues encountered:
BaseSftpSpec
and java equivalents had to be adapted to run tests inside anupload/
subfolder transparently.init.sh
script which overwrites the servers's self-generated keys on each startup and sets the correct rights.IOResult
doesn't guarantee that a file has indeed been fully written to disk yet, especially now that the server doesn't run on the jvm. To make tests pass more consistently I added aneventually
clause whenever a file content must be checked.SftpSettings
have to take that into account.Production files
CommonFtpOperations
has been changed to take into account the server timezone.While testing against docker I found out that there was a two hours discrepancy between the system time and the time reported in the
FtpFile
(I'm in GMT+2). It turns out that the underlyingFTPClient
gives aCalendar
instance for the last modified time which is subject to timezones. Setting the timezone to UTC fixes the issue but this should be reviewed more thoroughly.FtpIOGraphStage
callscompletePendingCommand
where needed. See FTP: sporadic test failures - toPath does not write all bytes to file #1669.