Pharo test defects

SpEasy-skips

State
Fixed (image fix)
Defect in
the Pharo image
Tests
10
Fix
image fix 20-SpEasy-skips.st
Upstream repository
pharo-spec/Spec

Record

Ten Spec2 Easy presenter test methods were overridden with 'self skip', so the inherited generic tests never ran. For 7 of them the Easy presenters really lacked the API the generic tests call. SpAbstractEasyListViewPresenter had no whenSortingBlockChangedDo:, so the column-view sorting tests would have raised MessageNotUnderstood. SpAbstractEasyTreeListViewPresenter had no pathIndexOf: or pathItemOf:. The 3 testDisableActivationDuring overrides (Column, TreeColumn, List) passed as soon as the skip was removed. The fix adds the three delegating methods (to contentView, mirroring the protocol of SpAbstractListPresenter and SpAbstractTreePresenter) and removes the 'self skip' override from each test class that has one, so the inherited test runs unchanged. The 'does not make sense in a column view' comment is wrong: SpColumnViewPresenter inherits sortingBlock support and SpColumnViewPresenterTest already runs those tests. Removal is guarded: it only removes a method whose source contains 'self skip' and is under 200 characters. The tree-list class inherits its tests from the tree-column test class, so removing the skips there covers both.

Test Defect in State Cause
SpEasyColumnViewPresenterTest>>testDisableActivationDuring test repaired Needless 'self skip' override; the inherited test passes unchanged.
SpEasyColumnViewPresenterTest>>testSetSortingBlockBeforeItems image-code repaired SpAbstractEasyListViewPresenter lacked whenSortingBlockChangedDo:; the override claimed the test makes no sense for a column view, which is wrong because SpColumnViewPresenterTest runs it.
SpEasyColumnViewPresenterTest>>testSortingBlock image-code repaired Same as testSetSortingBlockBeforeItems: whenSortingBlockChangedDo: was missing on SpAbstractEasyListViewPresenter.
SpEasyListViewPresenterTest>>testDisableActivationDuring test repaired Needless 'self skip' override ('no needed here since this is private'); the inherited test passes unchanged.
SpEasyTreeColumnViewPresenterTest>>testDisableActivationDuring test repaired Needless 'self skip' override; the inherited test passes unchanged.
SpEasyTreeColumnViewPresenterTest>>testPathIndexOf image-code repaired SpAbstractEasyTreeListViewPresenter had no pathIndexOf:. Added as a delegate to contentView.
SpEasyTreeColumnViewPresenterTest>>testPathItemOf image-code repaired SpAbstractEasyTreeListViewPresenter had no pathItemOf:. Added as a delegate to contentView.
SpEasyTreeListViewPresenterTest>>testDisableActivationDuring test repaired Inherited the skip from SpEasyTreeColumnViewPresenterTest; removing it there fixes this class.
SpEasyTreeListViewPresenterTest>>testPathIndexOf image-code repaired Inherited skip plus the missing pathIndexOf: on SpAbstractEasyTreeListViewPresenter.
SpEasyTreeListViewPresenterTest>>testPathItemOf image-code repaired Inherited skip plus the missing pathItemOf: on SpAbstractEasyTreeListViewPresenter.

Regression check: Whole classes run on our VM and on Cog, each with the base image and the fixed image. All four classes pass fully with the fix on both VMs. Each of the four has the same failure count (0) before and after, so no test that passed before now fails. Our VM (before/after): SpEasyColumnViewPresenterTest 23P+3S / 26P; SpEasyListViewPresenterTest 30P+1S / 31P; SpEasyTreeColumnViewPresenterTest 22P+3S / 25P; SpEasyTreeListViewPresenterTest 22P+3S / 25P. Cog gives identical counts. The three non-test methods are new (no existing method was replaced), and the test classes that use them are exactly these four. SpColumnViewPresenterTest and SpTreePresenterTest were not run, because no method they use was changed.

Upstream note: Title: Spec2 Easy presenters: add whenSortingBlockChangedDo:, pathIndexOf:, pathItemOf:, and run the inherited tests. Description: SpAbstractEasyListViewPresenter lacked whenSortingBlockChangedDo: (SpEasyListViewPresenter only had its own copy), and SpAbstractEasyTreeListViewPresenter lacked pathIndexOf: and pathItemOf:, which SpAbstractTreePresenterTest exercises. Ten SpEasy*PresenterTest methods were overridden with 'self skip'. Add the delegating methods to contentView and delete the skip overrides so the shared tests run. Project: Spec2 (external, only in the image). A human must review this before any upstream submission.

Results

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.

