Andrey Rakhmatullin <w...@debian.org> writes:

> On Thu, Dec 05, 2024 at 11:39:24PM +0100, Simon Josefsson wrote:
>> The self-tests tries seems to open some files which fails and I suspect
>> it is because srcdir != builddir reasons, or something similar, see
>> errors here:
>> 
>> https://salsa.debian.org/jas/python-tuf/-/jobs/6707693
>> 
>> ==================================== ERRORS 
>> ====================================
>> ______________ ERROR collecting tests/test_metadata_generation.py 
>> ______________
>> tests/test_metadata_generation.py:10: in <module>
>>     from tests.generated_data.generate_md import generate_all_files
>> tests/generated_data/generate_md.py:60: in <module>
>>     os.mkdir(OUT_DIR)
>> E   FileNotFoundError: [Errno 2] No such file or directory: 
>> 'generated_data/ed25519_metadata'
>> 
>> How is this (seamingly common) problem solved normally?  Do we copy test
>> data files into the build directory somehow?  Do we include them in the
>> package?  Do we patch hard-coded paths like this to make it work?
>
> It's not common and test data files are already copied because they are
> under tests/. It's because of relative paths and I can reproduce this
> problem by running pytest in the upstream's git checkout.

You are right, I reported it upstream:

https://github.com/theupdateframework/python-tuf/issues/2745

I disabled that self-check meanwhile, and got a bit further:

collected 184 items
tests/test_api.py ....................................                   [ 19%]
tests/test_examples.py FFF                                               [ 21%]
tests/test_fetcher_ng.py FFFF.FFFF...                                    [ 27%]
tests/test_metadata_eq_.py ....                                          [ 29%]
tests/test_metadata_serialization.py .........................           [ 43%]
tests/test_repository.py ........                                        [ 47%]
tests/test_trusted_metadata_set.py ..........................            [ 61%]
tests/test_updater_consistent_snapshot.py ...                            [ 63%]
tests/test_updater_delegation_graphs.py ......                           [ 66%]
tests/test_updater_fetch_target.py .....                                 [ 69%]
tests/test_updater_key_rotations.py ..                                   [ 70%]
tests/test_updater_ng.py .FF.FF.F.FFFF                                   [ 77%]
tests/test_updater_top_level_update.py ................................. [ 95%]
...                                                                      [ 97%]
tests/test_updater_validation.py ..                                      [ 98%]
tests/test_utils.py F..                                                  [100%]
...
================== 21 failed, 163 passed, 5 warnings in 5.39s ==================

See full log:

https://salsa.debian.org/jas/python-tuf/-/jobs/6710680/viewer

Several failures seems related to not being able to find some test file,
any ideas how to fix this further?

I'll see if I can figure out how to disable only the failing tests,
pending some better fix.  It seems a large portion of the self-tests now
work so I think this is in good enough shape for an upload to NEW.

/Simon

Attachment: signature.asc
Description: PGP signature

Reply via email to