Pharo test defects

Package: FamixTagging (moosetechnology/FamixTagging, row 105)

State
Fixed (package repair)
Defect in
see the record
Tests
0
Fix
moosetechnology-famixtagging.st
Upstream repository
moosetechnology/FamixTagging

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 105"
Metacello new baseline: 'Famix'; repository: 'github://moosetechnology/Famix:development/src'; onConflict: [:e | e useIncoming]; load: #('Core' 'TestModels'). Metacello new baseline: 'FamixTagging'; repository: 'github://moosetechnology/FamixTagging:development/src'; onConflict: [:e | e useIncoming]; load: #('Tagging' 'TaggingTests').

Results

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

RowLabelLoadStock Cogiospharo VM
105moosetechnology-famixtaggingoktests=115 P=115 F=0 E=0 S=0 T=0 X=0tests=115 P=115 F=0 E=0 S=0 T=0 X=0

Fix

Fixes file (filed in after the load): moosetechnology-famixtagging.st (download)
"moosetechnology/FamixTagging (development), Pharo 14.  The load of the row does not bring in
Famix, so every test fails with UndeclaredVariableRead (the manifest row, not this file,
repairs the load: it loads the Famix baseline first, as the file .dependencies.st of the
repository does).  The two entries below are for the one test that the load repair leaves
open.

Entry 1 (FamixTag>>isLinkedTo:dependancyDirection:in:).  The test
FamixTaggingDependencyDetectorTest>>testProviderMethodToTags has the mark expectedFailure
and the comment 'client/provider methods are not tagged'.  The mark hides this defect: for an
entity E that is not a tag, MooseEntity>>isLinkedTo:dependancyDirection:in: looks at the
dependencies of E, of all children of E, and of the containers of those dependencies.  The tag
version looked only at the dependencies of the tagged entities at their own scope
(allProvidersAtMyScope or allClientsAtMyScope), and not at the children of the tagged
entities, and not at containers.  So a method m1 that calls method2 of the class Class2, with
Class2 tagged, was not a provider or a client in that tag, but the class Class1 of m1 was.  The
repair gives the tag the same levels as MooseEntity.

Entry 2 (FamixTaggingDependencyDetectorTest>>testProviderMethodToTags).  The same test
without the mark expectedFailure and without the flag TODO."

fix value: #FamixTag value: #isLinkedTo:dependancyDirection:in:
	value: [ :source | source includesSubstring: 'dependenciesAtReceiverScopeOf' ]
	value:
'isLinkedTo: aTagOrEntity dependancyDirection: aDirectionStrategy in: aMooseModel
	| dependencies |
	"The same levels as MooseEntity>>isLinkedTo:dependancyDirection:in: for each tagged entity: its own dependencies, the dependencies of all its children, and the containers of all of them."
	dependencies := Set new.
	(self allEntitiesRecursivelyIn: aMooseModel) do: [ :taggedEntity |
		| found |
		found := taggedEntity allChildrenDependenciesThrough: aDirectionStrategy.
		dependencies addAll: found.
		found do: [ :each | dependencies addAll: each allContainers ] ].

	"In the entity is a MooseEntity, with check if it is in its dependencies.
	If it is a tag, we look in the tags of its dependencies and the parents of those tags."
	^ (aTagOrEntity isTag
		ifTrue: [ dependencies flatCollectAsSet: [ :entity | entity tags , (entity tags flatCollect: #allParentTags) ] ]
		ifFalse: [ dependencies ]) includes: aTagOrEntity'.

fix value: #FamixTaggingDependencyDetectorTest value: #testProviderMethodToTags
	value: [ :source | source includesSubstring: 'expectedFailure' ]
	value:
'testProviderMethodToTags
	self createTags.
	self assert: (self m1 allProvidersIn: {self tag2}) size equals: 1.
	self assert: (self m1 allProvidersIn: {self compositeTag2}) size equals: 1'.

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