Skip to content

{Keyvault} Fix keyvault packaging tests#18919

Closed
evelyn-ys wants to merge 4 commits intoAzure:devfrom
evelyn-ys:fix_keyvault_CI
Closed

{Keyvault} Fix keyvault packaging tests#18919
evelyn-ys wants to merge 4 commits intoAzure:devfrom
evelyn-ys:fix_keyvault_CI

Conversation

@evelyn-ys
Copy link
Member

@evelyn-ys evelyn-ys commented Jul 19, 2021

Description

Our CI fails in (CI link)
image
with such error

Can't overwrite existing cassette ('/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/keyvault/tests/latest/recordings/test_keyvault_certificate_crud.yaml') in your current record mode ('once').
No match for the request (<Request (GET) https://cli-test-kv-ct-000002.vault.azure.net/secrets/cert2/?api-version=7.0>) was found.

when runs into L1895

if not os.path.exists(cert_secret_path) or self.is_live:
if os.path.exists(cert_secret_path):
os.remove(cert_secret_path)
self.cmd('keyvault secret download --vault-name {kv} --file "{cert_secret_path}" -n cert2 --encoding base64')

It's because the cert_secret_path is TEST_DIR/cert_secret without any file extension and our packaging script doesn't cover file without file extension:

cat >>$testsrc_dir/setup.py <<EOL
],
package_data={'': ['recordings/*.yaml',
'data/*.zip',
'data/*.whl',
'data/*.yaml',
'*.zip',
'*.pem',
'*.pfx',
'*.txt',
'*.json',
'*.byok',
'*.js',
'*.md',
'*.bat',
'*.txt',
'*.cer',
'*.yml',
'*.xml',
'**/*.cer',
'**/*.pem',
'**/*.pfx',
'**/*.txt',
'**/*.json',
'**/*.ipynb',
'**/*.byok',
'**/*.js',
'**/*.md',
'**/*.bat',
'**/*.txt',
'**/*.xml']},
install_requires=DEPENDENCIES
)
EOL

So the code runs into this if not os.path.exists(cert_secret_path) but no related request found in yaml file.

This PR changed TEST_DIR/cert_secret to TEST_DIR/cert_secret.der and added .der to packaging file, also re-record yaml file with related request.


This checklist is used to make sure that common guidelines for a pull request are followed.

@evelyn-ys evelyn-ys requested a review from zhoxing-ms July 19, 2021 03:23
@yonzhan
Copy link
Collaborator

yonzhan commented Jul 19, 2021

Keyvault

@yonzhan yonzhan added this to the Jul 2021 (2021-08-03) milestone Jul 19, 2021
@yonzhan yonzhan requested a review from jsntcy July 19, 2021 03:38
@jiasli
Copy link
Member

jiasli commented Jul 19, 2021

You may directly push the branch to azure repo to trigger those CI tasks.

@jiasli
Copy link
Member

jiasli commented Jul 19, 2021

To better help the reader find failed CI tasks, please consider including a direct link to failed CI tasks in the PR description, instead of using screenshots.

@jiasli
Copy link
Member

jiasli commented Jul 19, 2021

If the issue is caused by a missing certificate file, why isn't the error triggered before?

@evelyn-ys
Copy link
Member Author

You may directly push the branch to azure repo to trigger those CI tasks.

Got it! Redirect to #18922

@evelyn-ys evelyn-ys closed this Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants