Ejemplo n.º 1
0
async def test_monitor_raise_if_no_env_is_set():
    patch_settings()
    os.environ[POLYAXON_KEYS_RUN_INSTANCE] = "foo"
    with pytest.raises(PolyaxonContainerException):
        await start_sidecar(
            container_id="foo",
            sleep_interval=3,
            sync_interval=6,
            monitor_outputs=True,
            monitor_logs=False,
        )
    del os.environ[POLYAXON_KEYS_RUN_INSTANCE]
Ejemplo n.º 2
0
async def test_monitor_raise_if_no_pod_id():
    patch_settings()
    os.environ[POLYAXON_KEYS_RUN_INSTANCE] = "owner.project.runs.{}".format(
        uuid.uuid4().hex)
    with pytest.raises(PolyaxonContainerException):
        await start_sidecar(
            container_id="foo",
            sleep_interval=3,
            sync_interval=6,
            monitor_outputs=True,
            monitor_logs=False,
        )
    del os.environ[POLYAXON_KEYS_RUN_INSTANCE]