Skip to content

Commit

Permalink
Update action
Browse files Browse the repository at this point in the history
  • Loading branch information
matbun committed Apr 29, 2024
1 parent ea0c9b2 commit 70252ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/test-torch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
# You can use it as needed
cd ${{ github.workspace }} &&
# Run your commands here
ls -la &&
ls -la . &&
ls -la ${{ github.workspace }} &&
ls -la ${{ github.workspace }}/.. &&
pwd &&
echo ${{ github.workspace }}
7 changes: 5 additions & 2 deletions tests/use-cases/test_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def mnist_torch_inference_files(
root (str, optional): where to create the files.
Defaults to '.'.
"""
sys.path.append(os.getcwd())
from dataloader import InferenceMNIST
sample = os.path.join(root, samples_path)
InferenceMNIST.generate_jpg_sample(sample, 10)
Expand All @@ -39,6 +40,8 @@ def mnist_torch_inference_files(
mdl_ckpt = os.path.join(root, model_name)
torch.save(dummy_nn, mdl_ckpt)

sys.path.pop()


@pytest.mark.skip(reason="structure changed")
def test_structure_mnist_torch(check_folder_structure):
Expand Down Expand Up @@ -89,7 +92,7 @@ def test_mnist_inference_torch(torch_env, install_requirements):
root_path = os.getcwd()
os.chdir(TORCH_PATH)
# sys.path.append(os.path.join(os.getcwd(), TORCH_PATH))
sys.path.append(os.getcwd())
# sys.path.append(os.getcwd())
try:
mnist_torch_inference_files(
samples_path=samples_path,
Expand All @@ -107,7 +110,7 @@ def test_mnist_inference_torch(torch_env, install_requirements):
raise e
finally:
os.chdir(root_path)
sys.path.pop(sys.path.index(os.getcwd()))
# sys.path.pop(sys.path.index(os.getcwd()))
cmd = (f"{torch_env}/bin/itwinai exec-pipeline "
f"--config config.yaml --pipe-key inference_pipeline")
subprocess.run(cmd.split(), check=True, cwd=TORCH_PATH)
Expand Down

0 comments on commit 70252ed

Please sign in to comment.