Selfie JVM Snapshot Garbage Collection is overly zealous when using multiple test suites in gradle
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
調査の方向性
リンクされた reproducer とその README の手順から始め、別々の Gradle テストスイートに対する Selfie の JUnit5 スナップショットのガベージコレクションロジックを追跡します。integrationTest の実行を再現し、それらのテストが integrationTest の classpath に存在しない場合に src/test 配下のスナップショットが削除されないことを確認します。未管理のユニットテストのスナップショットがそのまま残り、古いスナップショットが引き続き処理されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
In a project I was using a separate integrationTest source set with the JVM Test Suite approach recommended by Gradle link to instructions.
When done this way, the integration test sources will be in src/integrationTest instead of src/test. The classes in src/test will not be on the classpath of the integration tests.
When running Selfie with JUnit5, the current garbage collection logic is hardcoded to only look for *.ss files in src/test/ and performs a Class.forName(...) to see if that test still exists and has tests that match the snapshot. If it doesn't find a match, it deletes the file.
Since the unit tests are invisible on the integrationTest classpath, though, Class.forName(...) throws a ClassNotFoundException so selfie assumes this is a stale file and deletes. As a consequence, all the unit test snapshots are deleted when running the integrationTest task.
Is there some way to get the correct source root from Junit or something like that to avoid deleting unmanaged files?
A reproducer of the described issue can be found here with instructions in the README https://github.com/aelfric/selfie-bug-report-reproducer
- 主要言語
- Kotlin
- スター
- 101
- フォーク
- 18
- 平均マージ
- 6日 11時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
diffplug/selfie のほかの issue
-
enhancement jvm
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
bug jvm
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
bug docs jvm
難易度 2/5 1〜3時間 初心者へのやさしさ 50/100
-
bug jvm py
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
-
bug jvm
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
diffplug/selfie の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
fwcd/tree-sitter-kotlin#289 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
navikt/syfo-oppfolgingsplan-backend#482 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
MorphiaOrg/morphia#4332 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
ooni/probe-multiplatform#1614 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信