Bug 1662777 - Review Request: python-pytest-randomly - Pytest plugin to randomly order tests and control random.seed
Summary: Review Request: python-pytest-randomly - Pytest plugin to randomly order test...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nobody's working on this, feel free to take it
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-01 22:19 UTC by Dan Callaghan
Modified: 2019-09-05 09:03 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Dan Callaghan 2019-01-01 22:19:45 UTC
Spec URL: https://fedorapeople.org/~dcallagh/python-pytest-randomly/python-pytest-randomly.spec
SRPM URL: https://fedorapeople.org/~dcallagh/python-pytest-randomly/python-pytest-randomly-1.2.3-1.fc30.src.rpm
Description: Pytest-randomly is a pytest plugin to randomly order tests and control random.seed.
Fedora Account System Username: dcallagh

Comment 1 Hirotaka Wakabayashi 2019-01-23 14:41:20 UTC
Hello, this is an unofficial review. Please read it for your reference.

# Summary

1. Rpmlint on the src.rpm reported 1 errors, 0 warnings
2. Rpmlint on the binary rpm reported 2 errors, 0 warnings
3. %check should not be failed

# Details

## 1. Rpmlint on the src.rpm reported 1 errors, 0 warnings

no-changelogname-tag error found. You need add a changelog entry.
https://docs.fedoraproject.org/en-US/packaging-guidelines/#changelogs

Here is the output in my fedora29 environment:
```
python-pytest-randomly.src: E: no-changelogname-tag
There is no %changelog tag in your spec file. To insert it, just insert a
'%changelog' in your spec file and rebuild it.

1 packages and 0 specfiles checked; 1 errors, 0 warnings.
```

## 2. Rpmlint on the binary rpm reported 2 errors, 0 warnings

no-changelogname-tag error and non-readable error found.

1. no-changelogname-tag
You need add a changelog entry.
https://docs.fedoraproject.org/en-US/packaging-guidelines/#changelogs

2. non-readable
pytest_randomly.cpython-37-PYTEST.pyc is non-readable from users. Permissions
on files MUST be set properly.
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_file_permissions

Here is the output in my fedora29 environment:
```
python3-pytest-randomly.noarch: E: no-changelogname-tag
There is no %changelog tag in your spec file. To insert it, just insert a
'%changelog' in your spec file and rebuild it.

python3-pytest-randomly.noarch: E: non-readable /usr/lib/python3.7/site-packages/__pycache__/pytest_randomly.cpython-37-PYTEST.pyc 600
The file can't be read by everybody. Review if this is expected.

1 packages and 0 specfiles checked; 2 errors, 0 warnings.
```

## 3. %check should not be failed

%check failed and the status seems to be currently ignored.
tests should be executed and I think they should be executed correctly.
https://docs.fedoraproject.org/en-US/packaging-guidelines/#_test_suites

Here is the output of 'rpmbuild -ra python-pytest-randomly-1.2.3-1.fc29.src.rpm'.
```
...snip...

+ pytest-3 tests/
============================= test session starts ==============================
platform linux -- Python 3.7.2, pytest-3.6.4, py-1.5.4, pluggy-0.6.0
Using --randomly-seed=1548246897
rootdir: /home/vagrant/rpmbuild/BUILD/pytest-randomly-1.2.3, inifile:
plugins: randomly-1.2.3
collected 20 items

tests/test_it.py ..........F...F.....                                    [100%]

...snip...
```

Thanks in advance,
Hirotaka Wakabayashi

Comment 2 Zbigniew Jędrzejewski-Szmek 2019-02-10 16:45:28 UTC
Looks good in general. 

> pytest_randomly.cpython-37-PYTEST.pyc

Is this file created by pytest? It looks like it shouldn't be part of the package at all.

The changelog is indeed missing.

The spec file and srpm don't match anymore. Please post an updated spec file and srpm.

Comment 3 Elliott Sales de Andrade 2019-09-05 09:03:20 UTC
You should set PYTHONDONTWRITEBYTECODE=1 when running tests so that you don't get pytest bytecode in your rpms.


Note You need to log in before you can comment on or make changes to this bug.