Tests failing due to missing data file
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- python
- Ambito
- testing-qa
Direzione di ricerca
Inizia da tests/test_distro.py e dai fixture in tests/data/distro/os-release/ubuntu. Esegui TestDistro.test_distro_from_os_release_file e TestDistro.test_parse_os_release per riprodurre i fallimenti dovuti ai file mancanti. Il lavoro è completato quando i due file JSON attesi per ubuntu-artful sono presenti nei dati di test ed entrambi i test superano l’esecuzione dalla distribuzione sorgente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When running the tests from the PyPI tarball, on openSUSE Tumbleweed, I get two failures looking for ubuntu-artful.txt-distro-expected.json in https://github.com/nexB/container-inspector/tree/main/tests/data/distro/os-release/ubuntu , but it doesnt exist.
This occurs irrespective of whether I add /etc/os-release from https://software.opensuse.org/package/openSUSE-release to the build VM.
[ 32s] =================================== FAILURES ===================================
[ 32s] _________________ TestDistro.test_distro_from_os_release_file __________________
[ 32s]
[ 32s] self = <test_distro.TestDistro testMethod=test_distro_from_os_release_file>
[ 32s]
[ 32s] def test_distro_from_os_release_file(self):
[ 32s] test_dir = self.get_test_loc('distro/os-release')
[ 32s]
[ 32s] for test_file in resource_iter(test_dir, with_dirs=False):
[ 32s] if test_file.endswith('-expected.json'):
[ 32s] continue
[ 32s] expected = test_file + '-distro-expected.json'
[ 32s] result = Distro.from_os_release_file(test_file).to_dict()
[ 32s] > check_expected(result, expected, regen=False)
[ 32s]
[ 32s] tests/test_distro.py:41:
[ 32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 32s]
[ 32s] result = {'architecture': None, 'bug_report_url': 'https://bugs.launchpad.net/ubuntu/', 'build_id': None, 'cpe_name': None, ...}
[ 32s] expected = '/home/abuild/rpmbuild/BUILD/container-inspector-32.0.1/tests/data/distro/os-release/ubuntu/ubuntu-artful.txt-distro-expected.json'
[ 32s] regen = False
[ 32s]
[ 32s] def check_expected(result, expected, regen=False):
[ 32s] """
[ 32s] Check equality between a result collection and an expected JSON file.
[ 32s] Regen the expected file if regen is True.
[ 32s] """
[ 32s] if regen:
[ 32s] with open(expected, 'w') as ex:
[ 32s] ex.write(json.dumps(result, indent=2))
[ 32s]
[ 32s] > with open(expected) as ex:
[ 32s] E FileNotFoundError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILD/container-inspector-32.0.1/tests/data/distro/os-release/ubuntu/ubuntu-artful.txt-distro-expected.json'
[ 32s]
[ 32s] tests/utilities.py:21: FileNotFoundError
[ 32s] _______________________ TestDistro.test_parse_os_release _______________________
[ 32s]
[ 32s] self = <test_distro.TestDistro testMethod=test_parse_os_release>
[ 32s]
[ 32s] def test_parse_os_release(self):
[ 32s] test_dir = self.get_test_loc('distro/os-release')
[ 32s]
[ 32s] for test_file in resource_iter(test_dir, with_dirs=False):
[ 32s] if test_file.endswith('expected.json'):
[ 32s] continue
[ 32s] expected = test_file + '-expected.json'
[ 32s] result = parse_os_release(test_file)
[ 32s] > check_expected(result, expected, regen=False)
[ 32s]
[ 32s] tests/test_distro.py:31:
[ 32s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
[ 32s]
[ 32s] result = {'BUG_REPORT_URL': 'https://bugs.launchpad.net/ubuntu/', 'HOME_URL': 'https://www.ubuntu.com/', 'ID': 'ubuntu', 'ID_LIKE': 'debian', ...}
[ 32s] expected = '/home/abuild/rpmbuild/BUILD/container-inspector-32.0.1/tests/data/distro/os-release/ubuntu/ubuntu-artful.txt-expected.json'
[ 32s] regen = False
[ 32s]
[ 32s] def check_expected(result, expected, regen=False):
[ 32s] """
[ 32s] Check equality between a result collection and an expected JSON file.
[ 32s] Regen the expected file if regen is True.
[ 32s] """
[ 32s] if regen:
[ 32s] with open(expected, 'w') as ex:
[ 32s] ex.write(json.dumps(result, indent=2))
[ 32s]
[ 32s] > with open(expected) as ex:
[ 32s] E FileNotFoundError: [Errno 2] No such file or directory: '/home/abuild/rpmbuild/BUILD/container-inspector-32.0.1/tests/data/distro/os-release/ubuntu/ubuntu-artful.txt-expected.json'
[ 32s]
[ 32s] tests/utilities.py:21: FileNotFoundError
- Lingua principale
- Python
- Stelle
- 38
- Fork
- 12
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di aboutcode-org/container-inspector
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
aboutcode-org/container-inspector#59 · 1 commento ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
aboutcode-org/container-inspector#34 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
Update intbitsetAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
aboutcode-org/container-inspector#53 · 6 commenti ·
Tutte le issue di aboutcode-org/container-inspector
Issue simili
-
flow-measurement measurement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
MichaelYcJo/SpecSeal#1366 ·
-
bug c/evals c/ui size:L
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Arize-ai/phoenix#17633 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
TransformerLensOrg/TransformerLens#1980 ·
I maintainer di solito rispondono entro 1 giorno
-
Module: Solr Needs: Lead Needs: Triage Theme: Search Type: Bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
internetarchive/openlibrary#14284 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 69/100
SpaceCowMedia/commander-spellbook-backend#1292 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno