Skip to content

Commit 1d2d69d

Browse files
committed
Tmp print user id, to see which test user is being used in CI
1 parent 1bce291 commit 1d2d69d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ We have integration tests which build and run Actors using the Python SDK on the
7878
you need to set the `APIFY_TEST_USER_API_TOKEN` environment variable to the API token of the Apify user you want to
7979
use for the tests, and then start them with `make integration-tests`.
8080

81+
For subset of integration tests another token is needed `APIFY_TEST_USER_2_API_TOKEN`. Such tests are testing
82+
the storage restricted access and thus need two user accounts.
83+
8184
If you want to run the integration tests on a different environment than the main Apify Platform, you need to set
8285
the `APIFY_INTEGRATION_TESTS_API_URL` environment variable to the right URL to the Apify API you want to use.
8386

tests/integration/conftest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from apify_client import ApifyClient, ApifyClientAsync
1111

1212
TOKEN_ENV_VAR = 'APIFY_TEST_USER_API_TOKEN'
13+
TOKEN_ENV_VAR_2 = 'APIFY_TEST_USER_2_API_TOKEN'
1314
API_URL_ENV_VAR = 'APIFY_INTEGRATION_TESTS_API_URL'
1415

1516

@@ -30,15 +31,16 @@ def api_token() -> str:
3031
@pytest.fixture(scope='session')
3132
def api_token_2() -> str:
3233
"""API token for the second test user for storage permission tests."""
33-
second_user_env_var = 'APIFY_TEST_USER_PYTHON_SDK_API_TOKEN'
34-
token = os.getenv(second_user_env_var)
34+
token = os.getenv(TOKEN_ENV_VAR_2)
3535
if not token:
36-
raise RuntimeError(f'{second_user_env_var} environment variable is missing, cannot run permission tests!')
36+
raise RuntimeError(f'{TOKEN_ENV_VAR_2} environment variable is missing, cannot run permission tests!')
3737
return token
3838

3939

4040
@pytest.fixture
4141
def apify_client(api_token: str) -> ApifyClient:
42+
client = ApifyClient(api_token, api_url=os.getenv(API_URL_ENV_VAR))
43+
raise Exception(client.user().get()["id"])
4244
return ApifyClient(api_token, api_url=os.getenv(API_URL_ENV_VAR))
4345

4446

0 commit comments

Comments
 (0)