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

Refactor system tests to use the new FTP server and to run in pytest #301

Merged
merged 76 commits into from
Feb 26, 2024

Conversation

jeremyestein
Copy link
Contributor

@jeremyestein jeremyestein commented Feb 14, 2024

To fix #293

Well, this was a journey.
A simple refactor of the system (E2E) test ran into a few problems:

  • the new, python-based FTP server hanging mysteriously
  • container->host networking being awkward, but also differently so on linux and non-linux
  • the FTP protocol itself (and python client implementation) interacting badly with the previous item (passive mode doesn't like NAT)

This explains some of the awkward workarounds in this PR.

Hopefully the benefits of moving it into pytest and having a non-flaky FTP server were worth it...

TODOs:

  • Refactor/dedupe "wait for X" type statements (including various TODO comments) - Add some logging to say how long each bit waited for.
  • Be sure that we are waiting sufficiently for steps to finish before performing tests. Ie. no race conditions.
  • Improve DICOM image check to check the full file paths (it already is checking the full directory, if not the file name)
  • Turn on options to make TLS mandatory? (I can't find them any more and I don't think we need it anyway?)

Copy link
Member

@milanmlft milanmlft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 This is looking great!

pixl_core/src/core/upload.py Show resolved Hide resolved
pytest-pixl/src/pytest_pixl/ftpserver.py Show resolved Hide resolved
test/conftest.py Outdated Show resolved Hide resolved
test/conftest.py Outdated Show resolved Hide resolved
test/run-system-test.sh Show resolved Hide resolved
test/conftest.py Outdated Show resolved Hide resolved
@stefpiatek stefpiatek dismissed their stale review February 22, 2024 18:34

stale review and happy for the rest of the team to decide if this is ready to go in

@jeremyestein jeremyestein requested a review from a team February 23, 2024 17:57
@jeremyestein
Copy link
Contributor Author

Thanks to those who've already had a look at this. I believe it is now actually ready to go in.

@jeremyestein jeremyestein requested review from milanmlft and removed request for milanmlft February 23, 2024 18:05
Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this in Jeremy, so much fun with FTP

docker-compose.yml Show resolved Hide resolved
pytest-pixl/src/pytest_pixl/helpers.py Show resolved Hide resolved
Copy link
Member

@milanmlft milanmlft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 works like a charm locally!

@jeremyestein jeremyestein merged commit 2db6331 into main Feb 26, 2024
8 checks passed
@jeremyestein jeremyestein deleted the jeremy/refactor-system-test branch February 26, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace flaky ftp server in system tests
4 participants