Skip to content

Commit

Permalink
Add all OS back.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeZiminski committed Apr 19, 2024
1 parent c901052 commit 689db1d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/code_test_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest] # TODO: add these back in after tests... windows-latest, macos-latest, macos-14,
os: [windows-latest, macos-latest, macos-14, ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
Expand All @@ -46,7 +46,10 @@ jobs:
python -m pip install --upgrade pip
pip install .[dev]
- name: Shutdown Ubuntu MySQL (SUDO) # free up port 3306 for ssh tests: https://github.com/orgs/community/discussions/25550
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo service mysql stop
fi
- name: Test
run: pytest -k test_combinations_ssh_transfer

Expand Down
15 changes: 10 additions & 5 deletions tests/ssh_test_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import builtins
import copy
import os
import platform
import stat
import subprocess
import sys
Expand Down Expand Up @@ -100,22 +101,26 @@ def setup_project_and_container_for_ssh(project):
image_path = Path(__file__).parent / "ssh_test_images"
os.chdir(image_path)

add_sudo = "sudo" if platform.system() == "Linux" else ""

build_output = subprocess.run(
"sudo docker build -t ssh_server .", shell=True, capture_output=True
f"{add_sudo} docker build -t ssh_server .",
shell=True,
capture_output=True,
)
assert (
build_output.returncode == 0
), f"sudo docker build failed with: STDOUT-{build_output.stdout} STDERR-{build_output.stderr}"
), f"docker build failed with: STDOUT-{build_output.stdout} STDERR-{build_output.stderr}"

run_output = subprocess.run(
f"sudo docker run -d -p {PORT}:22 ssh_server",
f"{add_sudo} docker run -d -p {PORT}:22 ssh_server",
shell=True,
capture_output=True,
) # ; docker build -t ssh_server .", shell=True) # ;docker run -p 22:22 ssh_server
)

assert (
run_output.returncode == 0
), f"sudo docker run failed with: STDOUT-{run_output.stdout} STDERR-{run_output.stderr}"
), f"docker run failed with: STDOUT-{run_output.stdout} STDERR-{run_output.stderr}"

setup_project_for_ssh(
project,
Expand Down

0 comments on commit 689db1d

Please sign in to comment.