e2e tests hide the CLI output when an exit code assertion fails
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- github-actions, node.js, typescript
調査の方向性
e2e/helpers/run-cli.ts から始め、e2e テストで runCli を呼び出して終了コードを検証する方法を確認してください。issue では e2e/cli-login.test.ts が例として挙げられています。#274 で CLI の出力をアサーションメッセージとして渡す方法を確認し、e2e/ 以下にあるすべての終了コードの検証に出力を含めて、失敗時に stdout と stderr が表示されるようにしてください。すべての該当する検証に出力が含まれ、e2e テストが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Which package is this bug report for?
@nanoforge-dev/cli
Which command is this bug report for?
other
Issue description
When an e2e test that spawns nf fails on its exit code, the failure shows only AssertionError: expected 1 to be +0, not what nf printed. The cause then has to be guessed or rerun with extra logging.
- Most e2e tests destructure only
exitCodefromrunCliand assertexpect(exitCode).toBe(0): 50 such assertions undere2e/onmain(e.g. cli-login.test.ts#L63). - Found while making the Windows CI pass (#273): 14 Windows failures in install, login, logout, publish and unpublish showed only the exit code, and the cause could only be inferred.
- #274 adds the CLI output as the assertion message to the 3
nf install (with existing project)tests only, as a diagnostic:expect(exitCode, output).toBe(0), where the message is the CLI's stdout and stderr.
Expected: every exit-code assertion in e2e/ shows the CLI's stdout and stderr when it fails, for example through a helper next to e2e/helpers/run-cli.ts.
Code sample
// e2e/cli-login.test.ts (main)
const { exitCode } = await runLogin(["--local", "--api-key", "test-api-key"]);
expect(exitCode).toBe(0); // on failure: "expected 1 to be +0", nothing else
Versions
- @nanoforge-dev/cli
main(e95b881) - Node.js 26
- Seen on windows-latest GitHub runners; the same on every OS
Issue priority
Low (slightly annoying)
I have tested this issue on a development release
e95b881
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 2
- 平均マージ
- 2日 18時間
- マージ済み PR(30日)
- 17
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NanoForge-dev/CLI のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NanoForge-dev/CLI#294 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NanoForge-dev/CLI#293 ·
メンテナーはふだん 1 日以内に返信
-
command:dev enhancement good first issue refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
NanoForge-dev/CLI#281 ·
メンテナーはふだん 1 日以内に返信
-
bug command:build good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NanoForge-dev/CLI#276 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 74/100
NanoForge-dev/CLI#228 ·
メンテナーはふだん 1 日以内に返信
NanoForge-dev/CLI の issue をすべて見る
似ている issue
-
Mend: dependency security vulnerability
難易度 1/5 1〜3時間 初心者へのやさしさ 65/100
fdm-monster/fdm-monster#5563 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
be-BOP-io-SA/be-BOP#2849 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
1️⃣ phase/under-investigation flaky/confirmed flaky/needs-decision type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
growilabs/growi#12246 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
🐛 The Rulekeeper - An index run that gives up on the lock ends Succeeded対応中かも @github-actions が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SSWConsulting/SSW.Rules#2809 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信