@@ -555,6 +555,83 @@ func TestE2eTs(t *testing.T) {
555
555
}
556
556
}
557
557
558
+ func TestE2eDotnet (t * testing.T ) {
559
+
560
+ type testCase struct {
561
+ name string // Must be same as project folder in testdata/programs/python
562
+ moduleName string
563
+ moduleVersion string
564
+ moduleNamespace string
565
+ previewExpect map [apitype.OpType ]int
566
+ upExpect map [string ]int
567
+ deleteExpect map [string ]int
568
+ diffNoChangesExpect map [apitype.OpType ]int
569
+ }
570
+
571
+ testcases := []testCase {
572
+ {
573
+ name : "s3bucketmod" ,
574
+ moduleName : "terraform-aws-modules/s3-bucket/aws" ,
575
+ moduleVersion : "4.5.0" ,
576
+ moduleNamespace : "bucket" ,
577
+ previewExpect : map [apitype.OpType ]int {
578
+ apitype .OpType ("create" ): 5 ,
579
+ },
580
+ upExpect : map [string ]int {
581
+ "create" : 5 ,
582
+ },
583
+ deleteExpect : map [string ]int {
584
+ "delete" : 5 ,
585
+ },
586
+ diffNoChangesExpect : map [apitype.OpType ]int {
587
+ apitype .OpType ("same" ): 5 ,
588
+ },
589
+ },
590
+ }
591
+
592
+ for _ , tc := range testcases {
593
+ tc := tc
594
+ localProviderBinPath := ensureCompiledProvider (t )
595
+ skipLocalRunsWithoutCreds (t )
596
+ t .Run (tc .name , func (t * testing.T ) {
597
+ testProgram := filepath .Join ("testdata" , "programs" , "dotnet" , tc .name )
598
+ integrationTest := pulumitest .NewPulumiTest (
599
+ t ,
600
+ testProgram ,
601
+ opttest .LocalProviderPath ("terraform-module" , filepath .Dir (localProviderBinPath )),
602
+ opttest .SkipInstall (),
603
+ )
604
+
605
+ // Get a prefix for resource names
606
+ prefix := generateTestResourcePrefix ()
607
+
608
+ // Set prefix via config
609
+ integrationTest .SetConfig (t , "prefix" , prefix )
610
+
611
+ // Generate package
612
+ pulumiPackageAdd (
613
+ t ,
614
+ integrationTest ,
615
+ localProviderBinPath ,
616
+ tc .moduleName ,
617
+ tc .moduleVersion ,
618
+ tc .moduleNamespace )
619
+
620
+ previewResult := integrationTest .Preview (t )
621
+ autogold .Expect (tc .previewExpect ).Equal (t , previewResult .ChangeSummary )
622
+
623
+ upResult := integrationTest .Up (t )
624
+ autogold .Expect (& tc .upExpect ).Equal (t , upResult .Summary .ResourceChanges )
625
+
626
+ previewResult = integrationTest .Preview (t )
627
+ autogold .Expect (tc .diffNoChangesExpect ).Equal (t , previewResult .ChangeSummary )
628
+
629
+ destroyResult := integrationTest .Destroy (t )
630
+ autogold .Expect (& tc .deleteExpect ).Equal (t , destroyResult .Summary .ResourceChanges )
631
+ })
632
+ }
633
+ }
634
+
558
635
func TestE2ePython (t * testing.T ) {
559
636
560
637
type testCase struct {
0 commit comments