Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[az][load] bug fixes on kvrefid splitcsv & terminal state #8297

Merged
merged 6 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/load/azext_load/data_plane/load_test/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ def create_test(
raise InvalidArgumentValueError(msg)
body = {}
yaml, yaml_test_body = None, None
if split_csv is None:
mbhardwaj-msft marked this conversation as resolved.
Show resolved Hide resolved
split_csv = False
if load_test_config_file is None:
body = create_or_update_test_without_config(
test_id,
Expand Down
10 changes: 7 additions & 3 deletions src/load/azext_load/data_plane/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ def convert_yaml_to_test(data):
if "description" in data:
new_body["description"] = data["description"]
new_body["keyvaultReferenceIdentityType"] = IdentityType.SystemAssigned
if "keyvaultReferenceIdentityId" in data:
new_body["keyvaultReferenceIdentityId"] = data["keyvaultReferenceIdentityId"]
if "keyVaultReferenceIdentity" in data:
mbhardwaj-msft marked this conversation as resolved.
Show resolved Hide resolved
new_body["keyvaultReferenceIdentityId"] = data["keyVaultReferenceIdentity"]
new_body["keyvaultReferenceIdentityType"] = IdentityType.UserAssigned

if "subnetId" in data:
Expand All @@ -310,6 +310,10 @@ def convert_yaml_to_test(data):
"Quick start test is not supported currently in CLI. Please use portal to run quick start test"
)
if data.get("splitAllCSVs") is not None:
if not isinstance(data.get("splitAllCSVs"), bool):
raise InvalidArgumentValueError(
"Invalid value for splitAllCSVs. Allowed values are boolean true or false"
)
new_body["loadTestConfiguration"]["splitAllCSVs"] = data.get("splitAllCSVs")

if data.get("failureCriteria"):
Expand Down Expand Up @@ -389,7 +393,7 @@ def create_or_update_test_with_config(
new_body["keyvaultReferenceIdentityType"] = IdentityType.UserAssigned
elif yaml_test_body.get("keyvaultReferenceIdentityId") is not None:
new_body["keyvaultReferenceIdentityId"] = yaml_test_body.get(
"keyVaultReferenceIdentity"
"keyvaultReferenceIdentityId"
)
new_body["keyvaultReferenceIdentityType"] = IdentityType.UserAssigned
else:
Expand Down
6 changes: 6 additions & 0 deletions src/load/azext_load/tests/latest/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ class LoadConstants:
INVALID_ZIP_ARTIFACT_LOAD_TEST_CONFIG_FILE = os.path.join(
TEST_RESOURCES_DIR, r"invalid-config-with-zip-artifacts.yaml"
)
LOAD_TEST_CONFIG_FILE_KVREFID = os.path.join(TEST_RESOURCES_DIR, r"config-kvrefid.yaml")
LOAD_TEST_CONFIG_FILE_INVALID_KVREFID = os.path.join(TEST_RESOURCES_DIR, r"config-invalid-kvrefid.yaml")
LOAD_TEST_CONFIG_FILE_SPLITCSV_FALSE = os.path.join(TEST_RESOURCES_DIR, r"config-splitcsv-false.yaml")
LOAD_TEST_CONFIG_FILE_INVALID_SPLITCSV = os.path.join(TEST_RESOURCES_DIR, r"config-invalid-splitcsv.yaml")
TEST_PLAN = os.path.join(TEST_RESOURCES_DIR, r"sample-JMX-file.jmx")
ADDITIONAL_FILE = os.path.join(TEST_RESOURCES_DIR, r"additional-data.csv")
FILE_NAME = "sample-JMX-file.jmx"
Expand Down Expand Up @@ -87,6 +91,8 @@ class LoadTestConstants(LoadConstants):
APP_COMPONENT_TEST_ID = "app-component-test-case"
SERVER_METRIC_TEST_ID = "server-metric-test-case"
FILE_TEST_ID = "file-test-case"
LOAD_TEST_KVREF_ID = "loadtest-kvrefid-case"
LOAD_TEST_SPLITCSV_ID = "loadtest-splitcsv-case"

INVALID_UPDATE_TEST_ID = "invalid-update-test-case"
INVALID_PF_TEST_ID = "invalid-pf-test-case"
Expand Down
Loading
Loading