forked from hashicorp/waypoint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
addons: Add add-on update test to state tests.
- Loading branch information
1 parent
79a1954
commit 7acf45b
Showing
1 changed file
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,7 +190,7 @@ My favorite add-on README. | |
CreatedBy: "[email protected]", | ||
} | ||
|
||
t.Run("Create, get, and delete Add-on", func(t *testing.T) { | ||
t.Run("Create, get, update, and delete Add-on", func(t *testing.T) { | ||
// Create an add-on definition | ||
addOnDefinition, err := s.AddOnDefinitionPut(ctx, testAddOnDefinition) | ||
require.NoError(err) | ||
|
@@ -218,17 +218,31 @@ My favorite add-on README. | |
require.Equal(testAddOn.TerraformNocodeModule.Source, actualAddOn.TerraformNocodeModule.Source) | ||
require.Equal(testAddOn.TerraformNocodeModule.Version, actualAddOn.TerraformNocodeModule.Version) | ||
|
||
updatedAddOnName := "your updated friendly neighborhood add-on" | ||
updatedAddOn, err := s.AddOnUpdate(ctx, | ||
&pb.AddOn{ | ||
Name: updatedAddOnName, | ||
}, | ||
&pb.Ref_AddOn{ | ||
Identifier: &pb.Ref_AddOn_Name{ | ||
Name: testAddOn.Name, | ||
}, | ||
}, | ||
) | ||
require.NoError(err) | ||
require.NotNil(updatedAddOn) | ||
|
||
err = s.AddOnDelete(ctx, &pb.Ref_AddOn{ | ||
Identifier: &pb.Ref_AddOn_Name{ | ||
Name: testAddOn.Name, | ||
Name: updatedAddOnName, | ||
}, | ||
}) | ||
require.NoError(err) | ||
|
||
// Verify Add-On is deleted | ||
actualAddOn, err = s.AddOnGet(ctx, &pb.Ref_AddOn{ | ||
Identifier: &pb.Ref_AddOn_Name{ | ||
Name: testAddOn.Name, | ||
Name: updatedAddOnName, | ||
}, | ||
}) | ||
// expecting a not found error | ||
|