Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions src/aks-preview/az_aks_tool/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ def main():
print("raw args: {}".format(sys.argv))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please help add comments to the real code changes?
a huge PR is a bit hard to do review.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, working on that

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update key changes in PR description section.

args = init_argparse(sys.argv[1:])

# check directory
utils.create_directory(args.report_path)

# setup logger
root_module_name = log.parse_module_name(levels=1)
log.setup_logging(root_module_name, os.path.join(
Expand Down
11 changes: 10 additions & 1 deletion src/aks-preview/az_aks_tool/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@
import sys
import re
import logging
import pathlib

import az_aks_tool.const as const
import az_aks_tool.filter as custom_filter
logger = logging.getLogger(__name__)


def create_directory(dir_path):
if dir_path:
if not os.path.isdir(dir_path):
print("Directory '{}' not exist, creating...".format(dir_path))
pathlib.Path(dir_path).mkdir(parents=True, exist_ok=True)
else:
print("Invalid dir path: '{}'".format(dir_path))


def check_file_existence(file_path):
if file_path is not None and os.path.isfile(file_path):
return True
Expand Down
10 changes: 7 additions & 3 deletions src/aks-preview/azcli_aks_live_test/ext_matrix_default.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@
"test_aks_update_azurekeyvaultsecretsprovider_with_secret_rotation",
"test_aks_enable_addon_with_azurekeyvaultsecretsprovider",
"test_aks_enable_addon_with_gitops",
"test_aks_create_with_fips"
"test_aks_create_with_fips",
"test_aks_disable_local_accounts",
"test_aks_nodepool_add_with_ossku",
"test_aks_create_with_ossku"
],
"unknown": [
"test_aks_create_and_update_with_managed_aad_enable_azure_rbac",
"test_aks_create_with_virtual_node_addon"
"test_aks_create_with_virtual_node_addon",
Comment thread
FumingZhang marked this conversation as resolved.
Outdated
"test_aks_update_to_msi_cluster_with_addons"
],
"code bug": [
"test_aks_create_with_ingress_appgw_addon_with_deprecated_subet_prefix",
Expand All @@ -36,4 +40,4 @@
"test_aks_create_with_ingress_appgw_addon"
]
}
}
}
9 changes: 7 additions & 2 deletions src/aks-preview/azcli_aks_live_test/test_ext_live.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ set -o xtrace
[[ -z "${TEST_MODE}" ]] && (echo "TEST_MODE is empty"; exit 1)
[[ -z "${PARALLELISM}" ]] && (echo "PARALLELISM is empty"; exit 1)
[[ -z "${TEST_CASES}" ]] && (echo "TEST_CASES is empty")
[[ -z "${EXT_TEST_MATRIX}" ]] && (echo "EXT_TEST_MATRIX is empty")
[[ -z "${EXT_TEST_FILTER}" ]] && (echo "EXT_TEST_FILTER is empty")
[[ -z "${EXT_TEST_COVERAGE}" ]] && (echo "EXT_TEST_COVERAGE is empty")

Expand Down Expand Up @@ -55,6 +56,10 @@ fi
if [[ -n ${TEST_CASES} ]]; then
run_flags+=" -t ${TEST_CASES}"
fi
# ext matrix
if [[ -n ${EXT_TEST_MATRIX} ]]; then
run_flags+=" -em ${EXT_TEST_MATRIX}"
fi
# ext extra filter
if [[ -n ${EXT_TEST_FILTER} ]]; then
run_flags+=" -ef ${EXT_TEST_FILTER}"
Expand All @@ -70,7 +75,7 @@ if [[ ${TEST_MODE} == "record" || ${TEST_MODE} == "all" ]]; then
run_flags+=" --json-report-file=ext_report.json"
run_flags+=" --xml-file=ext_result.xml"
echo "run flags: ${run_flags}"
echo ${run_flags} | xargs python -u az_aks_tool/main.py
echo "${run_flags}" | xargs python -u az_aks_tool/main.py
fi

# live test
Expand All @@ -82,5 +87,5 @@ if [[ ${TEST_MODE} == "live" || ${TEST_MODE} == "all" ]]; then
run_flags+=" -l --json-report-file=ext_live_report.json"
run_flags+=" --xml-file=ext_live_result.xml"
echo "run flags: ${run_flags}"
echo ${run_flags} | xargs python -u az_aks_tool/main.py
echo "${run_flags}" | xargs python -u az_aks_tool/main.py
fi
2 changes: 2 additions & 0 deletions src/aks-preview/azcli_aks_live_test/transcribe_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ set -o xtrace
[[ -z "${TEST_MODE}" ]] && (echo "TEST_MODE is empty"; exit 1)
[[ -z "${PARALLELISM}" ]] && (echo "PARALLELISM is empty"; exit 1)
[[ -z "${TEST_CASES}" ]] && (echo "TEST_CASES is empty")
[[ -z "${EXT_TEST_MATRIX}" ]] && (echo "EXT_TEST_MATRIX is empty")
[[ -z "${EXT_TEST_FILTER}" ]] && (echo "EXT_TEST_FILTER is empty")
[[ -z "${EXT_TEST_COVERAGE}" ]] && (echo "EXT_TEST_COVERAGE is empty")
[[ -z "${CLI_REPO}" ]] && (echo "CLI_REPO is empty"; exit 1)
Expand Down Expand Up @@ -50,6 +51,7 @@ echo "COVERAGE=${COVERAGE}" >> env.list
echo "TEST_MODE=${TEST_MODE}" >> env.list
echo "PARALLELISM=${PARALLELISM}" >> env.list
echo "TEST_CASES=${TEST_CASES}" >> env.list
echo "EXT_TEST_MATRIX=${EXT_TEST_MATRIX}" >> env.list
echo "EXT_TEST_FILTER=${EXT_TEST_FILTER}" >> env.list
echo "EXT_TEST_COVERAGE=${EXT_TEST_COVERAGE}" >> env.list

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ jobs:
inputs:
contents: 'reports/**'
targetFolder: $(Build.ArtifactStagingDirectory)
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: 'live test reports'
condition: succeededOrFailed()
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ jobs:
inputs:
contents: 'reports/**'
targetFolder: $(Build.ArtifactStagingDirectory)
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
artifactName: 'unit test reports'
condition: succeededOrFailed()
Original file line number Diff line number Diff line change
Expand Up @@ -1649,7 +1649,7 @@ def test_aks_custom_kubelet_identity(self, resource_group, resource_group_locati

@live_only()
@AllowLargeResponse()
@ResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus2')
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus2')
def test_aks_disable_local_accounts(self, resource_group, resource_group_location):
aks_name = self.create_random_name('cliakstest', 16)
self.kwargs.update({
Expand Down