Add tests for base loader
Depends on D1814
Details
Diff Detail
- Repository
- rDLDBASE Generic VCS/Package Loader
- Branch
- test
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 7140 Build 10070: tox-on-jenkins Jenkins Build 10069: arc lint + arc unit
Event Timeline
Build has FAILED
Link to build: https://jenkins.softwareheritage.org/job/DLDBASE/job/tox/132/
See console output for more information: https://jenkins.softwareheritage.org/job/DLDBASE/job/tox/132/console
Build is green
See https://jenkins.softwareheritage.org/job/DLDBASE/job/tox/138/ for more details.
swh/loader/base/tests/base_test_loader.py | ||
---|---|---|
2 ↗ | (On Diff #5976) | This name of the file is weird and I suppose we need to change it, but it can't have word "test" in the start or end of the name because then it would be detected as a separate test which is not true. it is meant to work when overridden in the loader(see GNU loader for example). |
swh/loader/base/tests/download_test_base.py | ||
5 ↗ | (On Diff #5976) | Are these tests enough, do we need more tests? (same question for the file above this base__test_loader.py) |
swh/loader/base/tests/base_test_loader.py | ||
---|---|---|
2 ↗ | (On Diff #5976) |
No better suggestion, i'd say that will do for now. A remark though, we are trying (again, that takes time to converge) to move away from tests defined within classes. Thanks |
A remark though, we are trying (again, that takes time to converge) to move away from tests defined within classes.
I know you don't really have the examples.
Because the code you start from was written prior to those decisions, but still, can you please have a look at pytest's documentation (pytest fixture) to work towards those?
Referencing the task helps.
Related T1261
Note:
I did not ask earlier for the listers because that was not a bootstrap phase.
You added new listers and it was reasonable to start using the existing tests base code.
Here, i think it's reasonable to start testing with this in mind.
Thanks in advance.
I will look at pytest documentation and try to convert these tests according to the new format. One doubt though.
to move away from tests defined within classes.
If these all tests are not concealed in a class then how will these tests be inherited by all the loader?
One possible solution I can think of is importing function instead of class and then calling those functions from the all loader tests.
Build is green
See https://jenkins.softwareheritage.org/job/DLDBASE/job/tox/146/ for more details.