Repository navigation
fix(ci): restore test workflow execution - #1999
Conversation
📝 WalkthroughWalkthroughUpdates CI workflows and testing documentation, while aligning executor source and contract tests with current runtime, IPC, backend path, streaming, synchronization, and signal-handling behavior. ChangesCI testing and documentation
Executor contract tests
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
cc5ca83 to
8c0fec0
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@executor/tests/app_runtime_work_send_contract.rs`:
- Line 8: Update the test lock initialization and acquisition around StdMutex
and StdMutexGuard so a poisoned mutex is recovered instead of causing a later
.expect(...) failure. Preserve the lock’s serialization behavior by accepting
the guard from the poison error and returning a usable StdMutexGuard to callers.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 96a72981-bda0-43ad-a188-9159a4a419ed
📒 Files selected for processing (10)
.github/workflows/test.ymldocs/en/developer-guide/testing.mddocs/zh/developer-guide/testing.mdexecutor/src/bin/wegent-executor.rsexecutor/src/browser_mcp.rsexecutor/tests/app_runtime_work_contract.rsexecutor/tests/app_runtime_work_send_contract.rsexecutor/tests/build_entrypoint_contract.rsexecutor/tests/local_app_ipc_contract.rsexecutor/tests/local_backend_contract.rs
| fs, | ||
| path::{Path, PathBuf}, | ||
| sync::OnceLock, | ||
| sync::{Mutex as StdMutex, MutexGuard as StdMutexGuard, OnceLock}, |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Map the test file and inspect the relevant section with line numbers.
ast-grep outline executor/tests/app_runtime_work_send_contract.rs --view expanded || true
echo '--- file excerpt ---'
sed -n '1,120p' executor/tests/app_runtime_work_send_contract.rs | cat -n
echo '--- search for env_lock usage ---'
rg -n "env_lock\(|StdMutex|OnceLock" executor/tests/app_runtime_work_send_contract.rs executor/tests -g '!**/target/**' || trueRepository: wecode-ai/Wegent
Length of output: 32066
Recover from a poisoned test lock.
A panic while this guard is held poisons the mutex, so later tests fail at .expect(...) even though the lock is only for serialization.
Proposed fix
_guard: LOCK
.get_or_init(|| StdMutex::new(()))
.lock()
- .expect("environment lock should be available"),
+ .unwrap_or_else(|poisoned| poisoned.into_inner()),🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@executor/tests/app_runtime_work_send_contract.rs` at line 8, Update the test
lock initialization and acquisition around StdMutex and StdMutexGuard so a
poisoned mutex is recovered instead of causing a later .expect(...) failure.
Preserve the lock’s serialization behavior by accepting the guard from the
poison error and returning a usable StdMutexGuard to callers.
What changed
CARGO_TARGET_DIRthroughGITHUB_ENVusing the runner-providedRUNNER_TEMPenvironment variable.Why
The Tests workflow referenced
runner.tempfrom a job-levelenvblock, where therunnercontext is unavailable. GitHub rejected the entire workflow during parsing, so none of the unit-test jobs, including Test Wework, were created while the separate Wework E2E workflow continued to run.Impact
Pull requests and protected-branch pushes can run the normal Tests workflow again. Executor build artifacts remain on the runner temporary disk.
Validation
actionlint -ignore 'shellcheck reported issue' -ignore 'runner of .* action is too old' .github/workflows/test.ymlgit diff --check origin/main...HEADSummary by CodeRabbit
Bug Fixes
Documentation
Chores