Skip to content

Replace check_notebook.sh with appropriate Python script (New)#1725

Merged
motjuste merged 29 commits intomainfrom
CHECKBOX-1693-replace-check_notebook-sh-with-py
Feb 26, 2025
Merged

Replace check_notebook.sh with appropriate Python script (New)#1725
motjuste merged 29 commits intomainfrom
CHECKBOX-1693-replace-check_notebook-sh-with-py

Conversation

@motjuste
Copy link
Copy Markdown
Contributor

@motjuste motjuste commented Feb 14, 2025

Description

This is the first piece of the original PR #1724 to enable easier review. The main changes in this PR include (after also applying the requests from review):

  • Moved the in-line Python scripts that need to be run in the pods from check_notebook.sh to individual scripts in the data directory.
  • Added a check_notebook.py that accepts a notebook's name and the name of the script to run in its pod, finds the appropriate pod and runs the script in that pod.
  • Replaced existing uses of check_notebook.sh in the jobs to analogous uses of check_notebook.py.
  • Removed the now obsolete check_notebook.sh.
  • Added unit-tests for check_notebook.py, and the ability to run them using tox.
  • Added a new GitHub workflow to run these unit-tests for any PRs to this contrib area.

Resolved issues

Documentation

No changes to Checkbox documentation.

Tests

Please see comment from codecov for the coverage report for unit-tests added in this PR. This branch was also verified to run in Testflinger.

check_notebook.py is going to replace check_notebook.sh,
and it uses some utilities from common.py (which later
Python scripts will also use).
those Python files were scripts that were being submitted to the
notebook pods.  These scripts are now in-line in the check_notebook.py
@motjuste motjuste requested a review from a team as a code owner February 14, 2025 17:00
@motjuste motjuste requested review from pieqq and removed request for a team February 14, 2025 17:02
motjuste added a commit that referenced this pull request Feb 14, 2025
it is required that dss is purged before the integration tests are run,
hence a tenmporary job for it has been added that does not do any
explicit verification that the purge was successful (except for exit
code perhaps).  This tmp dss/purge job will be replaced by a better impl
in #1725
@fernando79513 fernando79513 self-assigned this Feb 17, 2025
Copy link
Copy Markdown
Collaborator

@fernando79513 fernando79513 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR and sorry for taking so long to review it.
I have added some comments here and there, but the main concern is that this PR is much more complex that it needs to be.
There are too many helper functions that could be simplified since they are not adding anything important to the test.
If something is not clear enough, please ping me so we can discuss it.

Co-authored-by: Fernando Bravo <39527354+fernando79513@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 49.47%. Comparing base (0a49970) to head (85f75f1).
Report is 143 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1725      +/-   ##
==========================================
+ Coverage   49.23%   49.47%   +0.23%     
==========================================
  Files         373      376       +3     
  Lines       40400    40591     +191     
  Branches     6822     6822              
==========================================
+ Hits        19890    20081     +191     
  Misses      19784    19784              
  Partials      726      726              
Flag Coverage Δ
provider-dss ∅ <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor Author

@motjuste motjuste left a comment

Choose a reason for hiding this comment

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

I have replied to all the comments, accepted one change to add coverage reporting, and will work on updating the Copyright banners on the rest. @fernando79513 please have a look at my clarifications and questions for the rest of the comments.

@motjuste
Copy link
Copy Markdown
Contributor Author

With the recent commits, I have integrated more suggestions and resolved relevant conversations from my side. For the rest, I have provided my justifications.

@motjuste
Copy link
Copy Markdown
Contributor Author

Thank you for the recent comments. I am working on incorporating your suggestions and will update.

@motjuste motjuste changed the title Replace check_notebook.sh with and appropriate Python script (New) Replace check_notebook.sh with appropriate Python script (New) Feb 20, 2025
@motjuste
Copy link
Copy Markdown
Contributor Author

I am working on shipping the scripts as part of ./data, but the rest of the feedback has been incorporated. @fernando79513, please have another look.

@fernando79513
Copy link
Copy Markdown
Collaborator

Helo @motjuste!
Thanks for all the work here! I've just added some comments to the PR.

Running these scripts never timeout in practice,
and shouldn't based on where we are going.

Nevertheless, timeout can be set by the caller,
e.g. like `timout 5m check_notebook.py ...`
The script and associated jobs are BROKEN in this commit
@motjuste
Copy link
Copy Markdown
Contributor Author

Hey @fernando79513, I believe I have now covered all your requests from the review (thanks a LOT for the very careful and useful comments!). I have updated the PR's description now to reflect what will be merged.

Copy link
Copy Markdown
Collaborator

@fernando79513 fernando79513 left a comment

Choose a reason for hiding this comment

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

Thank you for all the changes!
Really good job here.

@motjuste motjuste merged commit 1721cc3 into main Feb 26, 2025
19 checks passed
@motjuste motjuste deleted the CHECKBOX-1693-replace-check_notebook-sh-with-py branch February 26, 2025 12:27
stanley31huang pushed a commit that referenced this pull request Mar 28, 2025
- Moved the in-line Python scripts that need to be run in the pods from
   check_notebook.sh to individual scripts in the data directory.
- Added a check_notebook.py that accepts a notebook's name and the
   name of the script to run in its pod, finds the appropriate pod and runs the
   script in that pod.
- Replaced existing uses of check_notebook.sh in the jobs to analogous uses
   of check_notebook.py.
- Removed the now obsolete check_notebook.sh.
- Added unit-tests for check_notebook.py, and the ability to run them using tox.
- Added a new GitHub workflow to run these unit-tests for any PRs to this contrib area.
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.

2 participants