@@ -39,6 +39,9 @@ class Environ(Enum):
3939 ONPREM = 'onprem'
4040 CUSTOM = 'custom'
4141 STAGING_EU = 'staging-eu'
42+ EPHEMERAL = 'ephemeral' # Used for testing PRs with ephemeral environments
43+
44+ EPHEMERAL_BASE_URL = "http://lb-api-public"
4245
4346
4447@pytest .fixture (scope = "session" )
@@ -74,6 +77,8 @@ def graphql_url(environ: str) -> str:
7477 if graphql_api_endpoint is None :
7578 raise Exception (f"Missing LABELBOX_TEST_GRAPHQL_API_ENDPOINT" )
7679 return graphql_api_endpoint
80+ elif environ == Environ .EPHEMERAL :
81+ return f"{ Environ .EPHEMERAL_BASE_URL } /graphql"
7782 return 'http://host.docker.internal:8080/graphql'
7883
7984
@@ -89,6 +94,8 @@ def rest_url(environ: str) -> str:
8994 if rest_api_endpoint is None :
9095 raise Exception (f"Missing LABELBOX_TEST_REST_API_ENDPOINT" )
9196 return rest_api_endpoint
97+ elif environ == Environ .EPHEMERAL :
98+ return f"{ Environ .EPHEMERAL_BASE_URL } /api/v1"
9299 return 'http://host.docker.internal:8080/api/v1'
93100
94101
@@ -103,6 +110,8 @@ def testing_api_key(environ: str) -> str:
103110 return os .environ ["LABELBOX_TEST_API_KEY_ONPREM" ]
104111 elif environ == Environ .CUSTOM :
105112 return os .environ ["LABELBOX_TEST_API_KEY_CUSTOM" ]
113+ elif environ == Environ .EPHEMERAL :
114+ return os .environ ["LABELBOX_TEST_API_KEY_EPHEMERAL" ]
106115 return os .environ ["LABELBOX_TEST_API_KEY_LOCAL" ]
107116
108117
0 commit comments