From c69697e5a38e0c8a7ce884f7a30f9c1b4e04bd34 Mon Sep 17 00:00:00 2001 From: Will Jones Date: Fri, 3 Jan 2025 16:52:03 +0000 Subject: [PATCH] Unskip the `l1-builtin-info` test Since the addition of an overload for exporting plain outputs in #1541, this test now passes. Unskip it so that we can further improve the coverage of the Java language host. --- pkg/cmd/pulumi-language-java/language_test.go | 1 - .../projects/l1-builtin-info/Pulumi.yaml | 2 + .../testdata/projects/l1-builtin-info/pom.xml | 95 +++++++++++++++++++ .../src/main/java/generated_program/App.java | 24 +++++ 4 files changed, 121 insertions(+), 1 deletion(-) create mode 100644 pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/Pulumi.yaml create mode 100644 pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/pom.xml create mode 100644 pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/src/main/java/generated_program/App.java diff --git a/pkg/cmd/pulumi-language-java/language_test.go b/pkg/cmd/pulumi-language-java/language_test.go index b0789f05459..57df49465eb 100644 --- a/pkg/cmd/pulumi-language-java/language_test.go +++ b/pkg/cmd/pulumi-language-java/language_test.go @@ -160,7 +160,6 @@ func TestLanguage(t *testing.T) { // expectedFailures maps the set of conformance tests we expect to fail to reasons they currently do so, so that we may // skip them with an informative message until they are fixed. var expectedFailures = map[string]string{ - "l1-builtin-info": "unimplemented for Java", "l1-main": "unimplemented for Java", "l1-output-array": "unimplemented for Java", "l1-output-map": "unimplemented for Java", diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/Pulumi.yaml b/pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/Pulumi.yaml new file mode 100644 index 00000000000..20d82370673 --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/Pulumi.yaml @@ -0,0 +1,2 @@ +name: l1-builtin-info +runtime: java diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/pom.xml b/pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/pom.xml new file mode 100644 index 00000000000..8b85ed2aef6 --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/pom.xml @@ -0,0 +1,95 @@ + + + 4.0.0 + + com.pulumi + l1-builtin-info + 1.0-SNAPSHOT + + + UTF-8 + 11 + 11 + 11 + generated_program.App + + + + + + repository-0 + REPOSITORY + + + + + + com.pulumi + pulumi + CORE.VERSION + + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 3.2.2 + + + + true + ${mainClass} + + + + + + org.apache.maven.plugins + maven-assembly-plugin + 3.4.2 + + + + true + ${mainClass} + + + + jar-with-dependencies + + + + + make-my-jar-with-dependencies + package + + single + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.1.0 + + ${mainClass} + ${mainArgs} + + + + org.apache.maven.plugins + maven-wrapper-plugin + 3.1.1 + + 3.8.5 + + + + + \ No newline at end of file diff --git a/pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/src/main/java/generated_program/App.java b/pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/src/main/java/generated_program/App.java new file mode 100644 index 00000000000..6d723af3a45 --- /dev/null +++ b/pkg/cmd/pulumi-language-java/testdata/projects/l1-builtin-info/src/main/java/generated_program/App.java @@ -0,0 +1,24 @@ +package generated_program; + +import com.pulumi.Context; +import com.pulumi.Pulumi; +import com.pulumi.core.Output; +import com.pulumi.deployment.Deployment; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Paths; + +public class App { + public static void main(String[] args) { + Pulumi.run(App::stack); + } + + public static void stack(Context ctx) { + ctx.export("stackOutput", Deployment.getInstance().getStackName()); + ctx.export("projectOutput", Deployment.getInstance().getProjectName()); + ctx.export("organizationOutput", Deployment.getInstance().getOrganizationName()); + } +}