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

fix(controller): prepend script path to the script template args. Resolves #4481 #4492

Merged
merged 6 commits into from Nov 10, 2020
Merged

Conversation

ghost
Copy link

@ghost ghost commented Nov 8, 2020

Signed-off-by: ivancili [email protected]

Checklist:

Resolves #4481

@alexec alexec linked an issue Nov 9, 2020 that may be closed by this pull request
@ghost ghost marked this pull request as ready for review November 10, 2020 00:47
Copy link
Author

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexec The function extractMainCtrFromScriptTemplate that I wrote could also be used by the test TestScriptTemplateWithoutVolumeOptionalArtifact, which was previously written inside workflowpod_test.go. Let me know if you want me to update the PR with those changes.

@@ -69,6 +69,87 @@ func TestScriptTemplateWithVolume(t *testing.T) {
assert.NoError(t, err)
}

var scriptTemplateWithArgsAndWithSource = `
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I'd never say this, but there is a first time for everything.

I think you've written TOO many tests.

I think you only need to test `extractMainCtrFromScriptTemplate.

Copy link
Author

@ghost ghost Nov 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha yeah probably, no problem I'll delete those that don't test extractMainCtrFromScriptTemplate explicitly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool - I'll mark this as "Draft" while you do that

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you go, I left only 2 tests which cover extractMainCtrFromScriptTemplate. One for when script source is specified, and the other one when the source is empty.

@ghost
Copy link
Author

ghost commented Nov 10, 2020

So I deleted those unnecessary tests that you pointed out, and now some existing tests that were passing before are failing. And everything is passing locally.

@alexec alexec marked this pull request as draft November 10, 2020 16:43
@alexec alexec changed the title fix(controller): prepend script path to the script template args (solves #4481) fix(controller): prepend script path to the script template args. Resolves #4481 Nov 10, 2020
@ghost ghost marked this pull request as ready for review November 10, 2020 18:37
Copy link
Contributor

@alexec alexec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Weird argument arrangement when using script template
1 participant