Skip to content

Commit

Permalink
Add generated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aq17 committed Nov 1, 2022
1 parent 78ec30f commit 1dfcb7e
Show file tree
Hide file tree
Showing 21 changed files with 238,961 additions and 6 deletions.
21 changes: 20 additions & 1 deletion pkg/codegen/java/gen_program_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ type PclTestFile struct {
var testdataPath = filepath.Join("..", "testing", "test", "testdata")
var transpiledExamplesDir = "transpiled_examples"

var skipGenerationTests = []string{
"azure-container-apps",
"getting-started",
"pulumi-variable",
}

func skipGeneration(test string) bool {
for _, t := range skipGenerationTests {
if t == test {
return true
}
}
return false
}

func TestGenerateJavaProgram(t *testing.T) {
t.Parallel()

Expand All @@ -31,8 +46,12 @@ func TestGenerateJavaProgram(t *testing.T) {
files, err := os.ReadDir(syncDir)
assert.NoError(t, err)
for _, f := range files {
name := strings.TrimSuffix(f.Name(), "-pp")
if skipGeneration(name) {
continue
}
tests = append(tests, test.ProgramTest{
Directory: filepath.Join(transpiledExamplesDir, strings.TrimSuffix(f.Name(), "-pp")),
Directory: filepath.Join(transpiledExamplesDir, name),
})
}
continue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.pulumi.aws.ec2.SecurityGroupArgs;
import com.pulumi.aws.ec2.inputs.SecurityGroupIngressArgs;
import com.pulumi.aws.AwsFunctions;
import com.pulumi.aws.inputs.GetAmiArgs;
import com.pulumi.aws.ec2.inputs.GetAmiArgs;
import com.pulumi.aws.ec2.Instance;
import com.pulumi.aws.ec2.InstanceArgs;
import java.util.List;
Expand Down
Loading

0 comments on commit 1dfcb7e

Please sign in to comment.