Skip to content

Commit

Permalink
{AKS} Update AKS check-in pipeline (Azure#3689)
Browse files Browse the repository at this point in the history
* update recording upload

* update log format

* add link to wiki

* change default value of test mode
  • Loading branch information
FumingZhang authored Jul 23, 2021
1 parent e298f57 commit 1d72a08
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 28 deletions.
48 changes: 36 additions & 12 deletions src/aks-preview/azcli_aks_live_test/scripts/test_cli_live.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,22 @@ if [[ -n ${CLI_TEST_COVERAGE} ]]; then
fi

# recording test
if [[ ${TEST_MODE} == "record" || ${TEST_MODE} == "all" ]]; then
if [[ ${TEST_MODE} == "recording" || ${TEST_MODE} == "all" ]]; then
echo "Test in recording mode!"
coverage_options=" -cc test_aks_commands.AzureKubernetesServiceScenarioTest"
recording_options="${base_options}${coverage_options}"
recording_options+=" --json-report-file=cli_recording_report.json"
recording_options+=" --xml-file=cli_recording_result.xml"
echo "recording options: ${recording_options}"
azaks ${recording_options}
echo "Recording test options: ${recording_options}"
test_result=0
azaks ${recording_options} || test_result=$?
if [[ ${test_result} -ne 0 ]]; then
echo "Recording test failed!"
echo "Please refer to this wiki (https://dev.azure.com/msazure/CloudNativeCompute/_wiki/wikis/CloudNativeCompute.wiki/156735/AZCLI-AKS-Live-Unit-Test-Pipeline) for troubleshooting guidelines."
exit ${test_result}
else
echo -e "Recording test passed!\n\n"
fi
fi

# live test
Expand All @@ -72,16 +80,32 @@ if [[ ${TEST_MODE} == "live" || ${TEST_MODE} == "all" ]]; then
live_options="${base_options}${filter_options}"
live_options+=" -l --json-report-file=cli_live_report.json"
live_options+=" --xml-file=cli_live_result.xml"
echo "live options: ${live_options}"
azaks ${live_options}
echo "Live test options: ${live_options}"
test_result=0
azaks ${live_options} || test_result=$?
if [[ ${test_result} -ne 0 ]]; then
echo "Live test failed!"
echo "Please refer to this wiki (https://dev.azure.com/msazure/CloudNativeCompute/_wiki/wikis/CloudNativeCompute.wiki/156735/AZCLI-AKS-Live-Unit-Test-Pipeline) for troubleshooting guidelines."
exit ${test_result}
else
echo -e "Live test passed!\n\n"
fi
fi

# re-recording test
# live-replay test
if [[ ${TEST_MODE} == "live" || ${TEST_MODE} == "all" ]]; then
echo "Test in re-recording mode(after live test)!"
re_recording_options="${base_options}${filter_options}"
re_recording_options+=" --json-report-file=cli_re_recording_report.json"
re_recording_options+=" --xml-file=cli_re_recording_result.xml"
echo "re-recording options: ${re_recording_options}"
azaks ${re_recording_options}
echo "Test in live-replay mode!"
live_replay_options="${base_options}${filter_options}"
live_replay_options+=" --json-report-file=cli_live_replay_report.json"
live_replay_options+=" --xml-file=cli_live_replay_result.xml"
echo "Live-replay test options: ${live_replay_options}"
test_result=0
azaks ${live_replay_options} || test_result=$?
if [[ ${test_result} -ne 0 ]]; then
echo "Live-replay test failed!"
echo "Please refer to this wiki (https://dev.azure.com/msazure/CloudNativeCompute/_wiki/wikis/CloudNativeCompute.wiki/156735/AZCLI-AKS-Live-Unit-Test-Pipeline) for troubleshooting guidelines."
exit ${test_result}
else
echo -e "Live-replay test passed!\n\n"
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ mkdir -p reports/ && cp ${acs_base_dir}/coverage_acs.json reports/

if [[ ${acs_unit_test_failed} == "true" ]]; then
echo "Unit test failed!"
echo "Please refer to this wiki (https://dev.azure.com/msazure/CloudNativeCompute/_wiki/wikis/CloudNativeCompute.wiki/156735/AZCLI-AKS-Live-Unit-Test-Pipeline) for troubleshooting guidelines."
exit 1
fi
48 changes: 36 additions & 12 deletions src/aks-preview/azcli_aks_live_test/scripts/test_ext_live.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,22 @@ if [[ -n ${EXT_TEST_COVERAGE} ]]; then
fi

# recording test
if [[ ${TEST_MODE} == "record" || ${TEST_MODE} == "all" ]]; then
if [[ ${TEST_MODE} == "recording" || ${TEST_MODE} == "all" ]]; then
echo "Test in recording mode!"
coverage_options=" -ec test_aks_commands.AzureKubernetesServiceScenarioTest"
recording_options="${base_options}${coverage_options}"
recording_options+=" --json-report-file=ext_recording_report.json"
recording_options+=" --xml-file=ext_recording_result.xml"
echo "recording options: ${recording_options}"
azaks ${recording_options}
echo "Recording test options: ${recording_options}"
test_result=0
azaks ${recording_options} || test_result=$?
if [[ ${test_result} -ne 0 ]]; then
echo "Recording test failed!"
echo "Please refer to this wiki (https://dev.azure.com/msazure/CloudNativeCompute/_wiki/wikis/CloudNativeCompute.wiki/156735/AZCLI-AKS-Live-Unit-Test-Pipeline) for troubleshooting guidelines."
exit ${test_result}
else
echo -e "Recording test passed!\n\n"
fi
fi

# live test
Expand All @@ -71,16 +79,32 @@ if [[ ${TEST_MODE} == "live" || ${TEST_MODE} == "all" ]]; then
live_options="${base_options}${filter_options}"
live_options+=" -l --json-report-file=ext_live_report.json"
live_options+=" --xml-file=ext_live_result.xml"
echo "live options: ${live_options}"
azaks ${live_options}
echo "Live test options: ${live_options}"
test_result=0
azaks ${live_options} || test_result=$?
if [[ ${test_result} -ne 0 ]]; then
echo "Live test failed!"
echo "Please refer to this wiki (https://dev.azure.com/msazure/CloudNativeCompute/_wiki/wikis/CloudNativeCompute.wiki/156735/AZCLI-AKS-Live-Unit-Test-Pipeline) for troubleshooting guidelines."
exit ${test_result}
else
echo -e "Live test passed!\n\n"
fi
fi

# re-recording test
# live-replay test
if [[ ${TEST_MODE} == "live" || ${TEST_MODE} == "all" ]]; then
echo "Test in re-recording mode(after live test)!"
re_recording_options="${base_options}${filter_options}"
re_recording_options+=" --json-report-file=ext_re_recording_report.json"
re_recording_options+=" --xml-file=ext_re_recording_result.xml"
echo "re-recording options: ${re_recording_options}"
azaks ${re_recording_options}
echo "Test in live-replay mode!"
live_replay_options="${base_options}${filter_options}"
live_replay_options+=" --json-report-file=ext_live_replay_report.json"
live_replay_options+=" --xml-file=ext_live_replay_result.xml"
echo "Live-replay test options: ${live_replay_options}"
test_result=0
azaks ${live_replay_options} || test_result=$?
if [[ ${test_result} -ne 0 ]]; then
echo "Live-replay test failed!"
echo "Please refer to this wiki (https://dev.azure.com/msazure/CloudNativeCompute/_wiki/wikis/CloudNativeCompute.wiki/156735/AZCLI-AKS-Live-Unit-Test-Pipeline) for troubleshooting guidelines."
exit ${test_result}
else
echo -e "Live-replay test passed!\n\n"
fi
fi
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ mkdir -p reports/ && cp ${aks_preview_base_dir}/coverage_azext_aks_preview.json

if [[ ${azext_aks_preview_unit_test_failed} == "true" ]]; then
echo "Unit test failed!"
echo "Please refer to this wiki (https://dev.azure.com/msazure/CloudNativeCompute/_wiki/wikis/CloudNativeCompute.wiki/156735/AZCLI-AKS-Live-Unit-Test-Pipeline) for troubleshooting guidelines."
exit 1
fi
17 changes: 13 additions & 4 deletions src/aks-preview/azcli_aks_live_test/vsts-azcli-aks-live-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ variables:
value: "azure-cli-extensions"
- name: LIVE_TEST_BASE_DIR
value: "azure-cli-extensions/src/aks-preview/azcli_aks_live_test"
- name: ACS_BASE_DIR
value: "azure-cli/src/azure-cli/azure/cli/command_modules/acs"
- name: AKS_PREVIEW_BASE_DIR
value: "azure-cli-extensions/src/aks-preview/azext_aks_preview"

Expand Down Expand Up @@ -70,16 +72,23 @@ jobs:
targetFolder: $(Build.ArtifactStagingDirectory)
condition: succeededOrFailed()
displayName: "Copy Reports & Logs"
- bash: mkdir -p $(Build.ArtifactStagingDirectory)/recordings
- bash: mkdir -p $(Build.ArtifactStagingDirectory)/cli-recordings $(Build.ArtifactStagingDirectory)/ext-recordings
condition: succeededOrFailed()
displayName: "Create Dir for Recordings"
- task: CopyFiles@2
inputs:
contents: '$(ACS_BASE_DIR)/tests/latest/recordings/**'
flattenFolders: true
targetFolder: $(Build.ArtifactStagingDirectory)/cli-recordings
condition: and(succeededOrFailed(), in(variables['COVERAGE'], 'cli', 'all'))
displayName: "Copy CLI Recordings"
- task: CopyFiles@2
inputs:
contents: '$(AKS_PREVIEW_BASE_DIR)/tests/latest/recordings/**'
flattenFolders: true
targetFolder: $(Build.ArtifactStagingDirectory)/recordings
condition: succeededOrFailed()
displayName: "Copy Recordings"
targetFolder: $(Build.ArtifactStagingDirectory)/ext-recordings
condition: and(succeededOrFailed(), in(variables['COVERAGE'], 'ext', 'all'))
displayName: "Copy EXT Recordings"
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(Build.ArtifactStagingDirectory)
Expand Down

0 comments on commit 1d72a08

Please sign in to comment.