Bug 1898113 - python-diff-cover fails to build in rawhide: tests fail
Summary: python-diff-cover fails to build in rawhide: tests fail
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-diff-cover
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Aurelien Bompard
QA Contact: Fedora Extras Quality Assurance
URL: https://koschei.fedoraproject.org/pac...
Whiteboard:
Depends On:
Blocks: F34FTBFS PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-11-16 12:32 UTC by Miro Hrončok
Modified: 2020-12-29 23:31 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-12-29 23:31:10 UTC
Type: Bug


Attachments (Terms of Use)

Description Miro Hrončok 2020-11-16 12:32:29 UTC
python-diff-cover fails to build with Python 3.10.0a2.

=================================== FAILURES ===================================
__________ DiffQualityIntegrationTest.test_added_file_pylint_console ___________

self = <diff_cover.tests.test_integration.DiffQualityIntegrationTest testMethod=test_added_file_pylint_console>

    def test_added_file_pylint_console(self):
        # output text was modified in https://github.com/PyCQA/pylint/pull/2036
        if tuple(map(int, pylint.__version__.split('.'))) < (2, 4, 0):
            console_report = 'pylint_violations_console_report.txt'
        else:
            console_report = 'pylint_violations_console_report_pylint_2.4.0.txt'
>       self._check_console_report(
            'git_diff_violations.txt',
            console_report,
            ['diff-quality', '--violations=pylint'],
        )

