Tests failing due to missing data file
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- python
- 領域
- testing-qa
調査の方向性
tests/test_distro.py と tests/data/distro/os-release/ubuntu 配下の fixture から始めます。ファイルが見つからないことによる失敗を再現するため、TestDistro.test_distro_from_os_release_file と TestDistro.test_parse_os_release を実行します。テストデータに ubuntu-artful 用の期待される JSON ファイルが 2 つ存在し、source distribution から実行したときに両方のテストが成功すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 38
- フォーク
- 12
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aboutcode-org/container-inspector のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
aboutcode-org/container-inspector#59 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
aboutcode-org/container-inspector#34 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
-
Update intbitsetオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
aboutcode-org/container-inspector#53 · コメント 6 件 ·
aboutcode-org/container-inspector の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
didi/helixharness#18 ·
-
request-theme
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
LizardByte/ThemerrDB#9883 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#149885 ·
メンテナーはふだん 1 日以内に返信
-
Set cache_ok = True on GUID TypeDecorator to enable SQLAlchemy query caching対応中かも @patelshivani2283-lab が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
fedora-infra/anitya#2157 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Project-MONAI/MONAI#9258 ·
メンテナーはふだん 3 日以内に返信