Defect #42024
open
RepositoryBazaarTest fails
Added by Katsuya HIDAKA about 1 month ago.
Updated 26 days ago.
Category:
Code cleanup/refactoring
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
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
- 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?
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
Committed the patch to skip affected tests in r23421 as a temporary workaround. Thank you.
Also available in: Atom
PDF