mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-28 10:22:32 +00:00
test: fix portable stderr capture and env leakage (#55184)
This commit is contained in:
@@ -104,12 +104,18 @@ last_commit_error=''
|
||||
run_git_command() {
|
||||
local stderr_log
|
||||
stderr_log=$(mktemp)
|
||||
if "$@" 2> >(tee "$stderr_log" >&2); then
|
||||
if "$@" 2>"$stderr_log"; then
|
||||
if [ -s "$stderr_log" ]; then
|
||||
cat "$stderr_log" >&2
|
||||
fi
|
||||
rm -f "$stderr_log"
|
||||
last_commit_error=''
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -s "$stderr_log" ]; then
|
||||
cat "$stderr_log" >&2
|
||||
fi
|
||||
last_commit_error=$(cat "$stderr_log")
|
||||
rm -f "$stderr_log"
|
||||
return 1
|
||||
|
||||
@@ -18,6 +18,10 @@ const clearPlannerShardEnv = (env) => {
|
||||
const nextEnv = { ...env };
|
||||
delete nextEnv.OPENCLAW_TEST_SHARDS;
|
||||
delete nextEnv.OPENCLAW_TEST_SHARD_INDEX;
|
||||
delete nextEnv.OPENCLAW_TEST_FORCE_THREADS;
|
||||
delete nextEnv.OPENCLAW_TEST_FORCE_FORKS;
|
||||
delete nextEnv.OPENCLAW_TEST_DISABLE_THREAD_EXPANSION;
|
||||
delete nextEnv.OPENCLAW_TEST_SHOW_POOL_DECISION;
|
||||
return nextEnv;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user