-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Review test readme and define best practices #2130
Conversation
Signed-off-by: miguelgfierro <[email protected]>
Signed-off-by: miguelgfierro <[email protected]>
Signed-off-by: miguelgfierro <[email protected]>
Signed-off-by: miguelgfierro <[email protected]>
Signed-off-by: miguelgfierro <[email protected]>
Signed-off-by: miguelgfierro <[email protected]>
@@ -25,7 +25,7 @@ def test_maybe_download(files_fixtures): | |||
os.remove(filepath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems I broke something when I renamed one of the folders
"code": "ValidationError",
"details": [
***
"code": "Invalid",
"message": "Failed to create snapshot. File node tests/smoke/recommenders/models/__init__.py was specified but does not appear in the list of uploaded files. Please delete the snapshot cache and resubmit. Snapshot cache is located in .projectcontent folder, typically under .azureml folder in your home folder",
"target": "nodes"
***
],
"message": "Failed to create snapshot. File node tests/smoke/recommenders/models/__init__.py was specified but does not appear in the list of uploaded files. Please delete the snapshot cache and resubmit. Snapshot cache is located in .projectcontent folder, typically under .azureml folder in your home folder",
"target": "nodes"
***,
"error": ***
"message": "***\n \"error_details\": ***\n \"componentName\": \"project\",\n \"correlation\": ***\n \"operation\": \"d7b079d7bbac3dd9c21f12b04[151](https://github.com/recommenders-team/recommenders/actions/runs/9918504884/job/27403242773?pr=2130#step:3:158)b40d\",\n \"request\": \"cd3d47291294bee4\"\n ***,\n \"environment\": \"eastus\",\n \"error\": ***\n \"code\": \"ValidationError\",\n \"details\": [\n ***\n \"code\": \"Invalid\",\n \"message\": \"Failed to create snapshot. File node tests/smoke/recommenders/models/__init__.py was specified but does not appear in the list of uploaded files. Please delete the snapshot cache and resubmit. Snapshot cache is located in .projectcontent folder, typically under .azureml folder in your home folder\",\n \"target\": \"nodes\"\n ***\n ],\n \"message\": \"Failed to create snapshot. File node tests/smoke/recommenders/models/__init__.py was specified but does not appear in the list of uploaded files. Please delete the snapshot cache and resubmit. Snapshot cache is located in .projectcontent folder, typically under .azureml folder in your home folder\",\n \"target\": \"nodes\"\n ***,\n \"location\": \"eastus\",\n \"statusCode\": 400,\n \"time\": \"2024-07-13T08:14:28.3166442+00:00\"\n ***,\n \"status_code\": 400,\n \"url\":
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SimonYansenZhao do you know what is this snapshot cache?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miguelgfierro After research, I think a snapshot is just a copy of recommenders. In the testing workflow, the repo is copied onto the GitHub CICD VM by the action checkout:
recommenders/.github/workflows/azureml-unit-tests.yml
Lines 38 to 39 in d333a0d
- name: Check out repository code | |
uses: actions/checkout@v4 |
then the copy is uploaded onto the AzureML compute by the Azure ML SDK as a snapshot. I am not sure why the __init__.py
file wasn't uploaded. But it is now uploaded into the snapshot cache after I disable snapshot and re-enable. In other words, as the error suggested, we need to delete the snapshot cache directory. Disabling snapshot seemed to have the effect of removing the cache directory, and then re-enabling snapshot makes sure recommenders repo is uploaded onto the AzureML compute. It looks like a bug of AzureML.
Two solutions that may permanently resolve this problem are:
- Add code to delete the snapshot cache directory every time when uploading the copy of recommenders.
- Clone recommenders directly in the docker image used for AzureML compute.
Signed-off-by: Simon Zhao <[email protected]>
Signed-off-by: Simon Zhao <[email protected]>
Signed-off-by: Simon Zhao <[email protected]>
@miguelgfierro We got new errors: https://github.com/recommenders-team/recommenders/actions/runs/9954661853/job/27500793010
|
Signed-off-by: miguelgfierro <[email protected]>
Signed-off-by: miguelgfierro <[email protected]>
Signed-off-by: miguelgfierro <[email protected]>
Signed-off-by: miguelgfierro <[email protected]>
Description
The reasoning is to make the tests more explicit. For example, if a function returns True, we want to make sure the assert checks for True and not for a truthy value.
Example:
Related Issues
References
Checklist:
git commit -s -m "your commit message"
.staging branch
AND NOT TOmain branch
.