Tests failing due to missing data file
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Bắt đầu với tests/test_distro.py và các fixture trong tests/data/distro/os-release/ubuntu. Chạy TestDistro.test_distro_from_os_release_file và TestDistro.test_parse_os_release để tái hiện các lỗi do thiếu tệp. Hoàn tất khi hai tệp JSON được mong đợi cho ubuntu-artful có mặt trong dữ liệu kiểm thử và cả hai kiểm thử đều đạt khi chạy từ bản phân phối mã nguồn.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 38
- Fork
- 12
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aboutcode-org/container-inspector
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
aboutcode-org/container-inspector#59 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
aboutcode-org/container-inspector#34 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
-
Update intbitsetĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
aboutcode-org/container-inspector#53 · 6 bình luận ·
Tất cả issue của aboutcode-org/container-inspector
Issue tương tự
-
HandyModRTransform.deriv3 is wrong for m > 2Có thể đã có người làm @SajalDevX đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
read_messages: the first read after subscribe/psubscribe returns no messages even when some are waitingCó thể đã có người làm @matheussilvano đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
The-Swarm-Corporation/swarms-framework-docs#399 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bump patch
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
autowarefoundation/autoware_carla_scenario#1321 ·
Maintainer thường phản hồi trong vòng 1 ngày