Skip to content

Commit 7c9ddf1

Browse files
committed
updates to test cases for onprem
1 parent 526fb82 commit 7c9ddf1

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,9 @@ test-prod: build
2020
-e LABELBOX_TEST_ENVIRON="prod" \
2121
-e LABELBOX_TEST_API_KEY_PROD=${LABELBOX_TEST_API_KEY_PROD} \
2222
local/labelbox-python:test pytest $(PATH_TO_TEST) -svvx
23+
24+
test-onprem: build
25+
docker run -it -v ${PWD}:/usr/src -w /usr/src \
26+
-e LABELBOX_TEST_ENVIRON="onprem" \
27+
-e LABELBOX_TEST_API_KEY_ONPREM=${LABELBOX_TEST_API_KEY_ONPREM} \
28+
local/labelbox-python:test pytest $(PATH_TO_TEST) -svvx

tests/integration/annotation_import/test_label_import.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def test_create_from_objects(client, project, object_predictions,
2828
project_id=project.uid,
2929
name=name,
3030
labels=object_predictions)
31+
label_import.wait_until_done()
3132
assert label_import.parent_id == project.uid
3233
annotation_import_test_helpers.check_running_state(label_import, name)
3334
annotation_import_test_helpers.assert_file_content(

tests/integration/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Environ(Enum):
2727
LOCAL = 'local'
2828
PROD = 'prod'
2929
STAGING = 'staging'
30+
ONPREM = 'onprem'
3031

3132

3233
@pytest.fixture(scope="session")
@@ -49,6 +50,9 @@ def graphql_url(environ: str) -> str:
4950
return 'https://api.labelbox.com/graphql'
5051
elif environ == Environ.STAGING:
5152
return 'https://staging-api.labelbox.com/graphql'
53+
elif environ == Environ.ONPREM:
54+
instance_id = "replicated-1c0e609"
55+
return f"https://app.{instance_id}.labelbox.dev/api/_gql"
5256
return 'http://host.docker.internal:8080/graphql'
5357

5458

@@ -57,6 +61,8 @@ def testing_api_key(environ: str) -> str:
5761
return os.environ["LABELBOX_TEST_API_KEY_PROD"]
5862
elif environ == Environ.STAGING:
5963
return os.environ["LABELBOX_TEST_API_KEY_STAGING"]
64+
elif environ == Environ.ONPREM:
65+
return os.environ["LABELBOX_TEST_API_KEY_ONPREM"]
6066
return os.environ["LABELBOX_TEST_API_KEY_LOCAL"]
6167

6268

tests/integration/test_label.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import pytest
44
import requests
5+
import os
56

67
from labelbox import Label
78

@@ -35,6 +36,8 @@ def test_label_export(configured_project_with_label):
3536
# The new exporter doesn't work with the create_label mutation
3637

3738

39+
@pytest.mark.skipif(condition=os.environ['LABELBOX_TEST_ENVIRON'] == "onprem",
40+
reason="does not work for onprem")
3841
def test_label_update(configured_project_with_label):
3942
_, _, _, label = configured_project_with_label
4043
label.update(label="something else")

0 commit comments

Comments
 (0)