Skip to content

Commit f92b18c

Browse files
committed
make use of activation target
Signed-off-by: Fira Curie <[email protected]>
1 parent a2ccae7 commit f92b18c

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/scalers/gitlab_runner/gitlab_runner_test.go

+9-6
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const (
3030
testName = "gitlab-runner-test"
3131
gitlabBaseURL = "https://gitlab.com"
3232

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\"]`
3434
)
3535

3636
var (
@@ -168,8 +168,8 @@ func TestScaler(t *testing.T) {
168168

169169
// test scaling Scaled Object
170170
KubectlApplyWithTemplate(t, data, "scaledObjectTemplate", scaledObjectTemplate)
171-
testActivation(t, kc)
172171

172+
testActivation(t, kc, projectID)
173173
testScaleOut(t, kc, projectID)
174174
testScaleIn(t, kc, projectID)
175175

@@ -196,7 +196,7 @@ func getTemplateData(projectID string) (templateData, []Template) {
196196
GitlabAPIURL: "https://gitlab.com",
197197
ProjectID: projectID,
198198
TargetPipelineQueueLength: "1",
199-
ActivationTargetPipelineQueueLength: "1",
199+
ActivationTargetPipelineQueueLength: "2",
200200
}, []Template{
201201
{Name: "secretTemplate", Config: secretTemplate},
202202
{Name: "authTemplate", Config: triggerAuthTemplate},
@@ -205,17 +205,20 @@ func getTemplateData(projectID string) (templateData, []Template) {
205205
}
206206
}
207207

208-
func testActivation(t *testing.T, kc *kubernetes.Clientset) {
208+
func testActivation(t *testing.T, kc *kubernetes.Clientset, projectID string) {
209209
t.Log("--- testing none activation ---")
210+
queueRun(t, projectID)
211+
210212
AssertReplicaCountNotChangeDuringTimePeriod(t, kc, deploymentName, testNamespace, minReplicaCount, 60)
211213
}
212214

213215
func testScaleOut(t *testing.T, kc *kubernetes.Clientset, projectID string) {
214216
t.Log("--- testing scale out ---")
215217
queueRun(t, projectID)
218+
queueRun(t, projectID)
216219

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")
219222
}
220223

221224
func testScaleIn(t *testing.T, kc *kubernetes.Clientset, projectID string) {

0 commit comments

Comments
 (0)