Add tests and CI support for automatic testing for Python scripts#832
Merged
pickypg merged 5 commits intoelastic:mainfrom May 8, 2025
Merged
Add tests and CI support for automatic testing for Python scripts#832pickypg merged 5 commits intoelastic:mainfrom
pickypg merged 5 commits intoelastic:mainfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces new unit tests for both importing and exporting model snapshots and adds CI support (via GitHub workflows and nox) for automated testing.
- Added comprehensive tests covering functions such as sanitization, extraction, archive handling, and Elasticsearch interactions.
- Updated project configurations (pyproject.toml, noxfile.py) and added a GitHub Actions workflow to run tests on pull requests.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/share_ad_job_state/tests/test_import_model_snapshot.py | New tests for import functionality including file extraction and ES operations. |
| scripts/share_ad_job_state/tests/test_export_model_snapshot.py | New tests for export functionality covering archive creation and ES data retrieval. |
| scripts/share_ad_job_state/pyproject.toml | Updated configuration; added development dependencies. |
| scripts/share_ad_job_state/noxfile.py | Added nox sessions for formatting, linting, and testing. |
| scripts/share_ad_job_state/import_model_snapshot.py | Minor reordering of imports; no functional changes. |
| scripts/share_ad_job_state/export_model_snapshot.py | Minor formatting improvements for argument parsing. |
| .github/workflows/python-tests.yml | Added CI workflow for running tests on pull requests. |
Files not reviewed (1)
- scripts/share_ad_job_state/.gitignore: Language not supported
Comments suppressed due to low confidence (1)
scripts/share_ad_job_state/tests/test_import_model_snapshot.py:99
- [nitpick] Consider using a standard hyphen ('-') for index names to maintain consistency and avoid potential issues with non‐standard characters, unless the special character is intentional.
actions = list(ims.generate_actions(str(f), "new‑idx"))
Collaborator
Author
|
@pickypg can you please give it a review? |
pickypg
approved these changes
May 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds unit tests for scripts and automatic PR testing with GitHub workflow. This will ensure that automatic dependency updates will not break the behaviour.