Repository navigation
fix(ci): harden tmux triage reporting #5548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 3 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e7efb4b
fix(ci): harden tmux triage reporting
yiliang114 669a92e
fix(ci): address tmux triage review feedback
yiliang114 e01a1ed
fix(ci): tighten tmux triage review followups
yiliang114 0293810
fix(ci): address tmux triage review followups
yiliang114 f423fb4
fix(ci): simplify tmux triage hardening
yiliang114 7fb69d6
fix(ci): sanitize tmux triage verdict output
yiliang114 d8f4d7c
fix(ci): harden tmux result rendering
yiliang114 b7fa622
ci: strip step summary from triage build
yiliang114 78f9085
Merge remote-tracking branch 'origin/main' into codex/pr-5548-review-…
yiliang114 a67aea4
fix(ci): report missing tmux artifacts
yiliang114 7190ad6
fix(ci): clarify tmux prepare diagnostics
yiliang114 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2025 Qwen Team | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { readFileSync } from 'node:fs'; | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| const workflow = readFileSync('.github/workflows/qwen-triage.yml', 'utf8'); | ||
|
|
||
| function escapeRegExp(value) { | ||
| return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); | ||
| } | ||
|
|
||
| function step(name) { | ||
| const escaped = escapeRegExp(name); | ||
| const match = workflow.match( | ||
| new RegExp( | ||
|
yiliang114 marked this conversation as resolved.
Resolved
|
||
| `\\n\\s+- name:\\s*(['"])${escaped}\\1[\\s\\S]*?(?=\\n\\s+- name:\\s*['"]|\\n\\s{2}[a-zA-Z0-9_-]+:|$)`, | ||
| ), | ||
| ); | ||
| return match?.[0] ?? ''; | ||
| } | ||
|
|
||
| describe('qwen-triage tmux workflow', () => { | ||
| it('escapes embedded tmux artifacts without bash pattern replacement ampersands', () => { | ||
| const postStep = step('Post tmux result comment'); | ||
|
|
||
| expect(postStep).not.toContain('content="${content//&/&}"'); | ||
| expect(postStep).not.toContain('content="${content//</<}"'); | ||
| expect(postStep).not.toContain('content="${content//>/>}"'); | ||
| expect(postStep).toContain("sed -e 's/&/\\&/g'"); | ||
| expect(postStep).toContain("-e 's/</\\</g'"); | ||
| expect(postStep).toContain("-e 's/>/\\>/g'"); | ||
| expect(postStep).toContain("tr -d '\\000'"); | ||
| expect(postStep).toContain('Log could not be rendered'); | ||
| expect(postStep).toContain('if ! content="$('); | ||
| expect(postStep).toContain('set -o pipefail'); | ||
| expect(postStep).toContain('head_status=0'); | ||
| expect(postStep).toContain('::warning::emit_block failed'); | ||
| }); | ||
|
|
||
| it('passes the selected OpenAI model into the app under tmux test', () => { | ||
| const runStep = step('Run tmux real-user testing'); | ||
|
|
||
| expect(runStep).toContain('if [ -n "${OPENAI_MODEL:-}" ]; then'); | ||
| expect(runStep).toContain('"OPENAI_MODEL=$OPENAI_MODEL"'); | ||
| }); | ||
|
|
||
| it('reports timeout and infra-error without claiming the flow was exercised', () => { | ||
| const postStep = step('Post tmux result comment'); | ||
|
|
||
| expect(postStep).toContain('if [ "${VERDICT:-}" = "infra-error" ]; then'); | ||
| expect(postStep).toContain('elif [ "${VERDICT:-}" = "timeout" ]; then'); | ||
| expect(postStep).toContain( | ||
| 'elif [ "${VERDICT:-}" = "pass" ] || [ "${VERDICT:-}" = "fail" ]; then', | ||
| ); | ||
| expect(postStep).toContain('VERDICT_LABEL="${VERDICT:-unknown}"'); | ||
| expect(postStep).toContain("VERDICT_LABEL='infra-error (crash/OOM)'"); | ||
| expect(postStep).toContain('The tmux test did not complete'); | ||
| expect(postStep).toContain( | ||
| 'The tmux test did not complete before the time limit', | ||
| ); | ||
| expect(postStep).toContain('not a pass/fail result'); | ||
| expect(postStep).toContain('crashes or memory leaks'); | ||
| expect(postStep).toContain( | ||
| 'Launched the changed app in a real tmux session and exercised the affected flow.', | ||
| ); | ||
| expect(postStep).toContain('produced an unrecognized verdict'); | ||
| }); | ||
|
|
||
| it('installs the heavy tmux test harness only for runnable PRs', () => { | ||
| const installStep = step('Install tmux runner tools'); | ||
| const resolverStep = step('Install PR resolver tools'); | ||
|
|
||
| expect(resolverStep).toContain('apt-get install'); | ||
| expect(installStep).toContain('if: "steps.pr.outputs.decision == \'run\'"'); | ||
| expect(resolverStep).not.toContain('tmux'); | ||
| expect(resolverStep).not.toContain('npm install'); | ||
| expect(resolverStep).not.toContain('qwen --version'); | ||
| expect( | ||
| workflow.indexOf("- name: 'Resolve PR and check state'"), | ||
| ).toBeLessThan(workflow.indexOf("- name: 'Install tmux runner tools'")); | ||
| }); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.