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

logging in test runner / CI : higher log level but only print failing tests

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

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
python
領域
ci-cd, testing-qa

調査の方向性

aggregate_tests.py と、issue に記載されている test runner のバッファリング動作を読み、提案された handler と in-toto のアプローチを比較してください。失敗したテストについてはより高いレベルのロギングを利用でき、成功したテストの出力は CI を含めてバッファリングされたままであることを確認してください。

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

説明

testing

We should do what in-toto does: have the test runner output much more logging but only for failing tests. This should be especially useful for CI but also for developers.

Assuming we hard-code a good log level (see #1093 for potential alternatives), I think we only need roughly this in aggregate_tests.py:

class TestHandler(logging.StreamHandler):
  def __init__(self):
    super().__init__(self)

  @property
  def stream(self):
    return sys.stderr

  @stream.setter
  def stream(self, value):
    pass

if __name__ == '__main__':
  logging.basicConfig(level=logging.INFO, handlers=[TestHandler()])
  # current testrunner code here...

This is because the testrunner buffering will not work with long lived loggers otherwise: the default handler caches sys.stderr value and testrunner wants to modify it between test runs (and buffering is required to only print the failing test output).

主要言語
Python
スター
1.7k
フォーク
304
平均マージ
9時間 25分
マージ済み PR(30日)
14

環境構築

はじめの一歩

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

theupdateframework/python-tuf のほかの issue

theupdateframework/python-tuf の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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