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
1 change: 1 addition & 0 deletions .github/workflows/on_schedule_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
run: uv run poe e2e-templates-tests -m "${{ matrix.http-client }} and ${{ matrix.crawler-type }} and ${{ matrix.package-manager }}"
env:
APIFY_TEST_USER_API_TOKEN: ${{ secrets.APIFY_TEST_USER_API_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

# Send a Slack notification to #tooling-team-python when scheduled e2e tests fail.
# Skipped on workflow_dispatch (manual runs) so that ad-hoc triggers don't spam the channel.
Expand Down
15 changes: 7 additions & 8 deletions tests/e2e/project_template/test_static_crawlers_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,16 @@ async def test_static_crawler_actor_at_apify(
client = ApifyClientAsync(token=os.getenv('APIFY_TEST_USER_API_TOKEN'))
actor = client.actor(actor_id)

# The template ships a placeholder API key, so only validate the build and skip the run.
if crawler_type == 'stagehand':
try:
assert build_process.returncode == 0
finally:
await actor.delete()
return

# Run actor
try:
assert build_process.returncode == 0

# Stagehand needs the model API key in `os.environ` at run time; register it as a secret env var
# on the deployed actor version so the platform injects it into the run.
if crawler_type == 'stagehand':
env_vars = actor.version('0.0').env_vars()
await env_vars.create(name='OPENAI_API_KEY', value=os.environ['OPENAI_API_KEY'], is_secret=True)

started_run_data = await actor.start(memory_mbytes=8192)
actor_run = client.run(started_run_data['id'])

Expand Down
Loading