Pharo test defects

Package: Chanel (jecisc/Chanel, row 13)

State
Fixed (package repair)
Defect in
see the record
Tests
0
Fix
jecisc-chanel.st
Upstream repository
jecisc/Chanel

The record is the text of the repair. The Results table is the last run of the row.

Record

Test

Load the package into a Pharo 14 image (build 791) with the load expression of the test run, file in the fixes file of the row if there is one, and run the test classes of the package.

"row 13"
Metacello new baseline: 'Chanel'; repository: 'github://jecisc/Chanel:master/src'; onConflict: [:e | e useIncoming]; load: #('Core' 'Tests').

Results

Last result of the package run (stock Cog and iospharo on the same image).

RowLabelLoadStock Cogiospharo VM
13jecisc-chaneloktests=369 P=369 F=0 E=0 S=0 T=0 X=0tests=369 P=369 F=0 E=0 S=0 T=0 X=0

Fix

Fixes file (filed in after the load): jecisc-chanel.st (download)
"Chanel (jecisc/Chanel, master e5012fa).  Three defects, see docs/upstream/package-repairs.md.

1. ChanelAbstractCleanerTest: the test methods compile sources that use the
   variables test, test2, test3, test4, notTest and x without a declaration.
   Behavior>>compile:methodInstaller: of Pharo 14 sets permitUndeclared: false,
   so each compile fails with OCCompilationError.  The tests mean instance
   variables (testRemoveUselessInstanceVariableRead).  The classes and the
   traits that the test helpers create get the variables as slots.
2. OCMessageNode class>>superSendTo: (extension of Chanel) passes a Symbol
   to selector:, which takes an OCSelectorNode since Pharo 14.
3. RBNamespace>>renameClass:to:around: of Pharo 14 does not make the rename
   change the target of the changes that the block records.  This is a defect
   of the image, and its repair is scripts/image-fixes/31-rename-class-changes.st
   (1 test of ChanelTestCaseNameCleanerTest)."

fix value: #ChanelAbstractCleanerTest value: #createSubclassOf:named:
	value: [ :source | (source includesSubstring: 'slots:') not ]
	value:
'createSubclassOf: aClass named: aSymbol

	"Pharo 14 compiles without undeclared variables.  The test sources use these names as instance and class-side instance variables.  A subclass of a class of this helper has the variables from its superclass."
	| names |
	names := #(test test2 test3 test4 notTest x).
	^ aClass classInstaller make: [ :builder |
		  builder
			  superclass: aClass;
			  name: aSymbol;
			  slots: ((names reject: [ :each | aClass hasSlotNamed: each ]) collect: #asSlot);
			  classSlots: ((names reject: [ :each | aClass class hasSlotNamed: each ]) collect: #asSlot);
			  package: package name ]'.

fix value: #ChanelAbstractCleanerTest value: #createTraitNamed:
	value: [ :source | (source includesSubstring: 'slots:') not ]
	value:
'createTraitNamed: aSymbol

	"Pharo 14 compiles without undeclared variables.  A class that uses the trait gets the slots of the trait, so the class loses its own slots of the same names."
	| names trait |
	names := #(test test2 test3 test4 notTest x).
	trait := Trait classInstaller make: [ :builder |
		         builder
			         beTrait;
			         name: aSymbol;
			         slots: (names collect: #asSlot);
			         package: package name ].
	class ifNotNil: [
		class classInstaller update: class to: [ :builder |
			builder slots: (class localSlots reject: [ :each | names includes: each name ]) ] ].
	^ trait'.

fix value: #'OCMessageNode class' value: #superSendTo:
	value: [ :source | (source includesSubstring: 'OCSelectorNode') not ]
	value:
'superSendTo: aSelector
	^ self receiver: OCVariableNode superNode selector: (OCSelectorNode value: aSelector)'.

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