Skip to content

Commit

Permalink
test: Add v1beta1 testing for launch template tests (#4640)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis committed Sep 18, 2023
1 parent bd45614 commit 9e60ca7
Show file tree
Hide file tree
Showing 21 changed files with 3,421 additions and 1,743 deletions.
4 changes: 2 additions & 2 deletions pkg/apis/v1beta1/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ var _ = Describe("Validation", func() {
Context("EC2NodeClass Hash", func() {
var nodeClass *v1beta1.EC2NodeClass
BeforeEach(func() {
nodeClass = test.NodeClass(v1beta1.EC2NodeClass{
nodeClass = test.EC2NodeClass(v1beta1.EC2NodeClass{
Spec: v1beta1.EC2NodeClassSpec{
AMIFamily: aws.String(v1alpha1.AMIFamilyAL2),
Context: aws.String("context-1"),
Expand Down Expand Up @@ -532,7 +532,7 @@ var _ = Describe("Validation", func() {
Expect(hash).To(Equal(updatedHash))
})
It("should expect two provisioner with the same spec to have the same provisioner hash", func() {
otherNodeClass := test.NodeClass(v1beta1.EC2NodeClass{
otherNodeClass := test.EC2NodeClass(v1beta1.EC2NodeClass{
Spec: nodeClass.Spec,
})
Expect(nodeClass.Hash()).To(Equal(otherNodeClass.Hash()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var _ = Describe("NodeClaim/GarbageCollection", func() {
BeforeEach(func() {
instanceID := fake.InstanceID()
providerID = fake.ProviderID(instanceID)
nodeClass = test.NodeClass()
nodeClass = test.EC2NodeClass()
nodePool := coretest.NodePool(corev1beta1.NodePool{
Spec: corev1beta1.NodePoolSpec{
Template: corev1beta1.NodeClaimTemplate{
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/nodeclaim/garbagecollection/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var _ = BeforeEach(func() {
var _ = Describe("Combined/GarbageCollection", func() {
var nodeClass *v1beta1.EC2NodeClass
BeforeEach(func() {
nodeClass = test.NodeClass()
nodeClass = test.EC2NodeClass()
})
It("should delete many instances if they all don't have NodeClaim or Machine owners", func() {
// Generate 100 instances that have different instanceIDs that should have NodeClaims
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/nodeclass/nodeclass_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
var _ = Describe("NodeClassController", func() {
var nodeClass *v1beta1.EC2NodeClass
BeforeEach(func() {
nodeClass = test.NodeClass(v1beta1.EC2NodeClass{
nodeClass = test.EC2NodeClass(v1beta1.EC2NodeClass{
Spec: v1beta1.EC2NodeClassSpec{
SubnetSelectorTerms: []v1beta1.SubnetSelectorTerm{
{
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/nodeclass/nodetemplate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ var _ = Describe("NodeTemplateController", func() {

Expect(nodeTemplate.ObjectMeta.Annotations[v1alpha1.AnnotationNodeTemplateHash]).To(Equal(expectedHash))
})
It("should maintain the same hash, before and after the NodeClass conversion", func() {
It("should maintain the same hash, before and after the EC2NodeClass conversion", func() {
hash := nodeTemplate.Hash()
nodeClass := nodeclassutil.New(nodeTemplate)
convertedHash := nodeclassutil.HashAnnotation(nodeClass)
Expand Down
2 changes: 1 addition & 1 deletion pkg/providers/amifamily/ami_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ var _ = Describe("AMIProvider", func() {
var version string
BeforeEach(func() {
version = lo.Must(awsEnv.VersionProvider.Get(ctx))
nodeClass = test.NodeClass()
nodeClass = test.EC2NodeClass()
})
It("should succeed to resolve AMIs (AL2)", func() {
nodeClass.Spec.AMIFamily = &v1beta1.AMIFamilyAL2
Expand Down

0 comments on commit 9e60ca7

Please sign in to comment.