Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: only instantiate test resources once in Pharo #662

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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