Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocky Linux 9.3: unit tests fail because of PO file formatting #1315

Open
marc-vanderwal opened this issue Dec 11, 2023 · 3 comments
Open

Rocky Linux 9.3: unit tests fail because of PO file formatting #1315

marc-vanderwal opened this issue Dec 11, 2023 · 3 comments
Labels
A-Translation Area: Documentation of, implementation of or actual translation of text P-High Priority: Issue to be solved before other T-Bug Type: Bug in software or error in test case description
Milestone

Comments

@marc-vanderwal
Copy link
Contributor

PR #1305 changed the formatting of the msgstrs in the PO files in order to make continous integration happy. Otherwise, the tests in t/po-files.t do not pass.

But this change breaks the unit tests when I run them on Rocky Linux 9.3:

$ prove -l t/po-files.t
t/po-files.t .. 3/?
    #   Failed test 'all files are tidied (if not run "make tidy-po")'
    #   at t/po-files.t line 63.
    #          got: '23 23      share/fr.po
    # 10        10      share/nb.po
    # 4 4       share/sv.po
    # '
    #     expected: ''

Reverting commit 7f6495d makes the t/po-files.t pass again:

$ git revert --no-commit 7f6495d
$ prove -l t/po-files.t
t/po-files.t .. ok
All tests successful.
Files=1, Tests=4,  2 wallclock secs ( 0.03 usr  0.04 sys +  1.56 cusr  0.35 csys =  1.98 CPU)
Result: PASS

My comment on PR #1305 suggests that the change might have been due to a different line-breaking algorithm introduced somewhere between gettext-0.19 and 0.21. This turns out not to be quite true, because the version of gettext on my Rocky Linux system is also version 0.21. Either an Ubuntu-supplied patch changed the line-breaking algorithm, or something else is at play.

One possible course of action is to enable this test only in CI environments and disable it anywhere else. Ensuring that PO files are formatted in a consistent way when changes are committed to them is one thing. But in any other situations, unit tests should fail if and only if something about the end user’s environment may prevent the package from operating correctly (e.g. due to unforeseen platform differences); formatting of PO files is not one of those cases.

@marc-vanderwal marc-vanderwal added T-Bug Type: Bug in software or error in test case description P-High Priority: Issue to be solved before other A-Translation Area: Documentation of, implementation of or actual translation of text labels Dec 11, 2023
@marc-vanderwal marc-vanderwal added this to the v2023.2 milestone Dec 11, 2023
@marc-vanderwal
Copy link
Contributor Author

The exact same thing happens when I run unit tests on Zonemaster::CLI.

@matsduf
Copy link
Contributor

matsduf commented Dec 11, 2023

One possible course of action is to enable this test only in CI environments and disable it anywhere else. Ensuring that PO files are formatted in a consistent way when changes are committed to them is one thing. But in any other situations, unit tests should fail if and only if something about the end user’s environment may prevent the package from operating correctly (e.g. due to unforeseen platform differences); formatting of PO files is not one of those cases.

I have run into that problem too on FreeBSD. I cannot remember if it is still there.

This is only a problem in CI since the PO files are not included in the distribution file. The t/po-files.t file is not in MANIFEST but in MANIFEST.SKIP.

But it is a problem if you cannot format the PO file that you add in your PR so that CI accepts it.

@matsduf
Copy link
Contributor

matsduf commented Dec 11, 2023

The exact same thing happens when I run unit tests on Zonemaster::CLI.

po-files.t is not in MANIFEST on CLI either.

@matsduf matsduf modified the milestones: v2023.2, v2024.1 Mar 19, 2024
@matsduf matsduf modified the milestones: v2024.1, v2024.2 Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Translation Area: Documentation of, implementation of or actual translation of text P-High Priority: Issue to be solved before other T-Bug Type: Bug in software or error in test case description
Projects
None yet
Development

No branches or pull requests

2 participants