Skip to content

Commit 7bcff52

Browse files
committed
Expand CI coverage and parallelize heavy tests
1 parent 4d624a0 commit 7bcff52

2 files changed

Lines changed: 85 additions & 4 deletions

File tree

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- id: set
3333
run: |
3434
SMOKE='[{"group":"core","files":"tests/e2e/scenarios/test_connection.py tests/e2e/scenarios/test_chat.py tests/e2e/scenarios/test_sse_reconnect.py tests/e2e/scenarios/test_html_injection.py tests/e2e/scenarios/test_csp.py"}]'
35-
FULL='[{"group":"core","files":"tests/e2e/scenarios/test_connection.py tests/e2e/scenarios/test_chat.py tests/e2e/scenarios/test_sse_reconnect.py tests/e2e/scenarios/test_html_injection.py tests/e2e/scenarios/test_csp.py"},{"group":"features","files":"tests/e2e/scenarios/test_skills.py tests/e2e/scenarios/test_tool_approval.py tests/e2e/scenarios/test_webhook.py"},{"group":"extensions","files":"tests/e2e/scenarios/test_extensions.py tests/e2e/scenarios/test_extension_oauth.py tests/e2e/scenarios/test_oauth_url_parameters.py tests/e2e/scenarios/test_telegram_token_validation.py tests/e2e/scenarios/test_telegram_hot_activation.py tests/e2e/scenarios/test_wasm_lifecycle.py tests/e2e/scenarios/test_tool_execution.py tests/e2e/scenarios/test_agent_loop_recovery.py tests/e2e/scenarios/test_pairing.py tests/e2e/scenarios/test_mcp_auth_flow.py tests/e2e/scenarios/test_oauth_credential_fallback.py tests/e2e/scenarios/test_routine_oauth_credential_injection.py"},{"group":"routines","files":"tests/e2e/scenarios/test_owner_scope.py tests/e2e/scenarios/test_routine_event_batch.py"}]'
35+
FULL='[{"group":"core","files":"tests/e2e/scenarios/test_connection.py tests/e2e/scenarios/test_chat.py tests/e2e/scenarios/test_sse_reconnect.py tests/e2e/scenarios/test_html_injection.py tests/e2e/scenarios/test_csp.py"},{"group":"features","files":"tests/e2e/scenarios/test_skills.py tests/e2e/scenarios/test_tool_approval.py tests/e2e/scenarios/test_webhook.py"},{"group":"extensions","files":"tests/e2e/scenarios/test_extensions.py tests/e2e/scenarios/test_extension_oauth.py tests/e2e/scenarios/test_oauth_url_parameters.py tests/e2e/scenarios/test_telegram_token_validation.py tests/e2e/scenarios/test_telegram_hot_activation.py tests/e2e/scenarios/test_wasm_lifecycle.py tests/e2e/scenarios/test_tool_execution.py tests/e2e/scenarios/test_agent_loop_recovery.py tests/e2e/scenarios/test_pairing.py tests/e2e/scenarios/test_mcp_auth_flow.py tests/e2e/scenarios/test_oauth_credential_fallback.py tests/e2e/scenarios/test_routine_oauth_credential_injection.py"},{"group":"routines","files":"tests/e2e/scenarios/test_owner_scope.py tests/e2e/scenarios/test_routine_event_batch.py"},{"group":"web-regressions","files":"tests/e2e/scenarios/test_auth_no_duplicate_response.py tests/e2e/scenarios/test_message_persistence.py tests/e2e/scenarios/test_pending_user_messages.py"},{"group":"v2-engine","files":"tests/e2e/scenarios/test_v2_engine_auth_flow.py tests/e2e/scenarios/test_v2_engine_approval_flow.py tests/e2e/scenarios/test_v2_engine_tool_lifecycle.py tests/e2e/scenarios/test_v2_kernel_auth_preflight.py tests/e2e/scenarios/test_v2_kernel_auth_gateway_flow.py tests/e2e/scenarios/test_v2_thread_visibility.py"}]'
3636
3737
if [ "${{ inputs.mode || 'full' }}" = "smoke" ]; then
3838
echo "matrix=${SMOKE}" >> "$GITHUB_OUTPUT"

