Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 771600 - dev-util/pkgcheck-0.8.2 fails TestPkgcheckScan.test_scan_verify[eclass] test on non-english locales
Summary: dev-util/pkgcheck-0.8.2 fails TestPkgcheckScan.test_scan_verify[eclass] test ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords: TESTFAILURE
Depends on:
Blocks:
 
Reported: 2021-02-19 08:53 UTC by Sergei Trofimovich (RETIRED)
Modified: 2021-02-21 10:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergei Trofimovich (RETIRED) gentoo-dev 2021-02-19 08:53:56 UTC
$ locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE=C
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=

# FEATURES=test emerge -v1O pkgcheck

[ebuild   R   ~] dev-util/pkgcheck-0.8.2::gentoo  USE="test*" PYTHON_TARGETS="python3_8 python3_9" 0 KiB

=========================================================================================== FAILURES ===========================================================================================
__________________________________________________________________________ TestPkgcheckScan.test_scan_verify[eclass] ___________________________________________________________________________

self = <module.test_pkgcheck_scan.TestPkgcheckScan object at 0x7f3af8341730>, repo = 'eclass'
tmp_path = PosixPath('/tmp/portage-tmpdir/portage/dev-util/pkgcheck-0.8.2/temp/pytest-of-portage/pytest-0/test_scan_verify_eclass_0')

    @pytest.mark.parametrize('repo', repos)
    def test_scan_verify(self, repo, tmp_path):
        """Run pkgcheck against test pkgs in bundled repo, verifying result output."""
        results = set()
        verbose_results = set()
        for check, keywords in self._checks[repo].items():
            for keyword in keywords:
                # verify the expected results were seen during the repo scans
                expected_results = self._get_results(f'{repo}/{check}/{keyword}/expected.json')
                assert expected_results, 'regular results must always exist'
                assert self._render_results(expected_results), 'failed rendering results'
                results.update(expected_results)

                # when expected verbose results exist use them, otherwise fallback to using the regular ones
                expected_verbose_results = self._get_results(f'{repo}/{check}/{keyword}/expected-verbose.json')
                if expected_verbose_results:
                    assert self._render_results(expected_verbose_results), 'failed rendering verbose results'
                    verbose_results.update(expected_verbose_results)
                else:
                    verbose_results.update(expected_results)

        if results != self._results[repo]:
            missing = self._render_results(results - self._results[repo])
            unknown = self._render_results(self._results[repo] - results)
            error = ['unmatched repo scan results:']
            if missing:
                error.append(f'{repo} repo missing expected results:\n{missing}')
            if unknown:
                error.append(f'{repo} repo unknown results:\n{unknown}')
>           pytest.fail('\n'.join(error))
E           Failed: unmatched repo scan results:
E           eclass repo missing expected results:
E           eclass
E             EclassBashSyntaxError: bad: bash syntax error, line 12: syntax error: unexpected end of file
E
E           eclass repo unknown results:
E           eclass
E             EclassBashSyntaxError: bad: bash syntax error, line а 12: синтаксическая ошибка: неожиданный конец файла

../../tests/module/test_pkgcheck_scan.py:539: Failed
=================================================================================== short test summary info ====================================================================================
FAILED ../../tests/module/test_pkgcheck_scan.py::TestPkgcheckScan::test_scan_verify[eclass] - Failed: unmatched repo scan results:
==================================================================== 1 failed, 675 passed, 59 skipped in 112.43s (0:01:52) =====================================================================
 * ERROR: dev-util/pkgcheck-0.8.2::gentoo failed (test phase):
 *   Tests fail with python3.8
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-02-21 07:59:52 UTC
@radhermit, do you need me to file a bug for this on GitHub?
Comment 2 Tim Harder gentoo-dev 2021-02-21 10:30:37 UTC
(In reply to Michał Górny from comment #1)
> @radhermit, do you need me to file a bug for this on GitHub?

Yes, it's nice to be able to track upstream bugs on their own trackers (please file them there first/only if they're not Gentoo-related) but this one should be fixed via https://github.com/pkgcore/pkgcheck/commit/2170dbec. However, I'm unable to test that locally since for some reason I can't get bash to respect locale changes.