Skip to content

Commit

Permalink
Merge pull request #662 from theseion/setup-test-resources-only-once
Browse files Browse the repository at this point in the history
feat: only instantiate test resources once in Pharo
  • Loading branch information
theseion authored Sep 22, 2024
2 parents 0780adc + 51ea314 commit 5a2ee92
Show file tree
Hide file tree
Showing 101 changed files with 434 additions and 642 deletions.
28 changes: 20 additions & 8 deletions gtoolkit/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,19 @@ gtoolkit::load_project() {
metacello := Metacello new
baseline: 'SmalltalkCI';
repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")';
onUpgrade: [ :ex | ex useIncoming ].
onUpgrade: [ :ex | ex useIncoming ];
ignoreImage.
(Metacello canUnderstand: #onConflictUseIncoming)
ifTrue: [ metacello onConflictUseIncoming ]
ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ].
metacello load ]
on: Warning
do: [ :w | w resume ].
([ Smalltalk at: #MetacelloIgnorePackageLoaded ]
on: KeyNotFound
do: [ :keyEx | keyEx resumeUnchecked: nil ])
ifNil: [ metacello load ]
ifNotNil: [ :exceptionClass |
[ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ]
on: Warning
do: [ :w | w resume ].
smalltalkCI := Smalltalk at: #SmalltalkCI.
smalltalkCI load: '$(resolve_path "${config_ston}")'.
(smalltalkCI isHeadless or: [ smalltalkCI promptToProceed ])
Expand All @@ -205,13 +211,19 @@ gtoolkit::test_project() {
metacello := Metacello new
baseline: 'SmalltalkCI';
repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")';
onUpgrade: [ :ex | ex useIncoming ].
onUpgrade: [ :ex | ex useIncoming ];
ignoreImage.
(Metacello canUnderstand: #onConflictUseIncoming)
ifTrue: [ metacello onConflictUseIncoming ]
ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ].
metacello load ]
on: Warning
do: [ :w | w resume ].
([ Smalltalk at: #MetacelloIgnorePackageLoaded ]
on: KeyNotFound
do: [ :keyEx | keyEx resumeUnchecked: nil ])
ifNil: [ metacello load ]
ifNotNil: [ :exceptionClass |
[ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ]
on: Warning
do: [ :w | w resume ].
Smalltalk at: #SmalltalkCI ].
smalltalkCI test: '$(resolve_path "${config_ston}")'
"
Expand Down
28 changes: 20 additions & 8 deletions pharo/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -367,13 +367,19 @@ pharo::load_project() {
metacello := Metacello new
baseline: 'SmalltalkCI';
repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")';
onUpgrade: [ :ex | ex useIncoming ].
onUpgrade: [ :ex | ex useIncoming ];
ignoreImage.
(Metacello canUnderstand: #onConflictUseIncoming)
ifTrue: [ metacello onConflictUseIncoming ]
ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ].
metacello load ]
on: Warning
do: [ :w | w resume ].
([ Smalltalk at: #MetacelloIgnorePackageLoaded ]
on: KeyNotFound
do: [ :keyEx | keyEx resumeUnchecked: nil ])
ifNil: [ metacello load ]
ifNotNil: [ :exceptionClass |
[ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ]
on: Warning
do: [ :w | w resume ].
smalltalkCI := Smalltalk at: #SmalltalkCI.
smalltalkCI load: '$(resolve_path "${config_ston}")'.
(smalltalkCI isHeadless or: [ smalltalkCI promptToProceed ])
Expand All @@ -395,13 +401,19 @@ pharo::test_project() {
metacello := Metacello new
baseline: 'SmalltalkCI';
repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")';
onUpgrade: [ :ex | ex useIncoming ].
onUpgrade: [ :ex | ex useIncoming ];
ignoreImage.
(Metacello canUnderstand: #onConflictUseIncoming)
ifTrue: [ metacello onConflictUseIncoming ]
ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ].
metacello load ]
on: Warning
do: [ :w | w resume ].
([ Smalltalk at: #MetacelloIgnorePackageLoaded ]
on: KeyNotFound
do: [ :keyEx | keyEx resumeUnchecked: nil ])
ifNil: [ metacello load ]
ifNotNil: [ :exceptionClass |
[ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ]
on: Warning
do: [ :w | w resume ].
Smalltalk at: #SmalltalkCI ].
smalltalkCI test: '$(resolve_path "${config_ston}")'
"
Expand Down
5 changes: 3 additions & 2 deletions repository/SmalltalkCI-Pharo-Core.package/.filetree
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"noMethodMetaData" : true,
"separateMethodMetaAndSource" : false,
"useCypressPropertiesFile" : true }
"noMethodMetaData" : true,
"useCypressPropertiesFile" : true
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
{
"name" : "IceMetacelloPharoPlatform" }
"name" : "IceMetacelloPharoPlatform"
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"category" : "SmalltalkCI-Pharo-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "SCIPharoCustomScript",
"pools" : [
],
"super" : "SCICustomScript",
"type" : "normal" }
"category" : "SmalltalkCI-Pharo-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "SCIPharoCustomScript",
"type" : "normal"
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
{
"category" : "SmalltalkCI-Pharo-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"registerInIceberg"
],
"name" : "SCIPharoMetacelloLoadSpec",
"pools" : [
],
"super" : "SCIMetacelloLoadSpec",
"type" : "normal" }
"category" : "SmalltalkCI-Pharo-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [
"registerInIceberg"
],
"name" : "SCIPharoMetacelloLoadSpec",
"type" : "normal"
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"category" : "SmalltalkCI-Pharo-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "SCIPharoMonticelloLoadSpec",
"pools" : [
],
"super" : "SCIMonticelloLoadSpec",
"type" : "normal" }
"category" : "SmalltalkCI-Pharo-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "SCIPharoMonticelloLoadSpec",
"type" : "normal"
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
running
runClasses: aCollectionOfClasses spec: aSCISpec
| suite classes |
suite := TestSuite named: aSCISpec name.
classes := (aCollectionOfClasses
select: [ :each | (each includesBehavior: TestCase) and: [ each isAbstract not ] ])
asSortedCollection: [ :a :b | a name <= b name ].
classes
do: [ :each | suite addTest: each suite ].
^ self runSuite: suite spec: aSCISpec

| suite classes resources |
suite := TestSuite named: aSCISpec name.
classes := (aCollectionOfClasses select: [ :each |
(each includesBehavior: TestCase) and: [
each isAbstract not ] ]) asSortedCollection: [ :a :b |
a name <= b name ].

resources := OrderedCollection new.
classes do: [ :class |
| classSuite |
classSuite := class suite.
resources addAll: (classSuite resources reject: [ :resource |
resources includes: resource ]).
"Reset resources of nested suit. Resources are managed by the outermost suite."
classSuite resources: #( ).
suite addTest: classSuite ].

suite resources: resources.

^ self runSuite: suite spec: aSCISpec

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"category" : "SmalltalkCI-Pharo-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "SCIPharoTestRunner",
"pools" : [
],
"super" : "SCITestRunner",
"type" : "normal" }
"category" : "SmalltalkCI-Pharo-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "SCIPharoTestRunner",
"type" : "normal"
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"category" : "SmalltalkCI-Pharo-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
],
"name" : "SCIPharoTestRunnerPharo10",
"pools" : [
],
"super" : "SCIPharoTestRunnerPharo9",
"type" : "normal" }
"category" : "SmalltalkCI-Pharo-Core",
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [ ],
"instvars" : [ ],
"name" : "SCIPharoTestRunnerPharo10",
"type" : "normal"
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"commentStamp" : "",
"super" : "SmalltalkCI",
"category" : "SmalltalkCI-Pharo-Core",
"classinstvars" : [
],
"classinstvars" : [ ],
"pools" : [ ],
"classvars" : [
"StdOut" ],
"commentStamp" : "",
"StdOut"
],
"instvars" : [
"suiteName" ],
"suiteName"
],
"name" : "SmalltalkCIPharo",
"pools" : [
],
"super" : "SmalltalkCI",
"type" : "normal" }
"type" : "normal"
}
Loading

0 comments on commit 5a2ee92

Please sign in to comment.