From b183865b327b174173eb93a2f7e113b03ac86d8f Mon Sep 17 00:00:00 2001 From: okmtz Date: Mon, 15 Jan 2024 11:35:08 +0900 Subject: [PATCH 1/3] fix sample base_manifest.yaml parallelism value type --- config/base_manifest.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/base_manifest.yaml b/config/base_manifest.yaml index 9d2cd7f..5acd99b 100644 --- a/config/base_manifest.yaml +++ b/config/base_manifest.yaml @@ -40,7 +40,7 @@ spec: provider: "slack" secretName: "gatling-notification-slack-secrets" testScenarioSpec: - parallelism: # will be overrided by services[].scenarioSpecs[].testScenarioSpec.parallelism field value. ex: 1 + parallelism: 1 # # will be overrided by services[].scenarioSpecs[].testScenarioSpec.parallelism field value. ex: 1 simulationClass: # will be overrided by services[].scenarioSpecs[].testScenarioSpec.simulationClass field value. ex: SampleSimulation env: # will be overrided by services[].scenarioSpecs[].testScenarioSpec.env[] field value. ex: `env: [{name: ENV, value: "dev"}, {name: CONCURRENCY, value: "20"}]` - name: From fd0a81e98f79ba47b26ddb1337e2ea812820d0ca Mon Sep 17 00:00:00 2001 From: okmtz Date: Mon, 15 Jan 2024 11:35:31 +0900 Subject: [PATCH 2/3] fix base_manifest.yaml parallelism field type --- docs/quickstart-guide.jp.md | 2 +- docs/quickstart-guide.md | 2 +- docs/user-guide.jp.md | 11 ++++++++--- docs/user-guide.md | 9 +++++++-- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/quickstart-guide.jp.md b/docs/quickstart-guide.jp.md index 31bd05e..d9a8899 100644 --- a/docs/quickstart-guide.jp.md +++ b/docs/quickstart-guide.jp.md @@ -173,7 +173,7 @@ spec: provider: "slack" secretName: "gatling-notification-slack-secrets" testScenarioSpec: - parallelism: # will be overrided by services[].scenarioSpecs[].testScenarioSpec.parallelism field value. ex: 1 + parallelism: 1 # # will be overrided by services[].scenarioSpecs[].testScenarioSpec.parallelism field value. ex: 1 simulationClass: # will be overrided by services[].scenarioSpecs[].testScenarioSpec.simulationClass field value. ex: SampleSimulation env: # will be overrided by services[].scenarioSpecs[].testScenarioSpec.env[] field value. ex: `env: [{name: ENV, value: "dev"}, {name: CONCURRENCY, value: "20"}]` - name: diff --git a/docs/quickstart-guide.md b/docs/quickstart-guide.md index 72fed67..a94c532 100644 --- a/docs/quickstart-guide.md +++ b/docs/quickstart-guide.md @@ -173,7 +173,7 @@ spec: provider: "slack" secretName: "gatling-notification-slack-secrets" testScenarioSpec: - parallelism: # will be overrided by services[].scenarioSpecs[].testScenarioSpec.parallelism field value. ex: 1 + parallelism: 1 # # will be overrided by services[].scenarioSpecs[].testScenarioSpec.parallelism field value. ex: 1 simulationClass: # will be overrided by services[].scenarioSpecs[].testScenarioSpec.simulationClass field value. ex: SampleSimulation env: # will be overrided by services[].scenarioSpecs[].testScenarioSpec.env[] field value. ex: `env: [{name: ENV, value: "dev"}, {name: CONCURRENCY, value: "20"}]` - name: diff --git a/docs/user-guide.jp.md b/docs/user-guide.jp.md index d21a092..8ec83c8 100644 --- a/docs/user-guide.jp.md +++ b/docs/user-guide.jp.md @@ -96,9 +96,14 @@ serviceは同一の負荷試験対象に関する1つ以上の負荷試験シナ `base_manifest.yaml`にはGatlingリソースのKubernetesマニフェストのうち、負荷試験ごとに共通する値を設定するフィールドを記述します。 GatlingリソースのKubernetesマニフェストのフィールドについては、[Gatling OperatorのAPI Reference](https://github.com/st-tech/gatling-operator/blob/main/docs/api.md#gatling)を参照してください。 -`base_manifest.yaml`に``と記載があるフィールドは、負荷試験ごとに異なる値が設定されます。 -これらのフィールドの値は、Gatling Commanderの実行時に`config.yaml`の値でそれぞれ置き換えられます。 -そのため、`base_manifest.yaml`での値の変更は不要です。 +`base_manifest.yaml`に``と記載があるフィールドは、負荷試験ごとに異なる値が設定されます。これらのフィールドの値は、Gatling Commanderの実行時に`config.yaml`の値でそれぞれ置き換えられます。そのため、`base_manifest.yaml`での値の変更は不要です。 + +※ Gatling Commanderは`base_manifest.yaml`の値を`config.yaml`の値で置き換える前に、一度GoのGatling構造体のオブジェクトにその値を読み込みます。そのため、`base_manifest.yaml`の各フィールドの値の型はGatling構造体の各フィールドの値の型と一致する必要があります。型が一致しない場合次のようなエラーが発生します。 + +```go +json: cannot unmarshal string into Go struct field TestScenarioSpec.spec.testScenarioSpec.parallelism of type int32 +``` + `base_manifest.yaml`のうち、`config.yaml`の値で置き換えられるフィールドについて説明します。 diff --git a/docs/user-guide.md b/docs/user-guide.md index 3b5d548..90df507 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -27,8 +27,13 @@ Configuration values for the load test are written in `config/config.yaml`. The `base_manifest.yaml` describes the common values for each load test in the Kubernetes manifest of the Gatling Resource. -Fields marked `` in `base_manifest.yaml` are set to different values for each load test. The value of this field will be replaced by the value in `config.yaml` respectively when Gatling Commander runs. -Therefore, setting values to fields marked `` in `base_manifest.yaml` is not necessary. +Fields marked `` in `base_manifest.yaml` are set to different values for each load test. The value of this field will be replaced by the value in `config.yaml` respectively when Gatling Commander runs. Therefore, setting values to fields marked `` in `base_manifest.yaml` is not necessary. + +\* Gatling Commander once loads `base_manifest.yaml` value to Gatling struct object before it replaces the value by `config.yaml`. So the type of `base_manifest.yaml` field value must be matched to Gatling struct field one. If type not match, an error like following error will be occured. + +```go +json: cannot unmarshal string into Go struct field TestScenarioSpec.spec.testScenarioSpec.parallelism of type int32 +``` The location and file name of `config.yaml` and `base_manifest.yaml` can be any value. For the `config.yaml` path, specify the value of the `--config` option when executing the command. From ef39d804cf9d8924bffbe66d7ce385595cf91724 Mon Sep 17 00:00:00 2001 From: okmtz <54773770+okmtz@users.noreply.github.com> Date: Mon, 15 Jan 2024 12:18:50 +0900 Subject: [PATCH 3/3] Update docs/user-guide.md Co-authored-by: kayamin --- docs/user-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/user-guide.md b/docs/user-guide.md index 90df507..3f9c118 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -29,7 +29,7 @@ The `base_manifest.yaml` describes the common values for each load test in the K Fields marked `` in `base_manifest.yaml` are set to different values for each load test. The value of this field will be replaced by the value in `config.yaml` respectively when Gatling Commander runs. Therefore, setting values to fields marked `` in `base_manifest.yaml` is not necessary. -\* Gatling Commander once loads `base_manifest.yaml` value to Gatling struct object before it replaces the value by `config.yaml`. So the type of `base_manifest.yaml` field value must be matched to Gatling struct field one. If type not match, an error like following error will be occured. +\* Gatling Commander once loads `base_manifest.yaml` value to Gatling struct object before it replaces the value by `config.yaml`. So the type of `base_manifest.yaml` field value must be matched to Gatling struct field one. If type not match, an error like following occur. ```go json: cannot unmarshal string into Go struct field TestScenarioSpec.spec.testScenarioSpec.parallelism of type int32