TPT-3909: Integration tests for IAM volumes io_ready#934
TPT-3909: Integration tests for IAM volumes io_ready#934mawilk90 wants to merge 18 commits intolinode:mainfrom
Conversation
There was a problem hiding this comment.
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.WaitForVolumeIOReadyStatuspolling helper. - Extended existing volume update integration test to assert
IOReadyis false for unattached volumes. - Added new IAM-focused integration tests (with recorded fixtures) validating
io_readyacross 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.
…tegration-tests-for-sdks
…tegration-tests-for-sdks
|
|
||
| volumeList, err := client.ListVolumes(context.Background(), nil) | ||
| require.NoErrorf(t, err, "Error listing volumes: %v", err) | ||
| for _, vol := range volumeList { |
There was a problem hiding this comment.
I would move this loop to function like "findVolumeById" and use returned value for assertions
There was a problem hiding this comment.
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?
| 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) |
There was a problem hiding this comment.
How about waiting procedure here? How long does it take?
There was a problem hiding this comment.
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?
b5c0293 to
fa32e1a
Compare
📝 Description
IAM team added
io_readyfield in responses from Volumes endpoints.NOTE:
mainbecause the developers code is already thereiam_betatag✔️ How to Test
Without fixtures:
go test -count=1 ./test/integration/ -v -run TestIAM_GetIOReadyForNote: As it runs directly with
go testyou need to haveLINODE_API_VERSIONvariable set in your local envWith fixtures:
make test-int TEST_ARGS="-run TestIAM_GetIOReadyFor"