TestBeforeStateiospharo VMPatched CogStock Cog
SpEasyColumnViewPresenterTest>>testDisableActivationDuringSKIPrepairedPASSPASSPASS 3 of 3 (repair run)
SpEasyColumnViewPresenterTest>>testSetSortingBlockBeforeItemsSKIPrepairedPASSPASSPASS 3 of 3 (repair run)
SpEasyColumnViewPresenterTest>>testSortingBlockSKIPrepairedPASSPASSPASS 3 of 3 (repair run)
SpEasyListViewPresenterTest>>testDisableActivationDuringSKIPrepairedPASSPASSPASS 3 of 3 (repair run)
SpEasyTreeColumnViewPresenterTest>>testDisableActivationDuringSKIPrepairedPASSPASSPASS 3 of 3 (repair run)
SpEasyTreeColumnViewPresenterTest>>testPathIndexOfSKIPrepairedPASSPASSPASS 3 of 3 (repair run)
SpEasyTreeColumnViewPresenterTest>>testPathItemOfSKIPrepairedPASSPASSPASS 3 of 3 (repair run)
SpEasyTreeListViewPresenterTest>>testDisableActivationDuringSKIPrepairedPASSPASSPASS 3 of 3 (repair run)
SpEasyTreeListViewPresenterTest>>testPathIndexOfSKIPrepairedPASSPASSPASS 3 of 3 (repair run)
SpEasyTreeListViewPresenterTest>>testPathItemOfSKIPrepairedPASSPASSPASS 3 of 3 (repair run)

Test

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)."
((SpEasyColumnViewPresenterTest selector: #testDisableActivationDuring) run) printString.
((SpEasyColumnViewPresenterTest selector: #testSetSortingBlockBeforeItems) run) printString.
((SpEasyColumnViewPresenterTest selector: #testSortingBlock) run) printString.
((SpEasyListViewPresenterTest selector: #testDisableActivationDuring) run) printString.
((SpEasyTreeColumnViewPresenterTest selector: #testDisableActivationDuring) run) printString.
((SpEasyTreeColumnViewPresenterTest selector: #testPathIndexOf) run) printString.
((SpEasyTreeColumnViewPresenterTest selector: #testPathItemOf) run) printString.
((SpEasyTreeListViewPresenterTest selector: #testDisableActivationDuring) run) printString.
((SpEasyTreeListViewPresenterTest selector: #testPathIndexOf) run) printString.
((SpEasyTreeListViewPresenterTest selector: #testPathItemOf) run) printString.

Source of the tests before the fix

SpEasyColumnViewPresenterTest>>testDisableActivationDuring before the fix (Pharo 14 build 791)
testDisableActivationDuring 

	self skip
SpEasyColumnViewPresenterTest>>testSetSortingBlockBeforeItems before the fix (Pharo 14 build 791)
testSetSortingBlockBeforeItems

	"this does not has sense in a column (or table) view."
	self skip
SpEasyColumnViewPresenterTest>>testSortingBlock before the fix (Pharo 14 build 791)
testSortingBlock

	"this does not has sense in a column (or table) view."
	self skip
SpEasyListViewPresenterTest>>testDisableActivationDuring before the fix (Pharo 14 build 791)
testDisableActivationDuring 

	"no needed here since this is private"
	self skip
SpEasyTreeColumnViewPresenterTest>>testDisableActivationDuring before the fix (Pharo 14 build 791)
testDisableActivationDuring 
	
	self skip
SpEasyTreeColumnViewPresenterTest>>testPathIndexOf before the fix (Pharo 14 build 791)
testPathIndexOf

	self skip
SpEasyTreeColumnViewPresenterTest>>testPathItemOf before the fix (Pharo 14 build 791)
testPathItemOf

	self skip

Fix

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.

20-SpEasy-skips.st (download)
"SpEasy-skips: the Easy presenters lacked the API that the shared Spec2 list and
 tree tests call, so ten test methods were overridden with 'self skip'.  Add the
 delegating API, then remove each 'self skip' override so the inherited test runs."
add value: #SpAbstractEasyListViewPresenter value: #whenSortingBlockChangedDo: value: 'api' value: 'whenSortingBlockChangedDo: aBlock
	"Inform when the sorting block changed.  See SpAbstractListPresenter>>#whenSortingBlockChangedDo:"

	contentView whenSortingBlockChangedDo: aBlock'.
add value: #SpAbstractEasyTreeListViewPresenter value: #pathIndexOf: value: 'private' value: 'pathIndexOf: anArrayOfElements

	^ contentView pathIndexOf: anArrayOfElements'.
add value: #SpAbstractEasyTreeListViewPresenter value: #pathItemOf: value: 'private' value: 'pathItemOf: aPath
	"answer an array of items following a path. 
	 e.g. #(1 2 3) = { item1. item2. item3 }"

	^ contentView pathItemOf: aPath'.
#( #(SpEasyColumnViewPresenterTest #(testDisableActivationDuring testSetSortingBlockBeforeItems testSortingBlock))
  #(SpEasyListViewPresenterTest #(testDisableActivationDuring))
  #(SpEasyTreeColumnViewPresenterTest #(testDisableActivationDuring testPathIndexOf testPathItemOf))
  #(SpEasyTreeListViewPresenterTest #(testDisableActivationDuring testPathIndexOf testPathItemOf))) do: [ :p |
	(Smalltalk globals at: p first ifAbsent: [ nil ]) ifNotNil: [ :c |
		p last do: [ :s |
			((c includesSelector: s) and: [ ((c >> s) sourceCode includesSubstring: 'self skip') and: [ (c >> s) sourceCode size < 200 ] ]) ifTrue: [
				c removeSelector: s.
				Stdio stdout nextPutAll: 'REMOVED ', c name, '>>', s; lf; flush ] ] ] ].

State of 2026-11-20. Made from the test records of the iospharo project (a second Pharo VM). The fixes are proposals for review.