jerry-git / jerry-git/pytest-split

wrong rootdir detected

オープン
#59 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
325
フォーク
56
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi,

I found using `pytest` with parameter with ` --durations-path` option will change pytest rootdir, so the nodeid of all tests cannot be found in the test_durations file.
For example
```
% pytest --splits 2 --group 1 --durations-path ~/Downloads/.test_durations -s
========================== test session starts ===========================
platform darwin -- Python 3.8.13, pytest-6.2.0, py-1.11.0, pluggy-0.13.1
rootdir: /Users/xiongding
```
The rootdir is my home folder. So basically the nodeids stored in test_duration are not used. This is a pytest's documentation https://docs.pytest.org/en/6.2.x/customize.html#initialization-determining-rootdir-and-configfile

It is hard to say it is a bug on pytest-split side. The `pytest` algorithm to determine rootdir is also weird. We can easily avoid this issue using `--rootdir` option, or move `test_durations` file to project rootdir before running pytest. But just want to ask is there a better design? There is no error so I did not find this issue for a long time.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Reproduce the reported command with --splits, --group, and --durations-path, then read pytest's rootdir and configuration-file initialization behavior. Trace how pytest-split locates and reads the test_durations file; done means the stored nodeids are reliably used when the durations path is outside the project root, with a regression test covering the command.

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

評価

技術スタック
python
領域
testing-qa
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
28/100

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

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