Bug 40402 - xt/find-license-problems.t is failing
Summary: xt/find-license-problems.t is failing
Status: Pushed to stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Tomás Cohen Arazi (tcohen)
URL:
Keywords:
Depends on:
Blocks: 40419
  Show dependency treegraph
 
Reported: 2025-07-16 08:31 UTC by Jonathan Druart
Modified: 2025-07-24 08:21 UTC (History)
3 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.02
Circulation function:


Attachments
Bug 40402: Make xt/find-license-problems.t process files that are in the git index (3.55 KB, patch)
2025-07-16 08:37 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40402: Make xt/find-license-problems.t process files that are in the git index (3.60 KB, patch)
2025-07-16 20:11 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 40402: Make xt/find-license-problems.t process files that are in the git index (3.60 KB, patch)
2025-07-16 20:11 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 40402: Make xt/find-license-problems.t process files that are in the git index (3.66 KB, patch)
2025-07-16 20:14 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2025-07-16 08:31:00 UTC
02:52:31 koha_1       | #   Failed test at xt/find-license-problems.t line 65.
02:52:31 koha_1       | #          got: '0'
02:52:31 koha_1       | #     expected: '1'
02:52:33 koha_1       | # File ./misc/translator/po/LICENSE has wrong copyright: hasgpl=1, hasv3=1, hasorlater=1, haslinktolicense=0, hasfranklinst=0
02:52:33 koha_1       | # Looks like you failed 1 test of 1381.
02:52:33 koha_1       | [00:51:24] xt/find-license-problems.t 

A LICENSE file has been added to koha-l10n, and now this test fails on it.

https://gitlab.com/koha-community/koha-l10n/-/commit/27ab9ff4d2462c3f95cd54ae4a2e53ce7d2f6a65

But we should not test files that are not part of the git index.
Comment 1 Jonathan Druart 2025-07-16 08:37:06 UTC
Created attachment 184124 [details] [review]
Bug 40402: Make xt/find-license-problems.t process files that are in the git index

And only those files.

Currently the test is failing with
02:52:31 koha_1       | #   Failed test at xt/find-license-problems.t line 65.
02:52:31 koha_1       | #          got: '0'
02:52:31 koha_1       | #     expected: '1'
02:52:33 koha_1       | # File ./misc/translator/po/LICENSE has wrong copyright: hasgpl=1, hasv3=1, hasorlater=1, haslinktolicense=0, hasfranklinst=0
02:52:33 koha_1       | # Looks like you failed 1 test of 1381.
02:52:33 koha_1       | [00:51:24] xt/find-license-problems.t

Because a LICENSE file has been added to koha-l10n, and now this test fails on it.

https://gitlab.com/koha-community/koha-l10n/-/commit/27ab9ff4d2462c3f95cd54ae4a2e53ce7d2f6a65

But we should not test files that are not part of the git index.

Test plan:
0. Do not apply this patch
1. Edit xt/find-license-problems.t, add
  warn scalar(@files);
