PULUMI_CONFIG env variable is not used with PulumiTest
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 85
- Forks
- 26
- Avg merge
- 11h 49m
- Merged PRs (30d)
- 22
Description
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading PulumiTestInternal and Config.parse, focusing on how the default configuration is initialized when PulumiTest runs. Use the Java example with PULUMI_CONFIG as the regression case, and confirm that ctx.config().get("the_environment") reads the supplied value instead of an empty configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100