Repository navigation
fixed: pass namespace files to cloudquery commands #190
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| package io.kestra.plugin.cloudquery; | ||
|
|
||
| import java.io.ByteArrayInputStream; | ||
| import java.nio.file.Path; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
||
|
|
@@ -8,6 +10,7 @@ | |
|
|
||
| import io.kestra.core.junit.annotations.KestraTest; | ||
| import io.kestra.core.models.property.Property; | ||
| import io.kestra.core.models.tasks.NamespaceFiles; | ||
| import io.kestra.core.runners.RunContext; | ||
| import io.kestra.core.runners.RunContextFactory; | ||
| import io.kestra.core.utils.IdUtils; | ||
|
|
@@ -55,4 +58,29 @@ void run() throws Exception { | |
| assertThat(runOutput.getVars().get("customEnv"), is(envValue)); | ||
|
|
||
| } | ||
| } | ||
|
|
||
| @Test | ||
| void namespaceFiles() throws Exception { | ||
| CloudQueryCLI execute = CloudQueryCLI.builder() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟢 [Guidelines] Use var for locals in the new test
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok will cross check and fix it |
||
| .id(IdUtils.create()) | ||
| .type(CloudQueryCLI.class.getName()) | ||
| .namespaceFiles( | ||
| NamespaceFiles.builder() | ||
| .enabled(Property.ofValue(true)) | ||
| .build() | ||
| ) | ||
| .commands(Property.ofValue(List.of("test -f config.yml"))) | ||
| .build(); | ||
|
|
||
| RunContext runContext = TestsUtils.mockRunContext(runContextFactory, execute, Map.of()); | ||
|
|
||
| runContext.storage().namespace().putFile( | ||
| Path.of("config.yml"), | ||
| new ByteArrayInputStream("kind: source".getBytes()) | ||
| ); | ||
|
|
||
| ScriptOutput runOutput = execute.run(runContext); | ||
|
|
||
| assertThat(runOutput.getExitCode(), is(0)); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.