jerry-git / jerry-git/pytest-split
wrong rootdir detected
- Ngôn ngữ chính
- Python
- Star
- 325
- Fork
- 56
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Tái hiện lệnh được báo cáo với --splits, --group và --durations-path, sau đó đọc hành vi khởi tạo của pytest đối với rootdir và tệp cấu hình. Theo dõi cách pytest-split định vị và đọc tệp test_durations; được xem là hoàn thành khi các nodeids đã lưu được sử dụng một cách đáng tin cậy trong trường hợp đường dẫn durations nằm bên ngoài thư mục gốc của dự án, với một bài kiểm thử hồi quy bao quát lệnh này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- python
- Lĩnh vực
- testing-qa
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 28/100