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

helper_lib test assumes the system temporary directory is outside a Git worktree

オープン 初心者向け
#920 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
testing

調査の方向性

まず helper_lib のテストスイートの test_git_root_search_not_found(ターゲットは //src/helper_lib:helper_lib_tests)から始め、次に helper_lib 内の get_runfiles_dir() の実装を読んで、.git を含む祖先を探す仕組みを確認します。修正はテスト側にあります。ルート検索の境界を分離するかモックします(例:開始ディレクトリや検索関数をパッチします)。これにより、ホストの /tmp のレイアウトに関係なく、Git ルートがない分岐に到達できるようにします。完了の条件は、tmp_path の祖先に .git が含まれるホストでテストが通り、bazel test --lockfile_mode=error //src/helper_lib:helper_lib_tests がグリーンになることです.

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

説明

Problem

test_git_root_search_not_found creates nowhere beneath pytest’s tmp_path and expects get_runfiles_dir() to fail because no .git ancestor exists. That assumption does not hold when the system temporary directory itself is inside a Git worktree.

On a Linux host where /tmp/.git exists, the test walks from /tmp/pytest-of-.../nowhere to /tmp, treats /tmp as the Git root, and then follows the runfiles fallback instead of raising SystemExit with Could not find git root. The target therefore fails even though the production behavior is consistent with its ancestor search.

Reproduction

  1. Run the helper-library tests on a host with a Git marker at an ancestor of pytest’s temporary directory (for example /tmp/.git).
  2. Run bazel test --lockfile_mode=error //src/helper_lib:helper_lib_tests.
  3. Observe test_git_root_search_not_found fail because the expected no-root branch is not reached.

This was reproduced while validating #919; 24 of 25 Bazel targets passed, with this target as the only failure.

Expected behavior

The test should deterministically exercise the no-Git-root path regardless of the host temporary-directory layout, for example by isolating or mocking the root search boundary rather than relying on tmp_path having no .git ancestor.

主要言語
Python
スター
11
フォーク
34
平均マージ
1日 7時間
マージ済み PR(30日)
72

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

eclipse-score/docs-as-code のほかの issue

eclipse-score/docs-as-code の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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