@@ -65,9 +65,7 @@ func TestVolume_Create_withEncryption(t *testing.T) {
6565 }
6666
6767 volume , err = client .WaitForVolumeStatus (ctx , volume .ID , linodego .VolumeActive )
68- if err != nil {
69- t .Errorf ("Error waiting for volume to be active: %v" , err )
70- }
68+ require .NoErrorf (t , err , "Error waiting for volume to be active: %v" , err )
7169
7270 assertDateSet (t , volume .Created )
7371 assertDateSet (t , volume .Updated )
@@ -90,9 +88,7 @@ func TestVolume_Resize(t *testing.T) {
9088 }
9189
9290 _ , err = client .WaitForVolumeStatus (ctx , volume .ID , linodego .VolumeActive )
93- if err != nil {
94- t .Errorf ("Error waiting for volume to be active, %s" , err )
95- }
91+ require .NoErrorf (t , err , "Error waiting for volume to be active: %v" , err )
9692
9793 opts := linodego.VolumeResizeOptions {
9894 Size : volume .Size + 1 ,
@@ -102,17 +98,13 @@ func TestVolume_Resize(t *testing.T) {
10298 }
10399
104100 volume , err = client .WaitForVolumeStatus (ctx , volume .ID , linodego .VolumeActive )
105- if err != nil {
106- t .Errorf ("Error waiting for volume to be active: %v" , err )
107- }
101+ require .NoErrorf (t , err , "Error waiting for volume to be active: %v" , err )
108102}
109103
110104func TestVolumes_List_smoke (t * testing.T ) {
111105 client , volume , teardown , err := setupVolume (t , "fixtures/TestVolume_List" )
112106 defer teardown ()
113- if err != nil {
114- t .Errorf ("Error setting up volume test, %s" , err )
115- }
107+ require .NoErrorf (t , err , "Error setting up volume test, %s" , err )
116108
117109 volumes , err := client .ListVolumes (context .Background (), nil )
118110 if err != nil {
@@ -167,9 +159,7 @@ func TestVolume_Get_withEncryption(t *testing.T) {
167159 }
168160
169161 volume , err = client .WaitForVolumeStatus (ctx , volume .ID , linodego .VolumeActive )
170- if err != nil {
171- t .Errorf ("Error waiting for volume to be active: %v" , err )
172- }
162+ require .NoErrorf (t , err , "Error waiting for volume to be active: %v" , err )
173163
174164 returnedVolume , err := client .GetVolume (context .Background (), volume .ID )
175165 if err != nil {
@@ -180,9 +170,7 @@ func TestVolume_Get_withEncryption(t *testing.T) {
180170 }
181171
182172 volumes , err := client .ListVolumes (context .Background (), nil )
183- if err != nil {
184- t .Errorf ("Error listing volumes, expected struct, got error %v" , err )
185- }
173+ require .NoErrorf (t , err , "Error listing volumes, expected struct, got error %v" , err )
186174 found := false
187175 for _ , v := range volumes {
188176 if v .ID == volume .ID {
@@ -310,9 +298,7 @@ func setupVolume(t *testing.T, fixturesYaml string) (*linodego.Client, *linodego
310298 }
311299
312300 volume , err = client .WaitForVolumeStatus (ctx , volume .ID , linodego .VolumeActive )
313- if err != nil {
314- t .Errorf ("Error waiting for volume to be active: %v" , err )
315- }
301+ require .NoErrorf (t , err , "Error waiting for volume to be active: %v" , err )
316302
317303 teardown := func () {
318304 // volumes deleted too fast tend to stick, adding a few seconds to catch up
0 commit comments