Skip to content

TPT-3909: Integration tests for IAM volumes io_ready#934

Open
mawilk90 wants to merge 18 commits intolinode:mainfrom
mawilk90:feature/TPT-3909-iam-volumes-io-ready-add-integration-tests-for-sdks
Open

TPT-3909: Integration tests for IAM volumes io_ready#934
mawilk90 wants to merge 18 commits intolinode:mainfrom
mawilk90:feature/TPT-3909-iam-volumes-io-ready-add-integration-tests-for-sdks

Conversation

@mawilk90
Copy link
Copy Markdown
Contributor

@mawilk90 mawilk90 commented Apr 14, 2026

📝 Description

IAM team added io_ready field in responses from Volumes endpoints.

NOTE:

  1. PR directly to main because the developers code is already there
  2. Needs the iam_beta tag

✔️ How to Test

Without fixtures:
go test -count=1 ./test/integration/ -v -run TestIAM_GetIOReadyFor

Note: As it runs directly with go test you need to have LINODE_API_VERSION variable set in your local env

With fixtures:
make test-int TEST_ARGS="-run TestIAM_GetIOReadyFor"

@mawilk90 mawilk90 changed the title Feature/tpt 3909 iam volumes io ready add integration tests for sdks TPT-3909: Integration tests for IAM volumes io_ready Apr 14, 2026
@mawilk90 mawilk90 added new-feature for new features in the changelog. testing for updates to the testing suite in the changelog. do-not-merge PRs that should not be merged until the commented issue is resolved labels Apr 15, 2026
@mawilk90 mawilk90 marked this pull request as ready for review April 15, 2026 13:48
@mawilk90 mawilk90 requested review from a team as code owners April 15, 2026 13:48
@mawilk90 mawilk90 requested review from lgarber-akamai and removed request for a team April 15, 2026 13:48
Copy link
Copy Markdown
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

Adds integration test coverage for the new io_ready field returned by IAM-enabled Volumes endpoints, plus a helper wait function to poll until a volume reaches the desired io_ready state.

Changes:

  • Added Client.WaitForVolumeIOReadyStatus polling helper.
  • Extended existing volume update integration test to assert IOReady is false for unattached volumes.
  • Added new IAM-focused integration tests (with recorded fixtures) validating io_ready across list/get/attach/detach/update/resize scenarios (clone test currently skipped).

Reviewed changes

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

Show a summary per file
File Description
waitfor.go Adds a wait helper that polls volume io_ready until it matches an expected value.
test/integration/volumes_test.go Asserts IOReady is false after updating an unattached volume.
test/integration/iam_io_ready_test.go New IAM integration tests validating io_ready behavior across volume lifecycle operations (including a skipped clone test).
test/integration/fixtures/TestIAM_GetIOReadyForUpdatedVolume.yaml Recorded interactions including io_ready values for updated-volume scenario.
test/integration/fixtures/TestIAM_GetIOReadyForNotAttachedVolume.yaml Recorded interactions including io_ready values for unattached-volume scenario.

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

Comment thread test/integration/iam_io_ready_test.go Outdated
Comment thread test/integration/iam_io_ready_test.go Outdated
Comment thread waitfor.go Outdated
Comment thread test/integration/iam_io_ready_test.go
@mawilk90 mawilk90 removed the request for review from a team April 20, 2026 12:45
@mawilk90 mawilk90 removed the do-not-merge PRs that should not be merged until the commented issue is resolved label Apr 20, 2026
Comment thread test/integration/iam_io_ready_test.go

volumeList, err := client.ListVolumes(context.Background(), nil)
require.NoErrorf(t, err, "Error listing volumes: %v", err)
for _, vol := range volumeList {
Copy link
Copy Markdown
Contributor

@psnoch-akamai psnoch-akamai Apr 22, 2026

Choose a reason for hiding this comment

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

I would move this loop to function like "findVolumeById" and use returned value for assertions

Copy link
Copy Markdown
Contributor Author

@mawilk90 mawilk90 Apr 22, 2026

Choose a reason for hiding this comment

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

Is it necessary to extract it to a separate function if it is used only once here? Or you mean to have it for possible future usage?

Comment thread test/integration/iam_io_ready_test.go Outdated
assert.Equal(t, volume.Region, volumeCloned.Region)
assert.Equal(t, volume.Size, volumeCloned.Size)
// Cloned volume should not be attached to instance automatically
requireSingleAttachedInstanceVolume(t, client, instance)
Copy link
Copy Markdown
Contributor

@psnoch-akamai psnoch-akamai Apr 22, 2026

Choose a reason for hiding this comment

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

How about waiting procedure here? How long does it take?

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.

If I got it right, you meant that client.ListInstanceVolumes (used inside of requireSingleAttachedInstanceVolume) may take longer than expected and fail due to timeout, right?

Comment thread waitfor.go Outdated
@mawilk90 mawilk90 force-pushed the feature/TPT-3909-iam-volumes-io-ready-add-integration-tests-for-sdks branch from b5c0293 to fa32e1a Compare April 22, 2026 14:59
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.

3 participants