Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
misohu committed Mar 21, 2024
1 parent 6a93fb7 commit a80f809
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
10 changes: 4 additions & 6 deletions jupyter-pytorch-full/tests/test_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
# See LICENSE file for licensing details.
#
#
from pathlib import Path

import subprocess
import requests
import tenacity
import yaml

from charmed_kubeflow_chisme.rock import CheckRock

@tenacity.retry(
stop=tenacity.stop_after_attempt(5),
Expand All @@ -22,9 +20,9 @@ def check_notebook_server_up(url):

def main():
"""Test running container and imports."""
rock = yaml.safe_load(Path("rockcraft.yaml").read_text())
rock_image = rock["name"]
rock_version = rock["version"]
check_rock = CheckRock("rockcraft.yaml")
rock_image = check_rock.get_name()
rock_version = check_rock.get_version()
LOCAL_ROCK_IMAGE = f"{rock_image}:{rock_version}"

print(f"Running {LOCAL_ROCK_IMAGE}")
Expand Down
11 changes: 5 additions & 6 deletions jupyter-pytorch-full/tests/test_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
# See LICENSE file for licensing details.
#
#
from pathlib import Path

import os
import subprocess
import yaml

from charmed_kubeflow_chisme.rock import CheckRock


def main():
"""Test running container and imports."""
rock = yaml.safe_load(Path("rockcraft.yaml").read_text())
rock_image = rock["name"]
rock_version = rock["version"]
check_rock = CheckRock("rockcraft.yaml")
rock_image = check_rock.get_name()
rock_version = check_rock.get_version()
LOCAL_ROCK_IMAGE = f"{rock_image}:{rock_version}"

print(f"Running command in {LOCAL_ROCK_IMAGE}")
Expand Down
3 changes: 0 additions & 3 deletions jupyter-pytorch-full/tests/test_rock.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
# See LICENSE file for licensing details.
#
#
from pathlib import Path

import pytest
import subprocess
import yaml

from charmed_kubeflow_chisme.rock import CheckRock

Expand Down

0 comments on commit a80f809

Please sign in to comment.