Skip to content

Commit 5a2ee92

Browse files
authored
Merge pull request #662 from theseion/setup-test-resources-only-once
feat: only instantiate test resources once in Pharo
2 parents 0780adc + 51ea314 commit 5a2ee92

File tree

101 files changed

+434
-642
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+434
-642
lines changed

gtoolkit/run.sh

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,13 +176,19 @@ gtoolkit::load_project() {
176176
metacello := Metacello new
177177
baseline: 'SmalltalkCI';
178178
repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")';
179-
onUpgrade: [ :ex | ex useIncoming ].
179+
onUpgrade: [ :ex | ex useIncoming ];
180+
ignoreImage.
180181
(Metacello canUnderstand: #onConflictUseIncoming)
181182
ifTrue: [ metacello onConflictUseIncoming ]
182183
ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ].
183-
metacello load ]
184-
on: Warning
185-
do: [ :w | w resume ].
184+
([ Smalltalk at: #MetacelloIgnorePackageLoaded ]
185+
on: KeyNotFound
186+
do: [ :keyEx | keyEx resumeUnchecked: nil ])
187+
ifNil: [ metacello load ]
188+
ifNotNil: [ :exceptionClass |
189+
[ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ]
190+
on: Warning
191+
do: [ :w | w resume ].
186192
smalltalkCI := Smalltalk at: #SmalltalkCI.
187193
smalltalkCI load: '$(resolve_path "${config_ston}")'.
188194
(smalltalkCI isHeadless or: [ smalltalkCI promptToProceed ])
@@ -205,13 +211,19 @@ gtoolkit::test_project() {
205211
metacello := Metacello new
206212
baseline: 'SmalltalkCI';
207213
repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")';
208-
onUpgrade: [ :ex | ex useIncoming ].
214+
onUpgrade: [ :ex | ex useIncoming ];
215+
ignoreImage.
209216
(Metacello canUnderstand: #onConflictUseIncoming)
210217
ifTrue: [ metacello onConflictUseIncoming ]
211218
ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ].
212-
metacello load ]
213-
on: Warning
214-
do: [ :w | w resume ].
219+
([ Smalltalk at: #MetacelloIgnorePackageLoaded ]
220+
on: KeyNotFound
221+
do: [ :keyEx | keyEx resumeUnchecked: nil ])
222+
ifNil: [ metacello load ]
223+
ifNotNil: [ :exceptionClass |
224+
[ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ]
225+
on: Warning
226+
do: [ :w | w resume ].
215227
Smalltalk at: #SmalltalkCI ].
216228
smalltalkCI test: '$(resolve_path "${config_ston}")'
217229
"

pharo/run.sh

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,19 @@ pharo::load_project() {
367367
metacello := Metacello new
368368
baseline: 'SmalltalkCI';
369369
repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")';
370-
onUpgrade: [ :ex | ex useIncoming ].
370+
onUpgrade: [ :ex | ex useIncoming ];
371+
ignoreImage.
371372
(Metacello canUnderstand: #onConflictUseIncoming)
372373
ifTrue: [ metacello onConflictUseIncoming ]
373374
ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ].
374-
metacello load ]
375-
on: Warning
376-
do: [ :w | w resume ].
375+
([ Smalltalk at: #MetacelloIgnorePackageLoaded ]
376+
on: KeyNotFound
377+
do: [ :keyEx | keyEx resumeUnchecked: nil ])
378+
ifNil: [ metacello load ]
379+
ifNotNil: [ :exceptionClass |
380+
[ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ]
381+
on: Warning
382+
do: [ :w | w resume ].
377383
smalltalkCI := Smalltalk at: #SmalltalkCI.
378384
smalltalkCI load: '$(resolve_path "${config_ston}")'.
379385
(smalltalkCI isHeadless or: [ smalltalkCI promptToProceed ])
@@ -395,13 +401,19 @@ pharo::test_project() {
395401
metacello := Metacello new
396402
baseline: 'SmalltalkCI';
397403
repository: 'filetree://$(resolve_path "${SMALLTALK_CI_HOME}/repository")';
398-
onUpgrade: [ :ex | ex useIncoming ].
404+
onUpgrade: [ :ex | ex useIncoming ];
405+
ignoreImage.
399406
(Metacello canUnderstand: #onConflictUseIncoming)
400407
ifTrue: [ metacello onConflictUseIncoming ]
401408
ifFalse: [ metacello onConflict: [ :ex | ex useIncoming ] ].
402-
metacello load ]
403-
on: Warning
404-
do: [ :w | w resume ].
409+
([ Smalltalk at: #MetacelloIgnorePackageLoaded ]
410+
on: KeyNotFound
411+
do: [ :keyEx | keyEx resumeUnchecked: nil ])
412+
ifNil: [ metacello load ]
413+
ifNotNil: [ :exceptionClass |
414+
[ metacello load ] on: exceptionClass do: [ :ex | ex resume: true ] ] ]
415+
on: Warning
416+
do: [ :w | w resume ].
405417
Smalltalk at: #SmalltalkCI ].
406418
smalltalkCI test: '$(resolve_path "${config_ston}")'
407419
"
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2-
"noMethodMetaData" : true,
32
"separateMethodMetaAndSource" : false,
4-
"useCypressPropertiesFile" : true }
3+
"noMethodMetaData" : true,
4+
"useCypressPropertiesFile" : true
5+
}
File renamed without changes.

repository/SmalltalkCI-Pharo-Core.package/IceMetacelloPharoPlatform.extension/methodProperties.json

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
{
2-
"name" : "IceMetacelloPharoPlatform" }
2+
"name" : "IceMetacelloPharoPlatform"
3+
}

repository/SmalltalkCI-Pharo-Core.package/SCIPharoCustomScript.class/methodProperties.json

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
{
2-
"category" : "SmalltalkCI-Pharo-Core",
3-
"classinstvars" : [
4-
],
5-
"classvars" : [
6-
],
72
"commentStamp" : "",
8-
"instvars" : [
9-
],
10-
"name" : "SCIPharoCustomScript",
11-
"pools" : [
12-
],
133
"super" : "SCICustomScript",
14-
"type" : "normal" }
4+
"category" : "SmalltalkCI-Pharo-Core",
5+
"classinstvars" : [ ],
6+
"pools" : [ ],
7+
"classvars" : [ ],
8+
"instvars" : [ ],
9+
"name" : "SCIPharoCustomScript",
10+
"type" : "normal"
11+
}

repository/SmalltalkCI-Pharo-Core.package/SCIPharoMetacelloLoadSpec.class/methodProperties.json

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
{
2-
"category" : "SmalltalkCI-Pharo-Core",
3-
"classinstvars" : [
4-
],
5-
"classvars" : [
6-
],
72
"commentStamp" : "",
8-
"instvars" : [
9-
"registerInIceberg"
10-
],
11-
"name" : "SCIPharoMetacelloLoadSpec",
12-
"pools" : [
13-
],
143
"super" : "SCIMetacelloLoadSpec",
15-
"type" : "normal" }
4+
"category" : "SmalltalkCI-Pharo-Core",
5+
"classinstvars" : [ ],
6+
"pools" : [ ],
7+
"classvars" : [ ],
8+
"instvars" : [
9+
"registerInIceberg"
10+
],
11+
"name" : "SCIPharoMetacelloLoadSpec",
12+
"type" : "normal"
13+
}

0 commit comments

Comments
 (0)