Clean up read-only runtime cache trees after tests

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

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

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

評価

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

調査の方向性

tests/plugin_testing.py の discard_tree() ヘルパーを読み、削除前に書き込み権限をどのように復元しているかを確認してください。次に、テスト内で ignore_errors=True を指定して shutil.rmtree を呼んでいる箇所を grep し、一時的なランタイムキャッシュのクリーンアップを discard_tree() に切り替えます。これらのテストが、非特権ユーザーとして実行したときに読み取り専用のキャッシュツリーを削除し、ディレクトリを残さないことが完了条件です。

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

説明

app: scripts Bucket: KTLO status: backlog type: housekeeping
Proposed Changes

Use the existing discard_tree() helper from tests/plugin_testing.py to clean up temporary runtime cache directories created by tests.

Justification

The runtime cache intentionally makes published revision trees read-only. Several tests use shutil.rmtree() with ignore_errors=True for cleanup, which silently leaves these trees behind when running as an unprivileged user.

Reusing discard_tree() ensures that write permissions are restored before removal and prevents temporary directories from accumulating across repeated test runs.

主要言語
Python
スター
8
フォーク
0
平均マージ
13時間 4分
マージ済み PR(30日)
77

環境構築

はじめの一歩

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

netbox-community/netbox-scripts のほかの issue

netbox-community/netbox-scripts の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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