.github/workflows/test.yml

Lines changed: 84 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
has_web_risk: ${{ steps.non_diff.outputs.has_web_risk || steps.diff.outputs.has_web_risk }}
3939
has_wasm_abi_risk: ${{ steps.non_diff.outputs.has_wasm_abi_risk || steps.diff.outputs.has_wasm_abi_risk }}
4040
has_telegram_risk: ${{ steps.non_diff.outputs.has_telegram_risk || steps.diff.outputs.has_telegram_risk }}
41+
has_slack_risk: ${{ steps.non_diff.outputs.has_slack_risk || steps.diff.outputs.has_slack_risk }}
4142
has_platform_build_risk: ${{ steps.non_diff.outputs.has_platform_build_risk || steps.diff.outputs.has_platform_build_risk }}
4243
steps:
4344
- id: non_diff
@@ -56,6 +57,7 @@ jobs:
5657
echo "has_web_risk=false" >> "$GITHUB_OUTPUT"
5758
echo "has_wasm_abi_risk=true" >> "$GITHUB_OUTPUT"
5859
echo "has_telegram_risk=true" >> "$GITHUB_OUTPUT"
60+
echo "has_slack_risk=true" >> "$GITHUB_OUTPUT"
5961
echo "has_platform_build_risk=true" >> "$GITHUB_OUTPUT"
6062
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
6163
if: github.event_name == 'pull_request' || github.event_name == 'merge_group'
@@ -122,6 +124,12 @@ jobs:
122124
echo "has_telegram_risk=false" >> "$GITHUB_OUTPUT"
123125
fi
124126
127+
if has_match '^(channels-src/slack/|tests/slack_auth_integration\.rs$|\.github/workflows/test\.yml$)'; then
128+
echo "has_slack_risk=true" >> "$GITHUB_OUTPUT"
129+
else
130+
echo "has_slack_risk=false" >> "$GITHUB_OUTPUT"
131+
fi
132+
125133
if has_match '^(Dockerfile$|Dockerfile\.worker$|crates/Dockerfile\.sandbox$|infra/runner/|wix/|scripts/build-all\.sh$|scripts/test-ci-artifact-naming\.sh$|\.github/workflows/docker\.yml$|\.github/workflows/release\.yml$|\.github/workflows/release-plz\.yml$|\.github/workflows/rebuild-release-image\.yml$|build\.rs$|\.github/workflows/test\.yml$)'; then
126134
echo "has_platform_build_risk=true" >> "$GITHUB_OUTPUT"
127135
else
@@ -207,10 +215,49 @@ jobs:
207215
run: |
208216
timeout --signal=INT --kill-after=30s 15m \
209217
cargo test --no-default-features --features libsql,integration --test e2e_thread_scheduling -- --nocapture
210-
- name: Run Telegram thread-scope regression test
218+
219+
telegram-integration-tests:
220+
name: Telegram Integration Tests (${{ matrix.partition }})
221+
needs: changes
222+
if: github.event_name != 'pull_request' || needs.changes.outputs.has_runtime_heavy_risk == 'true'
223+
runs-on: ubuntu-latest
224+
timeout-minutes: 20
225+
strategy:
226+
fail-fast: false
227+
matrix:
228+
partition:
229+
- 1/2
230+
- 2/2
231+
steps:
232+
- name: Checkout repository
233+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
234+
with:
235+
ref: ${{ inputs.ref || github.sha }}
236+
persist-credentials: false
237+
- name: Install Rust
238+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
239+
with:
240+
targets: wasm32-wasip2
241+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
242+
with:
243+
key: telegram-integration-${{ matrix.partition }}
244+
save-if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging') }}
245+
- name: Build Telegram WASM channel
246+
run: cargo build --manifest-path channels-src/telegram/Cargo.toml --target wasm32-wasip2 --release
247+
- name: Install cargo-nextest
248+
uses: taiki-e/install-action@62b0f2dec647a8e604c6a0fda0e38530180dce20 # v2
249+
with:
250+
tool: cargo-nextest
251+
- name: Run Telegram integration tests
252+
env:
253+
NEXTEST_PROFILE: ci
211254
run: |
212-
timeout --signal=INT --kill-after=30s 10m \
213-
cargo test --features integration --test telegram_auth_integration test_private_messages_use_chat_id_as_thread_scope -- --exact
255+
timeout --signal=INT --kill-after=30s 15m \
256+
cargo nextest run \
257+
--profile ci \
258+
--features integration \
259+
--test telegram_auth_integration \
260+
--partition hash:${{ matrix.partition }}
214261
215262
replay-required:
216263
name: Replay Required
@@ -260,6 +307,33 @@ jobs:
260307
timeout --signal=INT --kill-after=30s 10m \
261308
cargo test --manifest-path channels-src/telegram/Cargo.toml -- --nocapture
262309
310+
slack-tests:
311+
name: Slack Channel Tests
312+
needs: changes
313+
if: github.event_name != 'pull_request' || needs.changes.outputs.has_slack_risk == 'true'
314+
runs-on: ubuntu-latest
315+
timeout-minutes: 20
316+
steps:
317+
- name: Checkout repository
318+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
319+
with:
320+
ref: ${{ inputs.ref || github.sha }}
321+
persist-credentials: false
322+
- name: Install Rust
323+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
324+
with:
325+
targets: wasm32-wasip2
326+
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
327+
with:
328+
key: slack-integration
329+
save-if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/staging') }}
330+
- name: Build Slack WASM channel
331+
run: cargo build --manifest-path channels-src/slack/Cargo.toml --target wasm32-wasip2 --release
332+
- name: Run Slack integration tests
333+
run: |
334+
timeout --signal=INT --kill-after=30s 15m \
335+
cargo test --features integration --test slack_auth_integration -- --nocapture
336+
263337
windows-build:
264338
name: Windows Build (${{ matrix.name }})
265339
needs: [changes, matrix-config]
@@ -433,10 +507,12 @@ jobs:
433507
- matrix-config
434508
- tests
435509
- heavy-integration-tests
510+
- telegram-integration-tests
436511
- replay-required
437512
- web-e2e-smoke
438513
- web-e2e-full
439514
- telegram-tests
515+
- slack-tests
440516
- wasm-wit-compat
441517
- docker-build
442518
- windows-build
@@ -466,6 +542,7 @@ jobs:
466542
467543
if [[ "$event" != "pull_request" || "${{ needs.changes.outputs.has_runtime_heavy_risk }}" == "true" ]]; then
468544
require_success "heavy-integration-tests" "${{ needs.heavy-integration-tests.result }}"
545+
require_success "telegram-integration-tests" "${{ needs.telegram-integration-tests.result }}"
469546
fi
470547
471548
if [[ "$event" != "push" && ( "$event" == "workflow_call" || "${{ needs.changes.outputs.has_engine_replay_risk }}" == "true" ) ]]; then
@@ -484,6 +561,10 @@ jobs:
484561
require_success "telegram-tests" "${{ needs.telegram-tests.result }}"
485562
fi
486563
564+
if [[ "$event" != "pull_request" || "${{ needs.changes.outputs.has_slack_risk }}" == "true" ]]; then
565+
require_success "slack-tests" "${{ needs.slack-tests.result }}"
566+
fi
567+
487568
if [[ "$event" != "pull_request" || ( "${{ github.base_ref }}" != "main" && "${{ needs.changes.outputs.has_wasm_abi_risk }}" == "true" ) ]]; then
488569
require_success "wasm-wit-compat" "${{ needs.wasm-wit-compat.result }}"
489570
fi

0 commit comments

Comments
 (0)