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

Command Scripts from TestSuite or TestStep #117

Merged
merged 3 commits into from
May 22, 2020
Merged

Command Scripts from TestSuite or TestStep #117

merged 3 commits into from
May 22, 2020

Conversation

kensipe
Copy link
Member

@kensipe kensipe commented May 22, 2020

Previously scripts added to command: would fail such as:

commands:
  - command: for i in {1..5}; do echo $NAMESPACE; done
  - command: sh -c "for i in {1..5}; do echo $NAMESPACE; done"

Both of these options fail... to provide some ability to script a script: is provided as a commands option such as:

commands:
  - script: for i in {1..5}; do echo $NAMESPACE; done

This works for TestSuite and TestStep

Fixes: #50

Co-authored-by: Marcin Owsiany mowsiany@D2iQ.com
Co-authored-by: Andreas Neumann aneumann@mesosphere.com
Signed-off-by: Ken Sipe kensipe@gmail.com

…tl get ns foo; do sleep 1; done

Signed-off-by: Ken Sipe <kensipe@gmail.com>

adding script capabilities

Signed-off-by: Ken Sipe <kensipe@gmail.com>
Signed-off-by: Ken Sipe <kensipe@gmail.com>
Copy link
Member

@porridge porridge left a comment

Choose a reason for hiding this comment

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

Does it work on Windows? Should it use sh there?
Should we explicitly mention that namespaced does not apply in this case?
Not sure about the environment expansion. I'd mention that it is up to the shell in this case, as opposed to command where we do it, but I don't see it mentioned either.

pkg/apis/testharness/v1beta1/test_types.go Outdated Show resolved Hide resolved
pkg/test/utils/kubernetes.go Outdated Show resolved Hide resolved
Copy link
Member

@ANeumann82 ANeumann82 left a comment

Choose a reason for hiding this comment

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

lgtm, I would add one more check to prevent script and namespaced to be used together

pkg/test/utils/kubernetes.go Show resolved Hide resolved
Signed-off-by: Ken Sipe <kensipe@gmail.com>
@kensipe kensipe merged commit 5e3968d into master May 22, 2020
@kensipe kensipe deleted the ken/cmd-script branch May 22, 2020 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "script" setting to commands that runs as a bash script
3 participants