scripts/image-fixes/20-ReleaseTest.stReleaseTest>>testRatioOfCommentedClassesReleaseTest>>testRatioOfCommentedClasses skipped itself ("failing on the CI for Newtools"). With the skip removed, the test counts classes and traits (minus test cases and baselines) that have an empty comment and asserts the count is at most 876. In the test image the count is 1064 of 8771 on both VMs, so the test fails on both. The count depends on which projects the image holds: Spec2, NewTools, Roassal, Iceberg and Microdown are loaded. In the packages of the pharo repository alone it is 557 of 5724. A ratio test must not use an absolute count, so the fix removes the skip and asserts the ratio: at most 1/8 of the classes and traits may have an empty comment. The measured ratio is 12.1 percent. This changes the expectation and is not a pure repair of the code under test, because the image would need hundreds of new class comments to meet 876. The comments in the image are not changed. The threshold 1/8 is my choice and fits the current image with little margin. The owner should review it.
| Test | Defect in | State | Cause |
|---|---|---|---|
ReleaseTest>>testRatioOfCommentedClasses |
test | repaired | The test skips itself, and its absolute limit of 876 uncommented classes does not hold for an image with external projects (1064 uncommented, same on both VMs). The expectation was replaced by a ratio limit of 1/8 (measured 12.1 percent). |
Regression check: Only test method ReleaseTest>>testRatioOfCommentedClasses was changed, so only class ReleaseTest was run. Ours (without JIT? the ours mode of runtest.sh) before the fix: 43 PASS, 2 FAIL, 1 SKIP. After the fix: 44 PASS, 2 FAIL. Cog before: 43 PASS, 2 FAIL, 1 SKIP. After: 44 PASS, 2 FAIL. The 2 FAIL are the same on both VMs before and after: testPharoVersionFileExists and testUnknownProcesses. These two are outside my cluster and I did not look at them. No other test class covers the changed method.
Upstream note: Title: ReleaseTest>>testRatioOfCommentedClasses: replace the absolute count with a ratio and enable the test. Description (pharo repository): the test has been skipped ("failing on the CI for Newtools"). The limit of 876 uncommented classes depends on which projects are loaded in the image, so it fails for any image with NewTools, Spec2, Roassal and so on. In a Pharo 14 test image with those projects, 1064 of 8771 classes and traits have an empty comment (12.1 percent). The proposal asserts violating size / stereotypes size <= 1/8 and removes the skip. Reviewer: the 1/8 limit is my choice. Pick the value you want for the pharo repository.
Last full sweeps of 2026-11-17: iospharo (sweep14-new14) and stock Cog with the Cog changes (sweepcogp14-new10), with all image fixes. "Before" is the state of the test before the repairs. The Stock Cog column has a value only where the record measured stock Cog: "PASS 3 of 3 (repair run)" is the check of each repair on stock Cog v12.0.6 with the fix entry; "-" is not measured separately.
| Test | Before | State | iospharo VM | Patched Cog | Stock Cog |
|---|---|---|---|---|---|
ReleaseTest>>testRatioOfCommentedClasses | SKIP | repaired | PASS | PASS | PASS 3 of 3 (repair run) |
Run the tests in a Pharo 14 image (build 791). Before the fix they skip, fail or carry the expected-failure mark.
"Run in a Playground of a Pharo 14 image (Do it and print each line)." ((ReleaseTest selector: #testRatioOfCommentedClasses) run) printString.
testRatioOfCommentedClasses | stereotypes violating | self skip. "skip for now as it is failing on the CI for Newtools" stereotypes := OrderedCollection new. stereotypes addAll: Smalltalk globals allTraits; addAll: Smalltalk globals allClasses. stereotypes removeAll: TestCase allSubclasses. stereotypes removeAll: BaselineOf allSubclasses. violating := stereotypes select: [ :each | each comment isEmpty ]. self assert: violating size <= 876
How to apply an entries file: file in 00-header.st and the entries file as one chunk (the iospharo script scripts/gen-image-fixes.py makes that chunk). Each entry checks for the defect first and prints FIXED, ADDED or SKIP. Download 00-header.st.
"ReleaseTest>>testRatioOfCommentedClasses: the method skipped itself ('failing on the CI for Newtools') because it compared an absolute count (876) with the number of uncommented classes in the whole image. The count grows with every external project in the image (Spec2, NewTools, Roassal, Iceberg, Microdown: 1064 uncommented of 8771 in the test image; 557 of 5724 in the packages of the pharo repository). The test is named a RATIO test, so the repaired test asserts a ratio, and the skip is removed. Limit: at most 1/8 of the classes and traits (not test cases, not baselines) may have an empty comment; the measured ratio is 12.1 percent."
fix value: #ReleaseTest value: #testRatioOfCommentedClasses value: [ :src | src includesSubstring: 'self skip' ] value: 'testRatioOfCommentedClasses
| stereotypes violating |
stereotypes := OrderedCollection new.
stereotypes
addAll: Smalltalk globals allTraits;
addAll: Smalltalk globals allClasses.
stereotypes removeAll: TestCase allSubclasses.
stereotypes removeAll: BaselineOf allSubclasses.
violating := stereotypes select: [ :each | each comment isEmpty ].
"The absolute count (876) depended on which projects the image holds (NewTools, Spec2, Roassal ...), so it failed on every image that is not the reference image. The ratio does not."
self assert: violating size / stereotypes size <= (1 / 8)'.
State of 2026-11-20. Made from the test records of the iospharo project (a second Pharo VM). The fixes are proposals for review.