Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PULUMI_CONFIG env variable is not used with PulumiTest #1333

Open
imavroukakis opened this issue Mar 17, 2024 · 6 comments
Open

PULUMI_CONFIG env variable is not used with PulumiTest #1333

imavroukakis opened this issue Mar 17, 2024 · 6 comments
Labels
area/testing kind/bug Some behavior is incorrect or out of spec

Comments

@imavroukakis
Copy link

imavroukakis commented Mar 17, 2024

What happened?

Trying to use a configuration JSON during testing via the environment variable at runtime - as is the case with the implementation in other languages.

Example

Given '{"project:the_environment": "devtest"}' stored in PULUMI_CONFIG

final var config = ctx.config();
final var environment = config.get("the_environment")

fails when testing via PulumiTest

Output of pulumi about

CLI
Version      3.108.1
Go Version   go1.22.0
Go Compiler  gc

Plugins
NAME        VERSION
aws         6.18.2
aws-native  0.95.0
java        unknown

Host
OS       darwin
Version  14.4
Arch     x86_64

Additional context

Instead of initialising an empty config in PulumiTestInternal

if (this.config == null) {
                this.config = new DeploymentImpl.Config(ImmutableMap.of(), ImmutableSet.of());
}

it should be possible and safe to do

if (this.config == null) {
                this.config = Config.parse();
}

instead.

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@imavroukakis imavroukakis added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Mar 17, 2024
@justinvp justinvp added area/testing and removed needs-triage Needs attention from the triage team labels Mar 27, 2024
@justinvp
Copy link
Member

@imavroukakis, thanks for opening the issue. Would you be interested in contributing a fix?

@imavroukakis
Copy link
Author

@justinvp happy to!

@imavroukakis
Copy link
Author

apologies for taking so long, will have a pull request soon !

@imavroukakis
Copy link
Author

hey @justinvp , I have made the change but I cannot for the life of me figure out how unit tests are run for the java repo, any doco I could perhaps reference?

@joaotab
Copy link

joaotab commented Aug 8, 2024

hey @imavroukakis I'm not a contributor to this project but I was also looking for this to work since right now it seems we can't run Unit Tests in Java that require any sort of Pulumi config.

Anything I can help you with? Looks like Make is used as a build tool and there are some go command line examples in the Makefile for running tests.

@imavroukakis
Copy link
Author

Hey @joaotab I want to actually run the Java side of the tests but they seem to blow up in unrelated places. The aim here is to
a) make sure the existing tests are not broken
b) if they break , fix them
c) add tests for the new functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants