Skip to content

Conversation

@zliang-akamai
Copy link
Member

📝 Description

pathlib is the modern Object-oriented API for file path related operations. This migration also enabled running individual test directly without the fixture not found exception. Like the sample test run in the section below.

✔️ How to Test

python3 -m pytest test/unit/objects/linode_test.py -k test_create_disk

@zliang-akamai zliang-akamai requested a review from a team as a code owner September 17, 2025 20:31
@zliang-akamai zliang-akamai requested review from Copilot, jriddle-linode and yec-akamai and removed request for a team September 17, 2025 20:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modernizes the test fixtures discovery system by migrating from the legacy os module to the modern pathlib API for file path operations. This change also resolves issues with running individual tests that previously failed with fixture not found exceptions.

  • Replace os and sys.path based path construction with pathlib.Path
  • Update file iteration and path joining operations to use pathlib methods
  • Maintain compatibility with existing fixture loading logic while improving path handling

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@yec-akamai yec-akamai left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@jriddle-linode jriddle-linode left a comment

Choose a reason for hiding this comment

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

LGTM

@zliang-akamai zliang-akamai merged commit 93056c0 into dev Oct 2, 2025
12 checks passed
@zliang-akamai zliang-akamai added the testing for updates to the testing suite in the changelog. label Oct 2, 2025
srbhaakamai pushed a commit to srbhaakamai/linode_api4-python that referenced this pull request Oct 3, 2025
* Migrate test fixtures discovery to be with pathlib

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
srbhaakamai pushed a commit to srbhaakamai/linode_api4-python that referenced this pull request Oct 3, 2025
* Migrate test fixtures discovery to be with pathlib

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
srbhaakamai added a commit to srbhaakamai/linode_api4-python that referenced this pull request Oct 3, 2025
* Migrate test fixtures discovery to be with pathlib

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>
yec-akamai added a commit that referenced this pull request Dec 2, 2025
* DI-26927 Python SDK code for GET Alert Definitions

* DI-26927 Python SDK code modified for client code

* DI-26927 Added Unit test cases and missing classes

* DI-26927 made corrections to keep code consistent

* DI-26927 Updated Unit and Integratoion Tests

* [dev 51950af] DI-26927 Updated Unit and Integratoion Tests

* Revert "DI-26927 Updated Unit and Integratoion Tests"

This reverts commit 51950af.

* Revert "[dev 51950af] DI-26927 Updated Unit and Integratoion Tests"

This reverts commit 6ca6a5a.

* DI-26927 Updated Unit and Integratoion Tests

* Remove .venv from repo and add to .gitignore

* DI-26927 reverted git ignore

* DI-26927 reverted conftest,py

* DI-26927  added accidentlly deleted file

* DI-26927 Corrected Integration and Unit Test cases for Alerting APIs

* DI-26927 Reverted conftest.py and check integration without those changes

* DI-26927 fixed integration test for firewall and added time for alert update before deletion

* DI-26927 fixed changing monitor.py as per review comments

* DI-26927 fixed changing monitor.py as per review comments

* DI-26927 fixed changing monitor.py as per review comments

* DI-26927 Intermediate change to address internal review comments

* DI-26927 CLosed review comments

* DI-26927 CLosed review comments

* DI-27156 closed review comments from Ketan

* DI-27156 closed review comments from Ketan

* DI-27156 fixed unit test cases post review comments fixes

* DI-27156 Updated docstring and make unit test cases changes

* DI-27156 Added unit test cases post review comments fixes

* DI-27156 Added unit test cases post review comments fixes

* tests(monitor): add MonitorAlertDefinitionsTest and update fixtures for alert-definitions

* DI-27156 Added unit test cases post review comments fixes

* DI-27156 Updated docstring

* DI-27156 Updated unit test errors

* removed unwanted files

* added missing doxcstring

* added missing doxcstring

* added missing doxcstring

* rmoved test files

* closed final review comments

* fixing integration test issues

* Corrected Integration Test Case

* DI-26927 Corrected json to object modifications issues

* DI-26927 Corrected json to object modifications issues

* DI-26927 Unit test corrections for mofied functions name

* Delete test/fixtures/monitor/services/dbaas/alert-definitions.json

Not Required

* Delete test.py

Not Required here required for local testing only

* Delete test/fixtures/monitor/alert-definitions.json

Not required here

* DI-26927 reverted fixtures.py as its not necesary to change

* DI-26927 reverted fixtures.py as its not necesary to change

* DI-26927 reverted fixtures.py as its not necesary to change

