惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
爱范儿
爱范儿
罗磊的独立博客
V
V2EX
量子位
Last Week in AI
Last Week in AI
Hugging Face - Blog
Hugging Face - Blog
博客园 - 司徒正美
Jina AI
Jina AI
博客园 - 叶小钗
小众软件
小众软件
博客园 - 【当耐特】
Y
Y Combinator Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
博客园 - 聂微东
Microsoft Security Blog
Microsoft Security Blog
美团技术团队
P
Proofpoint News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
有赞技术团队
有赞技术团队
MongoDB | Blog
MongoDB | Blog
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
test: share release journey env wrapper · openclaw/opencl...
shakkernerd · 2026-06-21 · via Recent Commits to openclaw:main

@@ -6,6 +6,7 @@ import { tmpdir } from "node:os";

66

import path from "node:path";

77

import { describe, expect, it } from "vitest";

88

import { runReleaseUserJourneyAssertion } from "../../scripts/e2e/lib/release-user-journey/assertions.mjs";

9+

import { withEnvAsync } from "../../src/test-utils/env.js";

9101011

const ASSERTIONS_SCRIPT = "scripts/e2e/lib/release-user-journey/assertions.mjs";

1112

const DISABLE_EXPERIMENTAL_WARNING = "--disable-warning=ExperimentalWarning";

@@ -40,25 +41,6 @@ function runAssertion(

4041

});

4142

}

424343-

async function withEnv<T>(env: Record<string, string>, callback: () => Promise<T>): Promise<T> {

44-

const previous = new Map<string, string | undefined>();

45-

for (const [key, value] of Object.entries(env)) {

46-

previous.set(key, process.env[key]);

47-

process.env[key] = value;

48-

}

49-

try {

50-

return await callback();

51-

} finally {

52-

for (const [key, value] of previous) {

53-

if (value === undefined) {

54-

delete process.env[key];

55-

} else {

56-

process.env[key] = value;

57-

}

58-

}

59-

}

60-

}

61-6244

async function waitUntil(matches: () => boolean, label: string): Promise<void> {

6345

const startedAt = Date.now();

6446

while (Date.now() - startedAt < 1000) {

@@ -301,7 +283,7 @@ describe("release user journey assertions", () => {

301283302284

try {

303285

await expect(

304-

withEnv({ HOME: home, OPENCLAW_RELEASE_USER_JOURNEY_HTTP_TIMEOUT_MS: "1000" }, () =>

286+

withEnvAsync({ HOME: home, OPENCLAW_RELEASE_USER_JOURNEY_HTTP_TIMEOUT_MS: "1000" }, () =>

305287

runReleaseUserJourneyAssertion("wait-clickclack-socket", [

306288

`http://127.0.0.1:${server.port}`,

307289

"1",

@@ -327,7 +309,7 @@ describe("release user journey assertions", () => {

327309328310

try {

329311

await expect(

330-

withEnv({ HOME: home, OPENCLAW_RELEASE_USER_JOURNEY_HTTP_TIMEOUT_MS: "1000" }, () =>

312+

withEnvAsync({ HOME: home, OPENCLAW_RELEASE_USER_JOURNEY_HTTP_TIMEOUT_MS: "1000" }, () =>

331313

runReleaseUserJourneyAssertion("post-clickclack-inbound", [

332314

`http://127.0.0.1:${server.port}`,

333315

"hello",

@@ -351,7 +333,7 @@ describe("release user journey assertions", () => {

351333

try {

352334

const startedAt = Date.now();

353335

await expect(

354-

withEnv({ HOME: home, OPENCLAW_RELEASE_USER_JOURNEY_HTTP_TIMEOUT_MS: "100" }, () =>

336+

withEnvAsync({ HOME: home, OPENCLAW_RELEASE_USER_JOURNEY_HTTP_TIMEOUT_MS: "100" }, () =>

355337

runReleaseUserJourneyAssertion("wait-clickclack-socket", [

356338

`http://127.0.0.1:${server.port}`,

357339

"1",

@@ -374,7 +356,7 @@ describe("release user journey assertions", () => {

374356375357

try {

376358

await expect(

377-

withEnv({ HOME: home, OPENCLAW_RELEASE_USER_JOURNEY_HTTP_TIMEOUT_MS: "100ms" }, () =>

359+

withEnvAsync({ HOME: home, OPENCLAW_RELEASE_USER_JOURNEY_HTTP_TIMEOUT_MS: "100ms" }, () =>

378360

runReleaseUserJourneyAssertion("wait-clickclack-socket", [

379361

`http://127.0.0.1:${server.port}`,

380362

"1",

@@ -396,14 +378,14 @@ describe("release user journey assertions", () => {

396378397379

try {

398380

await expect(

399-

withEnv({ HOME: home }, () =>

381+

withEnvAsync({ HOME: home }, () =>

400382

runReleaseUserJourneyAssertion("wait-clickclack-socket", ["http://127.0.0.1:9", "1e3"]),

401383

),

402384

).rejects.toThrow(

403385

'ClickClack websocket timeout seconds must be a positive integer. Got: "1e3"',

404386

);

405387

await expect(

406-

withEnv({ HOME: home }, () =>

388+

withEnvAsync({ HOME: home }, () =>

407389

runReleaseUserJourneyAssertion("wait-clickclack-reply", [

408390

statePath,

409391

"OPENCLAW_E2E_OK",

@@ -428,7 +410,7 @@ describe("release user journey assertions", () => {

428410429411

try {

430412

await expect(

431-

withEnv(

413+

withEnvAsync(

432414

{

433415

HOME: home,

434416

OPENCLAW_RELEASE_USER_JOURNEY_HTTP_BODY_MAX_BYTES: "16",

@@ -456,7 +438,7 @@ describe("release user journey assertions", () => {

456438457439

try {

458440

await expect(

459-

withEnv(

441+

withEnvAsync(

460442

{

461443

HOME: home,

462444

OPENCLAW_RELEASE_USER_JOURNEY_HTTP_TIMEOUT_MS: "25",

@@ -486,7 +468,7 @@ describe("release user journey assertions", () => {

486468487469

try {

488470

await expect(

489-

withEnv(

471+

withEnvAsync(

490472

{

491473

HOME: home,

492474

OPENCLAW_RELEASE_USER_JOURNEY_HTTP_BODY_MAX_BYTES: "16bytes",