Skip to content

Commit ac5c0af

Browse files
Add tests
1 parent 5152a18 commit ac5c0af

File tree

5 files changed

+1261
-334
lines changed

5 files changed

+1261
-334
lines changed

v2/internal/controllers/crd_batch_account_test.go renamed to v2/internal/controllers/batch_account_crud_v20210101_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/Azure/azure-service-operator/v2/internal/testcommon"
1515
)
1616

17-
func Test_Batch_Account_CRUD(t *testing.T) {
17+
func Test_Batch_Account_CRUD_v20210101(t *testing.T) {
1818
t.Parallel()
1919

2020
tc := globalTestContext.ForTest(t)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
Copyright (c) Microsoft Corporation.
3+
Licensed under the MIT license.
4+
*/
5+
6+
package controllers_test
7+
8+
import (
9+
"testing"
10+
11+
. "github.com/onsi/gomega"
12+
13+
batch "github.com/Azure/azure-service-operator/v2/api/batch/v20240701"
14+
"github.com/Azure/azure-service-operator/v2/internal/testcommon"
15+
)
16+
17+
func Test_Batch_Account_CRUD_v20240701(t *testing.T) {
18+
t.Parallel()
19+
20+
tc := globalTestContext.ForTest(t)
21+
22+
rg := tc.CreateTestResourceGroupAndWait()
23+
24+
account := &batch.BatchAccount{
25+
ObjectMeta: tc.MakeObjectMetaWithName(tc.NoSpaceNamer.GenerateName("batchacc")),
26+
Spec: batch.BatchAccount_Spec{
27+
Location: tc.AzureRegion,
28+
Owner: testcommon.AsOwner(rg),
29+
},
30+
}
31+
32+
tc.CreateResourceAndWait(account)
33+
34+
tc.Expect(account.Status.Id).ToNot(BeNil())
35+
armId := *account.Status.Id
36+
37+
tc.DeleteResourceAndWait(account)
38+
39+
// Ensure that the account was really deleted in Azure
40+
exists, retryAfter, err := tc.AzureClient.CheckExistenceWithGetByID(tc.Ctx, armId, string(batch.APIVersion_Value))
41+
tc.Expect(err).ToNot(HaveOccurred())
42+
tc.Expect(retryAfter).To(BeZero())
43+
tc.Expect(exists).To(BeFalse())
44+
}

v2/internal/controllers/recordings/Test_Batch_Account_CRUD.yaml

Lines changed: 0 additions & 333 deletions
This file was deleted.

0 commit comments

Comments
 (0)