2. Run `prove xt/find-license-problems.t`
=> Notice that 4056 files are processed
Note that you need to have a clean git repo. You can run the following
git command BUT BEWARE /*\ it will remove all changes not committed
  `git clean -d -f`
3. Apply this patch, prove again
=> Tests are passing, with the same number of tests
xt/find-license-problems.t .. ok
All tests successful.
Files=1, Tests=4056

Note that I think we lost one file, as Test::NoWarnings is adding a
test. But I don't think it is worth the trouble to find out which one is
missing.
Comment 2 Jonathan Druart 2025-07-16 19:01:15 UTC
*** Bug 40419 has been marked as a duplicate of this bug. ***
Comment 3 Tomás Cohen Arazi (tcohen) 2025-07-16 20:11:51 UTC
Created attachment 184172 [details] [review]
Bug 40402: Make xt/find-license-problems.t process files that are in the git index

And only those files.

Currently the test is failing with
02:52:31 koha_1       | #   Failed test at xt/find-license-problems.t line 65.
02:52:31 koha_1       | #          got: '0'
02:52:31 koha_1       | #     expected: '1'
02:52:33 koha_1       | # File ./misc/translator/po/LICENSE has wrong copyright: hasgpl=1, hasv3=1, hasorlater=1, haslinktolicense=0, hasfranklinst=0
02:52:33 koha_1       | # Looks like you failed 1 test of 1381.
02:52:33 koha_1       | [00:51:24] xt/find-license-problems.t

Because a LICENSE file has been added to koha-l10n, and now this test fails on it.

https://gitlab.com/koha-community/koha-l10n/-/commit/27ab9ff4d2462c3f95cd54ae4a2e53ce7d2f6a65

But we should not test files that are not part of the git index.

Test plan:
0. Do not apply this patch
1. Edit xt/find-license-problems.t, add
  warn scalar(@files);
2. Run `prove xt/find-license-problems.t`
=> Notice that 4056 files are processed
Note that you need to have a clean git repo. You can run the following
git command BUT BEWARE /*\ it will remove all changes not committed
  `git clean -d -f`
3. Apply this patch, prove again
=> Tests are passing, with the same number of tests
xt/find-license-problems.t .. ok
All tests successful.
Files=1, Tests=4056

Note that I think we lost one file, as Test::NoWarnings is adding a
test. But I don't think it is worth the trouble to find out which one is
missing.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Lucas Gass (lukeg) 2025-07-16 20:11:51 UTC
Created attachment 184173 [details] [review]
Bug 40402: Make xt/find-license-problems.t process files that are in the git index

And only those files.

Currently the test is failing with
02:52:31 koha_1       | #   Failed test at xt/find-license-problems.t line 65.
02:52:31 koha_1       | #          got: '0'
02:52:31 koha_1       | #     expected: '1'
02:52:33 koha_1       | # File ./misc/translator/po/LICENSE has wrong copyright: hasgpl=1, hasv3=1, hasorlater=1, haslinktolicense=0, hasfranklinst=0
02:52:33 koha_1       | # Looks like you failed 1 test of 1381.
02:52:33 koha_1       | [00:51:24] xt/find-license-problems.t

Because a LICENSE file has been added to koha-l10n, and now this test fails on it.

https://gitlab.com/koha-community/koha-l10n/-/commit/27ab9ff4d2462c3f95cd54ae4a2e53ce7d2f6a65

But we should not test files that are not part of the git index.

Test plan:
0. Do not apply this patch
1. Edit xt/find-license-problems.t, add
  warn scalar(@files);
2. Run `prove xt/find-license-problems.t`
=> Notice that 4056 files are processed
Note that you need to have a clean git repo. You can run the following
git command BUT BEWARE /*\ it will remove all changes not committed
  `git clean -d -f`
3. Apply this patch, prove again
=> Tests are passing, with the same number of tests
xt/find-license-problems.t .. ok
All tests successful.
Files=1, Tests=4056

Note that I think we lost one file, as Test::NoWarnings is adding a
test. But I don't think it is worth the trouble to find out which one is
missing.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 5 Tomás Cohen Arazi (tcohen) 2025-07-16 20:14:06 UTC
Created attachment 184174 [details] [review]
Bug 40402: Make xt/find-license-problems.t process files that are in the git index

And only those files.

Currently the test is failing with
02:52:31 koha_1       | #   Failed test at xt/find-license-problems.t line 65.
02:52:31 koha_1       | #          got: '0'
02:52:31 koha_1       | #     expected: '1'
02:52:33 koha_1       | # File ./misc/translator/po/LICENSE has wrong copyright: hasgpl=1, hasv3=1, hasorlater=1, haslinktolicense=0, hasfranklinst=0
02:52:33 koha_1       | # Looks like you failed 1 test of 1381.
02:52:33 koha_1       | [00:51:24] xt/find-license-problems.t

Because a LICENSE file has been added to koha-l10n, and now this test fails on it.

https://gitlab.com/koha-community/koha-l10n/-/commit/27ab9ff4d2462c3f95cd54ae4a2e53ce7d2f6a65

But we should not test files that are not part of the git index.

Test plan:
0. Do not apply this patch
1. Edit xt/find-license-problems.t, add
  warn scalar(@files);
2. Run `prove xt/find-license-problems.t`
=> Notice that 4056 files are processed
Note that you need to have a clean git repo. You can run the following
git command BUT BEWARE /*\ it will remove all changes not committed
  `git clean -d -f`
3. Apply this patch, prove again
=> Tests are passing, with the same number of tests
xt/find-license-problems.t .. ok
All tests successful.
Files=1, Tests=4056

Note that I think we lost one file, as Test::NoWarnings is adding a
test. But I don't think it is worth the trouble to find out which one is
missing.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Lucas Gass (lukeg) 2025-07-16 20:33:00 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 7 Paul Derscheid 2025-07-24 08:21:28 UTC
Nice work everyone!

Pushed to 25.05.x