@@ -7,105 +7,27 @@ import (
7
7
"path"
8
8
"testing"
9
9
10
+ "github.com/pulumi/examples/misc/test/definitions"
11
+ "github.com/pulumi/examples/misc/test/helpers"
10
12
"github.com/pulumi/pulumi/pkg/v3/testing/integration"
11
- "github.com/stretchr/testify/assert"
12
13
)
13
14
14
- func TestAccAzureClassicCsWebserver (t * testing.T ) {
15
- test := getAzureBase (t ).
16
- With (integration.ProgramTestOptions {
17
- Dir : path .Join (getCwd (t ), ".." , ".." , "classic-azure-cs-webserver" ),
18
- ExtraRuntimeValidation : func (t * testing.T , stack integration.RuntimeValidationStackInfo ) {
19
- assertHTTPResult (t , stack .Outputs ["IpAddress" ].(string ), nil , func (body string ) bool {
20
- return assert .Contains (t , body , "Hello, World" )
21
- })
22
- },
23
- })
24
-
25
- integration .ProgramTest (t , & test )
26
- }
27
-
28
- func TestAccAzureClassicFsAppService (t * testing.T ) {
29
- test := getAzureBase (t ).
30
- With (integration.ProgramTestOptions {
31
- Dir : path .Join (getCwd (t ), ".." , ".." , "classic-azure-fs-appservice" ),
32
- Config : map [string ]string {
33
- "sqlPassword" : "2@Password@2" ,
34
- },
35
- ExtraRuntimeValidation : func (t * testing.T , stack integration.RuntimeValidationStackInfo ) {
36
- assertAppServiceResult (t , stack .Outputs ["endpoint" ], func (body string ) bool {
37
- return assert .Contains (t , body , "Greetings from Azure App Service" )
38
- })
39
- },
40
- })
41
-
42
- integration .ProgramTest (t , & test )
43
- }
44
-
45
- func TestAccAzureClassicGoWebserverComponent (t * testing.T ) {
46
- test := getAzureBase (t ).
47
- With (integration.ProgramTestOptions {
48
- Dir : path .Join (getCwd (t ), ".." , ".." , "classic-azure-go-webserver-component" ),
49
- Config : map [string ]string {
50
- "username" : "webmaster" ,
51
- "password" : "Password1234!" ,
52
- },
53
- })
54
-
55
- integration .ProgramTest (t , & test )
56
- }
57
-
58
- func TestAccAzureClassicPyArmTemplate (t * testing.T ) {
59
- test := getAzureBase (t ).
60
- With (integration.ProgramTestOptions {
61
- Dir : path .Join (getCwd (t ), ".." , ".." , "classic-azure-py-arm-template" ),
62
- })
63
-
64
- integration .ProgramTest (t , & test )
65
- }
66
-
67
- func TestAccAzureClassicPyVmScaleSet (t * testing.T ) {
68
- test := getAzureBase (t ).
69
- With (integration.ProgramTestOptions {
70
- Dir : path .Join (getCwd (t ), ".." , ".." , "classic-azure-py-vm-scaleset" ),
71
- ExtraRuntimeValidation : func (t * testing.T , stack integration.RuntimeValidationStackInfo ) {
72
- assertHTTPResult (t , stack .Outputs ["public_address" ].(string ), nil , func (body string ) bool {
73
- return assert .Contains (t , body , "nginx" )
74
- })
75
- },
76
- })
77
-
78
- integration .ProgramTest (t , & test )
79
- }
80
-
81
- func TestAccAzureClassicTsArmTemplate (t * testing.T ) {
82
- test := getAzureBase (t ).
83
- With (integration.ProgramTestOptions {
84
- Dir : path .Join (getCwd (t ), ".." , ".." , "classic-azure-ts-arm-template" ),
85
- })
86
-
87
- integration .ProgramTest (t , & test )
88
- }
89
-
90
- func TestAccAzureClassicTsStreamAnalytics (t * testing.T ) {
91
- test := getAzureBase (t ).
92
- With (integration.ProgramTestOptions {
93
- Dir : path .Join (getCwd (t ), ".." , ".." , "classic-azure-ts-stream-analytics" ),
94
- })
95
-
96
- integration .ProgramTest (t , & test )
15
+ func TestAccAzureClassic (t * testing.T ) {
16
+ for _ , examples := range definitions .GetTestsForTag ("azure" ) {
17
+ for _ , example := range examples {
18
+ run (t , example )
19
+ }
20
+ }
97
21
}
98
22
99
- func TestAccAzureClassicTsVmScaleset (t * testing.T ) {
100
- test := getAzureBase (t ).
101
- With (integration.ProgramTestOptions {
102
- Dir : path .Join (getCwd (t ), ".." , ".." , "classic-azure-ts-vm-scaleset" ),
103
- ExtraRuntimeValidation : func (t * testing.T , stack integration.RuntimeValidationStackInfo ) {
104
- assertHTTPResult (t , stack .Outputs ["publicAddress" ].(string ), nil , func (body string ) bool {
105
- return assert .Contains (t , body , "nginx" )
106
- })
107
- },
108
- })
23
+ func run (t * testing.T , e definitions.ExampleTest ) {
24
+ t .Run (e .Dir , func (t * testing.T ) {
25
+ test := getAzureBase (t ).
26
+ With (e .Options ).
27
+ With (integration.ProgramTestOptions {
28
+ Dir : path .Join (helpers .GetCwd (t ), ".." , ".." , ".." , e .Dir ),
29
+ })
109
30
110
- integration .ProgramTest (t , & test )
31
+ integration .ProgramTest (t , & test )
32
+ })
111
33
}
0 commit comments