Defect #42024
openRepositoryBazaarTest fails
0%
Description
The CI started failing in bin/rails test test/unit/repository_bazaar_test.rb after r23408.
https://github.com/redmine/redmine/actions/runs/12404268715/job/34629160922
Run bin/rails test test/unit/repository_bazaar_test.rb Run options: --seed 27734 # Running: E Error: RepositoryBazaarTest#test_annotate_latin1_path: NoMethodError: undefined method `lines' for nil:NilClass assert_equal 2, ann1.lines.size ^^^^^^ test/unit/repository_bazaar_test.rb:194:in `test_annotate_latin1_path' bin/rails test test/unit/repository_bazaar_test.rb:188 E Error: RepositoryBazaarTest#test_entry_latin1_path: NoMethodError: undefined method `path' for nil:NilClass entry.path ^^^^^ test/unit/repository_bazaar_test.rb:242:in `block in test_entry_latin1_path' test/unit/repository_bazaar_test.rb:239:in `each' test/unit/repository_bazaar_test.rb:239:in `test_entry_latin1_path' bin/rails test test/unit/repository_bazaar_test.rb:229 (snip)
However, rerunning the CI on r23407, the commit immediately before r23408, resulted in the same failure, suggesting that r23408 is not the cause of the issue.
Files
Updated by Katsuya HIDAKA about 1 month ago
The failing test is located in the .github/workflows/tests.yml at the following section:
https://github.com/redmine/redmine/blob/145db007425dd8b1911f63480fb96985ecca09be/.github/workflows/tests.yml#L103-L108
- name: Run bazaar non ascii test
env:
LANG: en_US.ISO8859-1
LC_ALL: en_US.ISO8859-1
run: |
bin/rails test test/unit/repository_bazaar_test.rb
Updated by Mizuki ISHIKAWA about 1 month ago
It seems that the bzr command execution is failing for the path tmp/test/bazaar_repository/non_ascii/test-Ü-dir/test-Ü-2.txt when running tests ( ex: https://github.com/redmine/redmine/blob/master/test/unit/repository_bazaar_test.rb#L192 ).
I suspect this might be caused by the recent version upgrade of bzr.
Updated by Katsuya HIDAKA 30 days ago
It seems that the test failures began occurring when the GitHub Actions jobs started running on Ubuntu 24.04. The failing jobs are executed on Ubuntu 24.04.
https://github.com/redmine/redmine/actions/runs/12404268715
Updated by Katsuya HIDAKA 29 days ago
- File 0001-Skip-failing-Bazaar-tests-on-Ubuntu-24.04.patch 0001-Skip-failing-Bazaar-tests-on-Ubuntu-24.04.patch added
Resolving this issue seems to take some time.
Since the CI is consistently failing, it is difficult to identify other potential test failures. For now, I propose skipping the failing test to stabilize the CI while continuing to investigate and resolve the root cause. I have attached a patch to skip the test.
After applying the attached patch, I confirmed that the CI passes successfully.
https://github.com/hidakatsuya/redmine/actions/runs/12493345052/job/34861667528
Updated by Go MAEDA 27 days ago
- Category set to Code cleanup/refactoring
Thank you for your proposed fix.
The patch you submitted skips the affected tests in all cases. However, currently, the tests only fail on Ubuntu 24.04. Therefore, I believe it would be better to skip the tests only when running on Ubuntu 24.04. Probably we can determine whether the current platform is Ubuntu 24.04 or not by parsing /etc/os-release
.
What do you think about this approach?
Updated by Go MAEDA 27 days ago
The following code is an updated version of the skip_bzr_failure_on_ubuntu24
method. It skips the test only when the current system is Ubuntu 24.04. What are your thoughts on this approach?
def skip_bzr_failure_on_ubuntu24
return unless File.exist?('/etc/os-release')
os_release = File.read('/etc/os-release')
name = os_release[/^NAME="(.+?)"$/, 1]
version = os_release[/^VERSION_ID="(.+?)"$/, 1]
if name == 'Ubuntu' && version == '24.04'
skip 'bzr command fails on Ubuntu 24.04, causing this test to fail'
end
end
Updated by Katsuya HIDAKA 27 days ago
Thank you for the review.
I agree with your suggestion to skip the test only on Ubuntu 24. I've confirmed that the test passes with your patch:
https://github.com/hidakatsuya/redmine/actions/runs/12521568355