hpi-swa / smalltalkCI

Framework for testing Smalltalk projects with GitHub Actions, GitLab CI, Travis CI, AppVeyor, and others.
MIT License
96 stars 68 forks source link

Testing including coverage is failing on Pharo 8 and 10 builds #576

Closed gcotelli closed 2 years ago

gcotelli commented 2 years ago

Appears to be working for Pharo 9. For more details check the log of the failing builds here

Heres, there's a stack trace of the error:

Testing project...
Instance of CompiledMethod did not understand #actualClass
CompiledMethod(Object)>>doesNotUnderstand: #actualClass
SCICoverageWrapper>>install
[ :each | each install ] in SCICodeCoverage>>startUp in Block: [ :each | each install ]
OrderedCollection>>do:
SCIPharoCodeCoverage(SCICodeCoverage)>>startUp
SCIPharoCodeCoverage>>startUp
SCIPharoCodeCoverage(SCICodeCoverage)>>run:
SCIPharoCodeCoverage class(SCICodeCoverage class)>>run:spec:in:
[
            self prepareForTesting.
            self executionClass
                run: [ runner := self runTests ]
                spec: self spec
                in: self projectDirectory.
            self finishUpAfterTesting ] in SmalltalkCIPharo10(SmalltalkCI)>>basicTest in Block: [...
[ aBlock value ] in SmalltalkCIPharo10 class(SmalltalkCI class)>>fold:on:block: in Block: [ aBlock value ]
Time class>>microsecondsToRun:
Time class>>millisecondsToRun:
SmalltalkCI class>>timeToRun:
SmalltalkCIPharo10 class(SmalltalkCI class)>>fold:on:block:
SmalltalkCIPharo10 class(SmalltalkCI class)>>fold:block:
SmalltalkCIPharo10 class(SmalltalkCI class)>>stage:id:block:
SmalltalkCIPharo10(SmalltalkCI)>>basicTest
[ self basicTest ] in [
        [ self basicTest ] on: SCIError do: [ :e | 
            hasThrownError := true.
            "Create new error, GemStone does not allow to signal an exception twice"
            SCIError signal: e messageText ]] in SmalltalkCIPharo10(SmalltalkCI)>>test in Block: [ self basicTest ]
FullBlockClosure(BlockClosure)>>on:do:
[
        [ self basicTest ] on: SCIError do: [ :e | 
            hasThrownError := true.
            "Create new error, GemStone does not allow to signal an exception twice"
            SCIError signal: e messageText ]] in SmalltalkCIPharo10(SmalltalkCI)>>test in Block: [...
[ self ensureNoExistingBuildStatusFile.
     aBlock value.
     self reportBuildSuccess ] in SmalltalkCIPharo10 class(SmalltalkCI class)>>withBuildStatusReportingDo: in Block: [ self ensureNoExistingBuildStatusFile....
FullBlockClosure(BlockClosure)>>on:do:
SmalltalkCIPharo10 class(SmalltalkCI class)>>withBuildStatusReportingDo:
SmalltalkCIPharo10(SmalltalkCI)>>test
SmalltalkCI class>>test:projectDirectory:
SmalltalkCI class>>test:
UndefinedObject>>DoIt
[ receiver withArgs: (context ifNil: [ #() ] ifNotNil: [ {context} ]) executeMethod: self compileDoit] in OpalCompiler>>evaluate in Block: [ receiver withArgs: (context ifNil: [ #() ] ifNot...etc...
FullBlockClosure(BlockClosure)>>on:do:
OpalCompiler>>evaluate
gcotelli commented 2 years ago

Probably related to changes in v3.0.1

fniephaus commented 2 years ago

@LinqLover can you take a look at this please? we need to fix this asap, otherwise I'll have to roll back the coverage updates.

LinqLover commented 2 years ago

Sorry for the inconvenience! This marks a gap in our CI tests. I'm working on a fix.

fniephaus commented 2 years ago

Thank you! :)

gcotelli commented 2 years ago

I think part of the problem is that extensionMethodsForPackages in Pharo is returning instances of CompiledMethod but for non-extension methods it is using the class method methodReferenceFor:selector:. Maybe reimplementing

extensionMethodsForPackages
    ^ super extensionMethodsForPackages
        collect: [ :method | 
            self class
                methodReferenceFor: method methodClass
                selector: method selector ]

for Pharo helps

gcotelli commented 2 years ago

I can easily test the changes against the problematic code base so let me know when we have some branch to test and I can help with that

LinqLover commented 2 years ago

Thank you! Let's see whether #577 passes on the CI. If yes, it should also work on your system, I think. :)