8000 update test · niralkk/python-docs-samples@89478ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 89478ee

Browse files
committed
update test
1 parent 7eae753 commit 89478ee

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

vision/automl/edge_container_predict/automl_vision_edge_container_predict_test.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,12 @@
3737

3838
# The absolute path of the current file. This will locate the model_path when
3939
# run docker containers.
40-
ROOT_DIR = os.path.abspath(os.path.dirname(__file__))
40+
ROOT_DIR = os.environ.get('KOKORO_ROOT', os.path.abspath(os.path.dirname(__file__)))
4141
MODEL_PATH = os.path.join(ROOT_DIR, 'model_path')
4242
# The cpu docker gcs path is from 'Edge container tutorial'.
43-
DOCKER_GCS_DIR = 'gcr.io/automl-vision-ondevice/'
44-
CPU_DOCKER_GCS_PATH = DOCKER_GCS_DIR + 'gcloud-container-1.12.0:latest'
43+
CPU_DOCKER_GCS_PATH = 'gcr.io/automl-vision-ondevice/gcloud-container-1.12.0:latest'
4544
# The path of a sample saved model.
46-
MODEL_GCS_DIR = 'gs://cloud-samples-data/vision/edge_container_predict/'
47-
SAMPLE_SAVED_MODEL = MODEL_GCS_DIR + 'saved_model.pb'
45+
SAMPLE_SAVED_MODEL = 'gs://cloud-samples-data/vision/edge_container_predict/saved_model.pb'
4846
# Container Name.
4947
NAME = 'AutomlVisionEdgeContainerPredictTest'
5048
# Port Number.
@@ -56,8 +54,8 @@ def edge_container_predict_server_port():
5654
# set up
5755
# Pull the CPU docker.
5856
subprocess.check_output(['docker', 'pull', CPU_DOCKER_GCS_PATH])
59-
# Get the sample saved model.
6057

58+
# Get the sample saved model.
6159
if not os.path.exists(MODEL_PATH):
6260
os.mkdir(MODEL_PATH)
6361
subprocess.check_output(
@@ -79,8 +77,7 @@ def edge_container_predict_server_port():
7977
# Remove the docker image.
8078
subprocess.check_output(['docker', 'rmi', CPU_DOCKER_GCS_PATH])
8179

82-
# TODO(dizcology): Enable tests in future.
83-
@pytest.mark.skip(reason='skipping to avoid running docker in docker')
80+
8481
def test_edge_container_predict(capsys, edge_container_predict_server_port):
8582
image_file_path = 'test.jpg'
8683
# If you send requests with one image each time, the key value does not

0 commit comments

Comments
 (0)
0