Skip to content

Commit

Permalink
Merge pull request #187 from ba-st/fix_tests
Browse files Browse the repository at this point in the history
Use testing facilities in Launchpad
  • Loading branch information
gcotelli authored Apr 22, 2024
2 parents e60ad9e + 2388c66 commit 37dfd2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 34 deletions.
5 changes: 3 additions & 2 deletions source/BaselineOfStargate/BaselineOfStargate.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ BaselineOfStargate >> setUpDependencies: spec [

spec
baseline: 'Launchpad' with: [ spec repository: 'github://ba-st/Launchpad:v5' ];
project: 'Launchpad-Deployment' copyFrom: 'Launchpad' with: [ spec loads: 'Deployment' ]
project: 'Launchpad-Deployment' copyFrom: 'Launchpad' with: [ spec loads: 'Deployment' ];
project: 'Launchpad-SUnit' copyFrom: 'Launchpad' with: [ spec loads: 'Dependent-SUnit-Extensions' ]
]

{ #category : 'baselines' }
Expand Down Expand Up @@ -228,7 +229,7 @@ BaselineOfStargate >> setUpTestPackages: spec [
group: 'Tests' with: 'Stargate-JSON-RPC-Tests'.
spec
package: 'Stargate-API-Skeleton-Tests'
with: [ spec requires: #( 'Dependent-SUnit-Extensions' 'Stargate-Examples' 'Hyperspace-SUnit' ) ];
with: [ spec requires: #( 'Dependent-SUnit-Extensions' 'Stargate-Examples' 'Hyperspace-SUnit' 'Launchpad-SUnit' ) ];
group: 'Tests' with: 'Stargate-API-Skeleton-Tests'.
spec
package: 'Stargate-Examples-Tests'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ A StargateAPISkeletonTest is a test class for testing the behavior of StargateAP
"
Class {
#name : 'StargateApplicationTest',
#superclass : 'TestCase',
#superclass : 'LaunchpadTest',
#instVars : [
'application',
'port',
'baseUrl'
],
Expand Down Expand Up @@ -76,12 +75,6 @@ StargateApplicationTest >> run: count concurrentInstancesOf: block [
^ results
]

{ #category : 'running' }
StargateApplicationTest >> runCase [

self shouldnt: [ super runCase ] raise: Exit
]

{ #category : 'private' }
StargateApplicationTest >> secret [

Expand All @@ -96,26 +89,6 @@ StargateApplicationTest >> setUp [
StargateApplication logsDirectory ensureCreateDirectory
]

{ #category : 'private' }
StargateApplicationTest >> start: aLaunchpadApplication withAll: arguments [

String streamContents: [ :stream |
| context rootCommand |


rootCommand := LaunchpadRootCommand new.
context := LaunchpadCommandLineProcessingContext
handling: ( CommandLineArguments withArguments: {
'launchpad'.
'start'.
aLaunchpadApplication commandName } , arguments )
writingTo: stream.
self assert: ( rootCommand canHandle: ( context nextCommandLineArgumentIfNone: [ self fail ] ) ).
rootCommand evaluateWithin: context.
application := LaunchpadApplication currentlyRunning
]
]

{ #category : 'private' }
StargateApplicationTest >> startConcurrentConnectionsApp [

Expand All @@ -124,7 +97,7 @@ StargateApplicationTest >> startConcurrentConnectionsApp [
'--stargate.port=<1p>' expandMacrosWith: port.
'--stargate.operations-secret=<1s>' expandMacrosWith: self secret.
'--stargate.concurrent-connections-threshold=1' }.
baseUrl := application configuration stargate publicURL
baseUrl := runningApplication configuration stargate publicURL
]

{ #category : 'private' }
Expand All @@ -134,7 +107,7 @@ StargateApplicationTest >> startPetStore [
'--pet-store.stargate.public-url=http://localhost:<1p>' expandMacrosWith: port.
'--pet-store.stargate.port=<1p>' expandMacrosWith: port.
'--pet-store.stargate.operations-secret=<1s>' expandMacrosWith: self secret }.
baseUrl := application configuration petStore stargate publicURL
baseUrl := runningApplication configuration petStore stargate publicURL
]

{ #category : 'private' }
Expand All @@ -144,13 +117,12 @@ StargateApplicationTest >> startSouthAmericanCurrencies [
'--stargate.public-url=http://localhost:<1p>' expandMacrosWith: port.
'--stargate.port=<1p>' expandMacrosWith: port.
'--stargate.operations-secret=<1s>' expandMacrosWith: self secret }.
baseUrl := application configuration stargate publicURL
baseUrl := runningApplication configuration stargate publicURL
]

{ #category : 'running' }
StargateApplicationTest >> tearDown [

application ifNotNil: [ :theApplication | theApplication stop ].
ZnOptions resetGlobalDefault.
super tearDown
]
Expand Down

0 comments on commit 37dfd2d

Please sign in to comment.