Feature Description
Current definition and capabilities of PLZ test runs are minimal in comparison to public GCk6 tests. We're going to polish it a bit, so that PLZ becomes more similar to other kinds of tests. Specifically:
- The
.spec.arguments definition should be expanded with some additional flags to k6 CLI: --no-summary, --verbose (TODO: clarify this one)
- User-defined env vars must be passed with
-e CLI flag
- The call to
/loadtests/v4/test_runs(%s)?$select=id,run_status,k8s_load_zones_config,k6_runtime_config must also include ,load_zone_distribution and the format of expected response is now this:
{
"k8s_load_zones_config": {
"instance_count": <int>,
"k6_archive_temp_public_url": <str>,
"load_runner_image": <str>,
"environment": <map>, # user-defined
"cli_flags": { # user-defined
"tags": <map>,
"user_agent": <str>,
"blacklist_ips": [<str>],
"blocked_hostnames": [<str>],
"include_system_env_variables": bool,
},
"gck6_env_vars": { # defined by GCk6
"K6_CLOUD_TOKEN": "token",
"K6_LOG_OUTPUT": "value",
},
},
load_zone_distribution: {
"label": {"loadZone": <str>, "percent": <int>}
}
cli_flags must all be passed to the .spec.arguments as k6 tags, --user-agent, --blacklist-ip and --block-hostnames CLI args respectively.
gck6_env_vars must be set as env vars for the runner
- NOTE:
K6_LOG_OUTPUT format is pending; we need to ensure we don't have a degradation here.
- As described here, we need to set 4 additional env vars as part of user-defined env vars, via
-e tag.
- three of them can be set as part of
.spec.arguments: K6_CLOUDRUN_LOAD_ZONE (taken from distribution field), K6_CLOUDRUN_DISTRIBUTION (also from distribution field?), K6_CLOUDRUN_TEST_RUN_ID.
- Additionally pass load zone value as
"load_zone" tag to .spec.arguments.
- the 4th env var,
K6_CLOUDRUN_INSTANCE_ID must be set at the level of k6 runner definition, because its value is not known until then. Consider the best implementation there + potential refactoring.
- Theses vars must be added on top of user-defined env vars: they have higher priority and should overwrite the values from the user if any.
Major change: K6_CLOUD_TOKEN added in the endpoint brings a new type of token to a PLZ - a test run specific token.
Suggested Solution (optional)
Most is self-explanatory. But as mentioned, there might also be small ways to improve / refactor some bits of code on the way.
Additionally, change with the token must be confirmed to be non-breaking for PLZ, as there wasn't a hard guarantee of it being non-breaking from GCk6 side.
Already existing or connected issues / PRs (optional)
No response
Feature Description
Current definition and capabilities of PLZ test runs are minimal in comparison to public GCk6 tests. We're going to polish it a bit, so that PLZ becomes more similar to other kinds of tests. Specifically:
.spec.argumentsdefinition should be expanded with some additional flags to k6 CLI:--no-summary,--verbose(TODO: clarify this one)-eCLI flag/loadtests/v4/test_runs(%s)?$select=id,run_status,k8s_load_zones_config,k6_runtime_configmust also include,load_zone_distributionand the format of expected response is now this:{ "k8s_load_zones_config": { "instance_count": <int>, "k6_archive_temp_public_url": <str>, "load_runner_image": <str>, "environment": <map>, # user-defined "cli_flags": { # user-defined "tags": <map>, "user_agent": <str>, "blacklist_ips": [<str>], "blocked_hostnames": [<str>], "include_system_env_variables": bool, }, "gck6_env_vars": { # defined by GCk6 "K6_CLOUD_TOKEN": "token", "K6_LOG_OUTPUT": "value", }, }, load_zone_distribution: { "label": {"loadZone": <str>, "percent": <int>} }cli_flagsmust all be passed to the.spec.argumentsas k6 tags,--user-agent,--blacklist-ipand--block-hostnamesCLI args respectively.gck6_env_varsmust be set as env vars for the runnerK6_LOG_OUTPUTformat is pending; we need to ensure we don't have a degradation here.-etag..spec.arguments:K6_CLOUDRUN_LOAD_ZONE(taken fromdistributionfield),K6_CLOUDRUN_DISTRIBUTION(also fromdistributionfield?),K6_CLOUDRUN_TEST_RUN_ID."load_zone"tag to.spec.arguments.K6_CLOUDRUN_INSTANCE_IDmust be set at the level of k6 runner definition, because its value is not known until then. Consider the best implementation there + potential refactoring.Major change:
K6_CLOUD_TOKENadded in the endpoint brings a new type of token to a PLZ - a test run specific token.Suggested Solution (optional)
Most is self-explanatory. But as mentioned, there might also be small ways to improve / refactor some bits of code on the way.
Additionally, change with the token must be confirmed to be non-breaking for PLZ, as there wasn't a hard guarantee of it being non-breaking from GCk6 side.
Already existing or connected issues / PRs (optional)
No response