diff_cover/tests/test_integration.py:500: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diff_cover/tests/test_integration.py:158: in _check_console_report
    assert_long_str_equal(expected, report, strip=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

expected = "-------------\nDiff Quality\nQuality Report: pylint\nDiff: origin/master...HEAD, staged and unstaged changes\n-------... func_2: Unused variable 'unused'\n-------------\nTotal:   9 lines\nViolations: 3 lines\n% Quality: 66%\n-------------"
actual = "-------------\nDiff Quality\nQuality Report: pylint\nDiff: origin/master...HEAD, staged and unstaged changes\n-------... func_2: Unused variable 'unused'\n-------------\nTotal:   9 lines\nViolations: 2 lines\n% Quality: 77%\n-------------"
strip = True

    def assert_long_str_equal(expected, actual, strip=False):
        """
        Assert that two strings are equal and
        print the diff if they are not.
    
        If `strip` is True, strip both strings before comparing.
        """
        # If we've been given a byte string, we need to convert
        # it back to unicode.  Otherwise, Python3 won't
        # let us use string methods!
        if isinstance(expected, six.binary_type):
            expected = expected.decode('utf-8')
        if isinstance(actual, six.binary_type):
            actual = actual.decode('utf-8')
    
        if strip:
            expected = expected.strip()
            actual = actual.strip()
    
        if expected != actual:
    
            # Print a human-readable diff
            diff = difflib.Differ().compare(
                expected.split('\n'), actual.split('\n')
            )
    
            # Fail the test
>           assert False, '\n\n' + '\n'.join(diff)
E           AssertionError: 
E           
E             -------------
E             Diff Quality
E             Quality Report: pylint
E             Diff: origin/master...HEAD, staged and unstaged changes
E             -------------
E           - violations_test_file.py (66.7%):
E           ?                          ^^ ^
E           
E           + violations_test_file.py (77.8%):
E           ?                          ^^ ^
E           
E             violations_test_file.py:1: C0114: (missing-module-docstring), : Missing module docstring
E             violations_test_file.py:1: C0116: (missing-function-docstring), func_1: Missing function or method docstring
E           - violations_test_file.py:2: C0326: (bad-whitespace), : Exactly one space required around comparison
E           - violations_test_file.py:11: C0326: (bad-whitespace), : Exactly one space required around assignment
E             violations_test_file.py:11: W0612: (unused-variable), func_2: Unused variable 'unused'
E             -------------
E             Total:   9 lines
E           - Violations: 3 lines
E           ?             ^
E           
E           + Violations: 2 lines
E           ?             ^
E           
E           - % Quality: 66%
E           ?            ^^
E           
E           + % Quality: 77%
E           ?            ^^
E           
E             -------------

diff_cover/tests/helpers.py:43: AssertionError
_______________ DiffQualityIntegrationTest.test_fail_under_html ________________

self = <diff_cover.tests.test_integration.DiffQualityIntegrationTest testMethod=test_fail_under_html>

    def test_fail_under_html(self):
>       self._check_html_report(
            'git_diff_violations.txt',
            'pylint_violations_report.html',
            ['diff-quality', '--violations=pylint', '--fail-under=70'],
            expected_status=1
        )

diff_cover/tests/test_integration.py:424: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diff_cover/tests/test_integration.py:109: in _check_html_report
    self.assertEqual(code, expected_status)
E   AssertionError: 0 != 1
_________________ JsonReportGeneratorTest.test_generate_report _________________

self = <diff_cover.tests.test_report_generator.JsonReportGeneratorTest testMethod=test_generate_report>

    def test_generate_report(self):
    
        # Generate a default report
        self.use_default_values()
    
        # Verify that we got the expected string
        expected = json.dumps({
            'report_name': ['reports/coverage.xml'],
            'diff_name': 'master',
            'src_stats': {
                'file1.py': {
                    'percent_covered': 66.66666666666667,
                    'violation_lines': [10, 11],
                    'violations': [[10, None], [11, None]]
                },
                'subdir/file2.py': {
                    'percent_covered': 66.66666666666667,
                    'violation_lines': [10, 11],
                    'violations': [[10, None], [11, None]]
                }
            },
            'total_num_lines': 12,
            'total_num_violations': 4,
            'total_percent_covered': 66
        })
    
>       self.assert_report(expected)

diff_cover/tests/test_report_generator.py:300: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
diff_cover/tests/test_report_generator.py:163: in assert_report
    assert_long_str_equal(expected, output_str, strip=True)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

expected = '{"report_name": ["reports/coverage.xml"], "diff_name": "master", "src_stats": {"file1.py": {"percent_covered": 66.666...iolations": [[10, null], [11, null]]}}, "total_num_lines": 12, "total_num_violations": 4, "total_percent_covered": 66}'
actual = '{"report_name": ["reports/coverage.xml"], "diff_name": "master", "src_stats": {"subdir/file2.py": {"percent_covered":...iolations": [[10, null], [11, null]]}}, "total_num_lines": 12, "total_num_violations": 4, "total_percent_covered": 66}'
strip = True

    def assert_long_str_equal(expected, actual, strip=False):
        """
        Assert that two strings are equal and
        print the diff if they are not.
    
        If `strip` is True, strip both strings before comparing.
        """
        # If we've been given a byte string, we need to convert
        # it back to unicode.  Otherwise, Python3 won't
        # let us use string methods!
        if isinstance(expected, six.binary_type):
            expected = expected.decode('utf-8')
        if isinstance(actual, six.binary_type):
            actual = actual.decode('utf-8')
    
        if strip:
            expected = expected.strip()
            actual = actual.strip()
    
        if expected != actual:
    
            # Print a human-readable diff
            diff = difflib.Differ().compare(
                expected.split('\n'), actual.split('\n')
            )
    
            # Fail the test
>           assert False, '\n\n' + '\n'.join(diff)
E           AssertionError: 
E           
E           - {"report_name": ["reports/coverage.xml"], "diff_name": "master", "src_stats": {"file1.py": {"percent_covered": 66.66666666666667, "violation_lines": [10, 11], "violations": [[10, null], [11, null]]}, "subdir/file2.py": {"percent_covered": 66.66666666666667, "violation_lines": [10, 11], "violations": [[10, null], [11, null]]}}, "total_num_lines": 12, "total_num_violations": 4, "total_percent_covered": 66}
E           + {"report_name": ["reports/coverage.xml"], "diff_name": "master", "src_stats": {"subdir/file2.py": {"percent_covered": 66.66666666666667, "violation_lines": [10, 11], "violations": [[10, null], [11, null]]}, "file1.py": {"percent_covered": 66.66666666666667, "violation_lines": [10, 11], "violations": [[10, null], [11, null]]}}, "total_num_lines": 12, "total_num_violations": 4, "total_percent_covered": 66}

diff_cover/tests/helpers.py:43: AssertionError
=========================== short test summary info ============================
FAILED diff_cover/tests/test_integration.py::DiffQualityIntegrationTest::test_added_file_pylint_console
FAILED diff_cover/tests/test_integration.py::DiffQualityIntegrationTest::test_fail_under_html
FAILED diff_cover/tests/test_report_generator.py::JsonReportGeneratorTest::test_generate_report
================= 3 failed, 231 passed, 3 deselected in 9.90s ==================


The failures also happen in rawhide since ~August:

https://koschei.fedoraproject.org/package/python-diff-cover?collection=f34


For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01757415-python-diff-cover/

For all our attempts to build python-diff-cover with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-diff-cover/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Fedora Release Engineering 2020-12-06 04:22:31 UTC
Dear Maintainer,

your package has an open Fails To Build From Source bug for Fedora 34.
Action is required from you.

If you can fix your package to build, perform a build in koji, and either create
an update in bodhi, or close this bug without creating an update, if updating is
not appropriate [1]. If you are working on a fix, set the status to ASSIGNED to
acknowledge this. If you have already fixed this issue, please close this Bugzilla report.

Following the policy for such packages [2], your package will be orphaned if
this bug remains in NEW state more than 8 weeks (not sooner than 2021-01-11).

A week before the mass branching of Fedora 35 according to the schedule [3],
any packages not successfully rebuilt at least on Fedora 33 will be
retired regardless of the status of this bug.

[1] https://docs.fedoraproject.org/en-US/fesco/Updates_Policy/
[2] https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
[3] https://fedorapeople.org/groups/schedule/f-35/f-35-key-tasks.html

Comment 2 Fedora Release Engineering 2020-12-27 04:22:14 UTC
Dear Maintainer,

your package has an open Fails To Build From Source bug for Fedora 34.
Action is required from you.

If you can fix your package to build, perform a build in koji, and either create
an update in bodhi, or close this bug without creating an update, if updating is
not appropriate [1]. If you are working on a fix, set the status to ASSIGNED to
acknowledge this. If you have already fixed this issue, please close this Bugzilla report.

Following the policy for such packages [2], your package will be orphaned if
this bug remains in NEW state more than 8 weeks (not sooner than 2021-01-11).

A week before the mass branching of Fedora 35 according to the schedule [3],
any packages not successfully rebuilt at least on Fedora 33 will be
retired regardless of the status of this bug.

[1] https://docs.fedoraproject.org/en-US/fesco/Updates_Policy/
[2] https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/
[3] https://fedorapeople.org/groups/schedule/f-35/f-35-key-tasks.html

Comment 3 Kevin Fenzi 2020-12-29 23:17:16 UTC
Built 4.0.1 in rawhide. Can you test with 3.10a again?

Comment 4 Miro Hrončok 2020-12-29 23:31:10 UTC
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-diff-cover/ says succeeded, thanks.

(The copr repo is set to build every push to rawhide dist git.)


Note You need to log in before you can comment on or make changes to this bug.