Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Refactor tests to use `checkPackage` directly

オープン
#140 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
リファクタリング
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
dart
領域
testing-qa

調査の方向性

executable_test.dart から始め、#138 で参照されている workspace のテストと比較します。現在テストがどのようにツールを呼び出し、stdout、stderr、終了コードを確認しているかを追跡し、その後 checkPackage() と package:test のストリーム matcher を確認します。実行可能ファイルのテストが直接のエントリーポイントを使用し、これらの assertions を維持し、workspace のテストに近い実行時間を達成すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

The workspace tests (see #138) run 11 tests in just 1 second, or about 0.1 sec/test. The existing executable_test.dart tests run 25 tests in 1:40, or about 4 sec/test. That's not prohibitively long, but maybe it can be improved.

Both tests generate directories and files to disk in the same way and run the tool on those files. The main difference is that instead of calling dart run dependency_validator and checking the output, the workspace tests call checkPackage() directly and don't spawn any new processes.

The original tests do more than just check the return value though. They also check the stdout, stderr, and exit code, so they use Process.start. They can probably be rewritten to use checkPackage() directly with a custom logger, and use stream matchers from package:test instead of checking the entire process output.

If this results in tests that run similarly to the workspace tests, that could mean the 25 tests will be complete in about 2.5 seconds -- an over 95% speedup.

主要言語
Dart
スター
66
フォーク
26
平均マージ
37分
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Workiva/dependency_validator のほかの issue

Workiva/dependency_validator の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。