* DI-26927 fixed linting error

* DI-26927 fixed linting error

* DI-26927 fixed lint error caught in CI

* Update test/unit/groups/monitor_api_test.py

Co-authored-by: Copilot <[email protected]>

* Update test/integration/models/monitor/test_monitor.py

Co-authored-by: Copilot <[email protected]>

* Update test/integration/models/monitor/test_monitor.py

Co-authored-by: Copilot <[email protected]>

* Update test/integration/models/monitor/test_monitor.py

Co-authored-by: Copilot <[email protected]>

* Update linode_api4/objects/monitor.py

Co-authored-by: Copilot <[email protected]>

* DI-26927 fixed copilot comments

* fixed review comments from APIv4 team

* fixed review comments from APIv4 team

* fixed review comments from APIv4 team

* fixed review comments from APIv4 team

* DI-26927 fixed review comments from API v4 team

* fixed review comments from APIv4 team

* fixed lint errors

* Update linode_api4/groups/monitor.py

Co-authored-by: Ye Chen <[email protected]>

* Update linode_api4/groups/monitor.py

Co-authored-by: Ye Chen <[email protected]>

* fixed review  errors

* fixed unittest

* fixed unittest

* fixed unittest

* fixed unittest

* fixed unittest

* fixed unittest

* added update use case to integration test

* Update linode_api4/objects/monitor.py

Co-authored-by: Ye Chen <[email protected]>

* Update linode_api4/objects/monitor.py

Co-authored-by: Ye Chen <[email protected]>

* Update linode_api4/objects/monitor.py

Co-authored-by: Ye Chen <[email protected]>

* Update linode_api4/objects/monitor.py

Co-authored-by: Ye Chen <[email protected]>

* fixed further review comments

* Updated  integration test

* Updated  integration test with more assert statements

* Fix Linode interfaces property (#604)

* Fix test for interfaces (#605)

* Fix test

* changed as per github-advanced-security comments

* fixed formatting errors using python black

* Migrate test fixtures discovery to be with pathlib (#599)

* Migrate test fixtures discovery to be with pathlib

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Copilot <[email protected]>

* Update linode_api4/objects/monitor.py

Co-authored-by: Ye Chen <[email protected]>

* Fixed Copilot comments on unit and integration tests

* corrected unit test assert statement

* Added comment as per copilot suggestion for save() and delete()

* resolved comments from copilot commented whereever not applicable

* Test: verify automatic GPG signing is working

* Incorporated copilot comments

* Removed serialisabel file from commit

* Fix Lint errors

* fixed review comments fo mutable

* fixed review comments  to keep it in line with SDK guidelines

* Addressed review comments on AlertDefinition class

* Comprehensive monitor API improvements and code quality fixes

- Removed unused imports and optimized import order
- Updated test cases for monitor integration
- Enhanced monitor objects with proper type annotations
- Improved monitor groups with better error handling
- Applied code review feedback and best practices

* Applied review comments across

* Comprehensive monitor API fixes and improvements

- Fixed json_object parameter issues in AlertDefinition properties
- Corrected list type annotations for AlertChannelEnvelope
- Updated integration tests with proper status handling for alert definitions
- Applied review comments for better code quality
- Enhanced type annotations and import organization
- Improved error handling in monitor group methods

* change entity id type as per review comments

* reverted copilot comments as per the suggestion unit and integration test passed after the changes

* removed unused imports

* removed unused imports

* Refactored integration test

* changed _class to alert_class as per review suggestions

* changed alert_class to service_class as per review suggestions

* Update linode_api4/objects/monitor.py

* Update test/integration/models/monitor/test_monitor.py

Co-authored-by: Copilot <[email protected]>

* Update test/integration/models/monitor/test_monitor.py

Co-authored-by: Copilot <[email protected]>

* Update linode_api4/groups/monitor.py

Co-authored-by: Copilot <[email protected]>

* Update test/integration/models/monitor/test_monitor.py

Co-authored-by: Copilot <[email protected]>

* Update linode_api4/groups/monitor.py

Co-authored-by: Copilot <[email protected]>

* Update test/fixtures/monitor_alert-definitions.json

* Apply suggestion from @zliang-akamai

* Apply suggestion from @zliang-akamai

---------

Co-authored-by: Copilot <[email protected]>
Co-authored-by: Ye Chen <[email protected]>
Co-authored-by: Zhiwei Liang <[email protected]>
Co-authored-by: Zhiwei Liang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing for updates to the testing suite in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants