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

Use testing facilities in Launchpad #187

Merged
merged 1 commit into from
Apr 22, 2024
Merged
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
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