Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/apify/_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ class ActorEnvVars(StrEnum):
STANDBY_PORT = 'ACTOR_STANDBY_PORT'
STANDBY_URL = 'ACTOR_STANDBY_URL'
STARTED_AT = 'ACTOR_STARTED_AT'
STORAGES_JSON = 'ACTOR_STORAGES_JSON'
TASK_ID = 'ACTOR_TASK_ID'
TEST_PAY_PER_EVENT = 'ACTOR_TEST_PAY_PER_EVENT'
TIMEOUT_AT = 'ACTOR_TIMEOUT_AT'
WEB_SERVER_PORT = 'ACTOR_WEB_SERVER_PORT'
WEB_SERVER_URL = 'ACTOR_WEB_SERVER_URL'
Expand All @@ -58,8 +60,10 @@ class ActorEnvVars(StrEnum):
class ApifyEnvVars(StrEnum):
"""Environment variables with APIFY_ prefix set by the Apify platform."""

ACTOR_PRICING_INFO = 'APIFY_ACTOR_PRICING_INFO'
API_BASE_URL = 'APIFY_API_BASE_URL'
API_PUBLIC_BASE_URL = 'APIFY_API_PUBLIC_BASE_URL'
CHARGED_ACTOR_EVENT_COUNTS = 'APIFY_CHARGED_ACTOR_EVENT_COUNTS'
DEDICATED_CPUS = 'APIFY_DEDICATED_CPUS'
DEFAULT_BROWSER_PATH = 'APIFY_DEFAULT_BROWSER_PATH'
DISABLE_BROWSER_SANDBOX = 'APIFY_DISABLE_BROWSER_SANDBOX'
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/actor/test_actor_env_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ async def test_get_env_with_randomized_env_vars(monkeypatch: pytest.MonkeyPatch,
# Its value is set by the _isolate_test_environment fixture to tmp_path.
expected_get_env[ApifyEnvVars.LOCAL_STORAGE_DIR.name.lower()] = str(tmp_path)

# These env vars are not randomized above, so they fall back to their Configuration defaults.
expected_get_env[ActorEnvVars.STORAGES_JSON.name.lower()] = None
expected_get_env[ActorEnvVars.TEST_PAY_PER_EVENT.name.lower()] = False
expected_get_env[ApifyEnvVars.ACTOR_PRICING_INFO.name.lower()] = None
expected_get_env[ApifyEnvVars.CHARGED_ACTOR_EVENT_COUNTS.name.lower()] = None

await Actor.init()
assert Actor.get_env() == expected_get_env

Expand Down