@@ -30,7 +30,7 @@ const (
30
30
testName = "gitlab-runner-test"
31
31
gitlabBaseURL = "https://gitlab.com"
32
32
33
- ciFileContent = `stages: [deploy]\ndeploy-job:\n stage: deploy\n script: [\"sleep 15 \"]`
33
+ ciFileContent = `stages: [deploy]\ndeploy-job:\n stage: deploy\n script: [\"sleep 90 \"]`
34
34
)
35
35
36
36
var (
@@ -168,8 +168,8 @@ func TestScaler(t *testing.T) {
168
168
169
169
// test scaling Scaled Object
170
170
KubectlApplyWithTemplate (t , data , "scaledObjectTemplate" , scaledObjectTemplate )
171
- testActivation (t , kc )
172
171
172
+ testActivation (t , kc , projectID )
173
173
testScaleOut (t , kc , projectID )
174
174
testScaleIn (t , kc , projectID )
175
175
@@ -196,7 +196,7 @@ func getTemplateData(projectID string) (templateData, []Template) {
196
196
GitlabAPIURL : "https://gitlab.com" ,
197
197
ProjectID : projectID ,
198
198
TargetPipelineQueueLength : "1" ,
199
- ActivationTargetPipelineQueueLength : "1 " ,
199
+ ActivationTargetPipelineQueueLength : "2 " ,
200
200
}, []Template {
201
201
{Name : "secretTemplate" , Config : secretTemplate },
202
202
{Name : "authTemplate" , Config : triggerAuthTemplate },
@@ -205,17 +205,20 @@ func getTemplateData(projectID string) (templateData, []Template) {
205
205
}
206
206
}
207
207
208
- func testActivation (t * testing.T , kc * kubernetes.Clientset ) {
208
+ func testActivation (t * testing.T , kc * kubernetes.Clientset , projectID string ) {
209
209
t .Log ("--- testing none activation ---" )
210
+ queueRun (t , projectID )
211
+
210
212
AssertReplicaCountNotChangeDuringTimePeriod (t , kc , deploymentName , testNamespace , minReplicaCount , 60 )
211
213
}
212
214
213
215
func testScaleOut (t * testing.T , kc * kubernetes.Clientset , projectID string ) {
214
216
t .Log ("--- testing scale out ---" )
215
217
queueRun (t , projectID )
218
+ queueRun (t , projectID )
216
219
217
- assert .True (t , WaitForDeploymentReplicaReadyCount (t , kc , deploymentName , testNamespace , maxReplicaCount , 60 , 1 ),
218
- "replica count should be 1 after 1 minute" )
220
+ assert .True (t , WaitForDeploymentReplicaReadyCount (t , kc , deploymentName , testNamespace , maxReplicaCount , 60 , 2 ),
221
+ "replica count should be 2 after 1 minute" )
219
222
}
220
223
221
224
func testScaleIn (t * testing.T , kc * kubernetes.Clientset , projectID string ) {
0 commit comments