已开启
[Bug]: std.unittest report file names don't follow the name@org convention for packages with organization #846
Anisimov Konstantin创建于 9月2日
AAnisimov Konstantin
9月2日 关联了pull request:fix(unittest): use name@org convention in report file names
9月2日 关联了pull request:fix(unittest): use name@org convention in report file names
9月2日 关联了pull request:test: add HLT case for cjpm test reports with organization
Anisimov Konstantin
9月3日 评论:
9月3日 评论:
Related: cangjie_tools#1228 passed swapOrgName-converted package names to std.unittest; it is reverted by Cangjie/cangjie_tools#1265. After the revert, report file name sanitization lives entirely in std.unittest (this issue's fix, PR #1730), while display names keep the org::name form.


9月3日 修改了issue 的描述
9月3日 关联了pull request:fix: cjpm bench report file name problem on windows
9月3日 删除了关联的pull request:fix: cjpm bench report file name problem on windows
9月3日 关联了pull request:fix: cjpm bench report file name problem on windows
9月3日 删除了关联的pull request:fix: cjpm bench report file name problem on windows
9月3日 关联了pull request:fix: cjpm bench report file name problem on windows
感谢对仓颉社区的支持与关注,欢迎反馈缺陷。 | Thanks for your support and attention to the community. We welcome feedback on any issues.
发生了什么问题? | Describe the issue that occurred.
For a package with an organization set in cjpm.toml (e.g.
organization = "huawei",name = "test"), all artifacts produced by cjpm use the filesystem-safename@orgform (target/release/test@huawei/,libtest@huawei.a, test executablestest@huawei,.outlog/.errlogfiles).However, files produced by std.unittest reports derive their names from the raw package group name, which contains
org:::test-huawei::test.sub.xml(before commit 11e8ee86) /test-huawei__test.sub.xml(after it,:→_)reportFileNamebenchmarks/<group>(text_report.cj)TestCaseId.fqName()(id.cj)This is inconsistent with the rest of the toolchain: no other artifact uses the
huawei__testform.期望行为是什么? | What is the expected behavior?
Report file names should use the same
name@orgconvention as every other cjpm artifact, e.g.test-test.sub@huawei.xmlfor packagehuawei::test.sub. This matches how cjpm names the module directory (target/release/test@huawei/), libraries (libtest.sub@huawei.a), test executables (test.sub@huawei) and logs. Neither organization names nor package name segments can contain@, so thepath@orgform stays unambiguous.如何复现该缺陷 | How to reproduce the bug
organization = "huawei"andname = "test"plus a subpackagetest.sub, each with a@Testclass.cjpm test --report-format=xml-per-package.target/release/reports/tests/containstest-huawei__test.xml/test-huawei__test.sub.xmlinstead oftest-test@huawei.xml/test-test.sub@huawei.xml.其他补充信息 | Additional information
Fix: apply org-name swapping (
org::name→name@org, same semantics as cjpm'sswapOrgName) inString.toSafeFileName()instdlib/libs/std/unittest/report_unittest_xml.cj. This is the single choke point through which all four report file name flows go. Related HLT test:cangjie_testHLT/Tools/cjpm/cjpm_build/organization/test_002.https://gitcode.com/Cangjie/cangjie_tools/pull/1265
cjc版本信息 | cjc version information
Current main (cangjie_runtime 8ec835cf+)
分支版本信息 | Branch version information