Skip to content

Commit 724e1c5

Browse files
committed
add skip create workspaces option
1 parent 1236b93 commit 724e1c5

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

scaletest/templates/scaletest-runner/main.tf

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,18 @@ data "coder_parameter" "num_workspaces" {
235235
}
236236
}
237237

238+
data "coder_parameter" "skip_create_workspaces" {
239+
order = 22
240+
type = "bool"
241+
name = "DEBUG: Skip creating workspaces"
242+
default = false
243+
description = "Skip creating workspaces (for resuming failed scaletests or debugging)"
244+
mutable = true
245+
}
246+
238247

239248
data "coder_parameter" "load_scenarios" {
240-
order = 22
249+
order = 23
241250
name = "Load Scenarios"
242251
type = "list(string)"
243252
description = "The load scenarios to run."
@@ -252,7 +261,7 @@ data "coder_parameter" "load_scenarios" {
252261
}
253262

254263
data "coder_parameter" "load_scenario_run_concurrently" {
255-
order = 23
264+
order = 24
256265
name = "Run Load Scenarios Concurrently"
257266
type = "bool"
258267
default = false
@@ -261,7 +270,7 @@ data "coder_parameter" "load_scenario_run_concurrently" {
261270
}
262271

263272
data "coder_parameter" "load_scenario_concurrency_staggering" {
264-
order = 23
273+
order = 25
265274
name = "Load Scenario Concurrency Staggering"
266275
type = "number"
267276
default = 3
@@ -581,6 +590,7 @@ resource "coder_agent" "main" {
581590
SCALETEST_PARAM_TEMPLATE : data.coder_parameter.workspace_template.value,
582591
SCALETEST_PARAM_REPO_BRANCH : data.coder_parameter.repo_branch.value,
583592
SCALETEST_PARAM_NUM_WORKSPACES : data.coder_parameter.num_workspaces.value,
593+
SCALETEST_PARAM_SKIP_CREATE_WORKSPACES : data.coder_parameter.skip_create_workspaces.value ? "1" : "0",
584594
SCALETEST_PARAM_CREATE_CONCURRENCY : "${data.coder_parameter.create_concurrency.value}",
585595
SCALETEST_PARAM_CLEANUP_STRATEGY : data.coder_parameter.cleanup_strategy.value,
586596
SCALETEST_PARAM_CLEANUP_PREPARE : data.coder_parameter.cleanup_prepare.value ? "1" : "0",

scaletest/templates/scaletest-runner/scripts/run.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,17 @@ log "Running scaletest..."
1313
set_status Running
1414

1515
start_phase "Creating workspaces"
16-
coder exp scaletest create-workspaces \
17-
--count "${SCALETEST_PARAM_NUM_WORKSPACES}" \
18-
--template "${SCALETEST_PARAM_TEMPLATE}" \
19-
--concurrency "${SCALETEST_PARAM_CREATE_CONCURRENCY}" \
20-
--timeout 5h \
21-
--job-timeout 5h \
22-
--no-cleanup \
23-
--output json:"${SCALETEST_RESULTS_DIR}/create-workspaces.json"
24-
show_json "${SCALETEST_RESULTS_DIR}/create-workspaces.json"
16+
if [[ ${SCALETEST_PARAM_SKIP_CREATE_WORKSPACES} == 0 ]]; then
17+
coder exp scaletest create-workspaces \
18+
--count "${SCALETEST_PARAM_NUM_WORKSPACES}" \
19+
--template "${SCALETEST_PARAM_TEMPLATE}" \
20+
--concurrency "${SCALETEST_PARAM_CREATE_CONCURRENCY}" \
21+
--timeout 5h \
22+
--job-timeout 5h \
23+
--no-cleanup \
24+
--output json:"${SCALETEST_RESULTS_DIR}/create-workspaces.json"
25+
show_json "${SCALETEST_RESULTS_DIR}/create-workspaces.json"
26+
fi
2527
end_phase
2628

2729
wait_baseline "${SCALETEST_PARAM_LOAD_SCENARIO_BASELINE_DURATION}"

0 commit comments

Comments
 (0)