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

[Testing] Test SSH file transfer with images. #208

Open
wants to merge 48 commits into
base: main
Choose a base branch
from

Conversation

JoeZiminski
Copy link
Member

@JoeZiminski JoeZiminski commented Oct 9, 2023

This PR implements SSH tests through a docker image. They key changes in this PR are:

  • update code_test_and_deploy.yml to selectively run SSH tests in linux runners. This is because the Windows and macOS runners already are in a container, so it's not possible to run a container from within these containers ('nested containerisation').
  • Allow SSH transfer from other ports than the default port 22, by setting an environment variable. This was done for tests as port 22 is already used in GitHub actions.This is added in canonical_configs.py. At the moment this is not documented / exposed to users. In general I don't think there will be much need to SSH from other ports except for 22. But it's possible it will be needed.
  • A Dockerfile is added that spins up an ubuntu image with SSH setup so that it can be SSHed into from tests.
  • ssh_test_utils.py now contains all machinery to SSH into the docker image.

The rest of this PR is pretty much refactoring. base_transfer.py, test_ssh_file_transfer.py, test_ssh_setup.py just contains the already-existing tests. The new additions is testing the SSH through images not through a configuration where paths etc. were entered into the conftest.py. However, any feedback on these tests is of course welcome.

@JoeZiminski JoeZiminski marked this pull request as draft October 10, 2023 10:16
@JoeZiminski JoeZiminski force-pushed the test_ssh_with_image branch 2 times, most recently from 7f9781b to 7d6add8 Compare October 24, 2023 12:15
@JoeZiminski JoeZiminski force-pushed the test_ssh_with_image branch 2 times, most recently from 8d0f0a3 to 9442694 Compare November 10, 2023 09:18
@JoeZiminski JoeZiminski force-pushed the test_ssh_with_image branch 3 times, most recently from 611e63e to 3bae225 Compare April 19, 2024 16:43
@JoeZiminski JoeZiminski marked this pull request as ready for review April 29, 2024 20:05
Copy link
Member

@niksirbi niksirbi left a comment

Choose a reason for hiding this comment

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

My intermediate report on this:

  • The ssh tests failed when locally running on MacOS (M2), with docker running
  • The contributing guide should be updated to let contributors know how to handle local ssh tests (either skip them or configure their local machines accordingly).

sudo service mysql stop # free up port 3306 for ssh tests: https://github.com/orgs/community/discussions/25550
pytest
else
pytest -k "not test_combinations_ssh_transfer and not test_ssh_setup"
Copy link
Member

Choose a reason for hiding this comment

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

does this mean that on other OSes pytest will run all tests except the ones specified here? That's what we'd want/expect right?

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.

2 participants