Skip to content

TPT-4285: Implement integration tests for ReservedIP for IPv4#688

Open
mawilk90 wants to merge 30 commits into
linode:proj/reserved-ipsfrom
mawilk90:feature/TPT-4285-python-sdk-implement-integration-tests-for-reserved-ip-for-ipv4
Open

TPT-4285: Implement integration tests for ReservedIP for IPv4#688
mawilk90 wants to merge 30 commits into
linode:proj/reserved-ipsfrom
mawilk90:feature/TPT-4285-python-sdk-implement-integration-tests-for-reserved-ip-for-ipv4

Conversation

@mawilk90

@mawilk90 mawilk90 commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

📝 Description

Integration tests for Reserved IPs

Required tags specified in Jira ticket.

✔️ How to Test

make test-int TEST_ARGS="-k reserved_ip -v"
make test-int TEST_ARGS="-k reserve_ephemeral -v"

@mawilk90 mawilk90 added new-feature for new features in the changelog. testing for updates to the testing suite in the changelog. labels Apr 27, 2026
Comment thread test/integration/models/networking/test_networking.py Fixed
@mawilk90 mawilk90 added the do-not-merge PRs that should not be merged until the commented issue is resolved label Apr 28, 2026
@mawilk90 mawilk90 marked this pull request as ready for review May 4, 2026 07:59
@mawilk90 mawilk90 requested a review from a team as a code owner May 4, 2026 07:59
@mawilk90 mawilk90 requested review from a team, Copilot, dawiddzhafarov and mgwoj and removed request for a team May 4, 2026 07:59
@mawilk90 mawilk90 requested review from a team and zliang-akamai and removed request for a team and dawiddzhafarov May 4, 2026 08:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 expands the integration test suite for the SDK's Reserved IPv4 support, covering the new networking APIs plus cross-resource flows where reserved addresses can be tagged or attached to Linodes and NodeBalancers. It fits into the codebase by adding end-to-end coverage around the Reserved IP models and helpers that were recently added to the client, and it is explicitly stacked on top of linked PR #687.

Changes:

  • Adds shared integration fixtures for creating reserved IPs and reserved IPs assigned to a Linode.
  • Adds networking integration tests for reserved IP create/update/assign/allocate/type-conversion flows.
  • Adds cross-resource reserved IP coverage for tags, NodeBalancers, Linode allocation, and interface-based instance creation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
test/integration/conftest.py Adds reusable fixtures for creating standalone and assigned Reserved IPv4 addresses.
test/integration/models/networking/test_networking.py Adds the main Reserved IPv4 integration coverage and shared assertion helpers.
test/integration/models/nodebalancer/test_nodebalancer.py Adds NodeBalancer creation coverage using a reserved IPv4 address.
test/integration/models/linode/test_linode.py Adds coverage for attaching an existing reserved IPv4 to a Linode.
test/integration/models/linode/interfaces/test_interfaces.py Adds reserved IPv4 coverage for both legacy and Linode interface-generation instance creates.
test/integration/models/tag/test_tag.py Adds tag retrieval coverage for reserved IPv4 tagged objects.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/integration/conftest.py
Comment thread test/integration/models/networking/test_networking.py
Comment thread test/integration/models/networking/test_networking.py
Comment thread test/integration/models/networking/test_networking.py
Comment thread test/integration/models/networking/test_networking.py Outdated
Comment thread test/integration/conftest.py
Comment thread test/integration/models/nodebalancer/test_nodebalancer.py Outdated
@mawilk90 mawilk90 force-pushed the feature/TPT-4285-python-sdk-implement-integration-tests-for-reserved-ip-for-ipv4 branch from b6cff8d to 4b0f363 Compare May 11, 2026 13:22
@mawilk90 mawilk90 requested a review from a team as a code owner May 11, 2026 13:22
@mawilk90 mawilk90 requested review from ckulinsk and removed request for a team May 11, 2026 13:22
@mawilk90 mawilk90 changed the title TPS-4285: Implement integration tests for ReservedIP for IPv4 TPT-4285: Implement integration tests for ReservedIP for IPv4 May 11, 2026
dependabot Bot and others added 2 commits May 12, 2026 09:13
…e#695)

Bumps [actions/dependency-review-action](https://github.com/actions/dependency-review-action) from 4 to 5.
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](actions/dependency-review-action@v4...v5)

---
updated-dependencies:
- dependency-name: actions/dependency-review-action
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@mawilk90 mawilk90 removed the do-not-merge PRs that should not be merged until the commented issue is resolved label May 12, 2026
@mawilk90 mawilk90 force-pushed the feature/TPT-4285-python-sdk-implement-integration-tests-for-reserved-ip-for-ipv4 branch from 4b0f363 to b9ca4cf Compare May 12, 2026 13:19
…lement-integration-tests-for-reserved-ip-for-ipv4
@mawilk90 mawilk90 requested review from psnoch-akamai and removed request for ckulinsk May 13, 2026 13:03
@zliang-akamai zliang-akamai requested a review from Copilot May 18, 2026 23:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 9 out of 9 changed files in this pull request and generated 8 comments.

Comment thread test/integration/models/networking/test_networking.py
Comment thread test/integration/conftest.py
Comment thread test/integration/models/networking/test_networking.py
Comment thread test/integration/models/nodebalancer/test_nodebalancer.py
Comment thread test/integration/models/nodebalancer/test_nodebalancer.py Outdated
Comment thread test/integration/models/tag/test_tag.py Outdated
Comment thread test/integration/conftest.py
Comment thread test/integration/models/linode/interfaces/test_interfaces.py Outdated
Comment thread test/integration/models/linode/interfaces/test_interfaces.py Outdated
Comment thread test/integration/models/networking/test_networking.py Outdated
Comment thread test/integration/models/networking/test_networking.py Outdated
linode_ips[0].assigned_entity.url == f"/v4/linode/instances/{linode.id}"
)

linode.delete()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we use fixture pattern to ensure the Linode is deleted even if the test failed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @zliang-akamai , in this case linode.delete() is used as a part of the test logic (linode.delete() impacts the reserved IPs list for further assertions). To avoid refactoring the whole test I can use try-finally, to be sure that linode.delete() is executed even if there is any failing assertion before, for example:

    linode = create_linode_fn(client, reserved_ip, label, e2e_test_firewall)

    try:
        linode_ips = linode.ips.ipv4.public
        assert len(linode_ips) == 1
        assert linode_ips[0].address == reserved_ip.address
        [...]
    finally:
        linode.delete()

Does it make sense?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, that will work too I think.

@zliang-akamai zliang-akamai Jun 8, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

And I am wondering if we can implement a context manager for use case like this. (optional, but it's something fun in Python world)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I checked and context manager also works here. However, I decided to use simple try-finally as it is more readable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature for new features in the changelog. testing for updates to the testing suite in the changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants