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: replace echo -n with echo ...\c in test #11576

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/argoexec/commands/emissary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestEmissary(t *testing.T) {
})
t.Run("Sub-process", func(t *testing.T) {
_ = os.Remove(varRunArgo + "/ctr/main/stdout")
err := run("(sleep 60; echo 'should not wait for sub-process')& echo -n hello")
err := run(`(sleep 60; echo 'should not wait for sub-process')& echo "hello\c"`)

Choose a reason for hiding this comment

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

For other readers, note that \c is equivalent to the -n flag. They both mean to not output a trailing newline

assert.NoError(t, err)
data, err := os.ReadFile(varRunArgo + "/ctr/main/stdout")
assert.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion workflow/executor/os-specific/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func TestSimpleStartCloser(t *testing.T) {
cmd := exec.Command("sh", "-c", "echo -n A123456789B123456789C123456789D123456789E123456789")
cmd := exec.Command("sh", "-c", `echo "A123456789B123456789C123456789D123456789E123456789\c"`)
var stdoutWriter bytes.Buffer
slowWriter := SlowWriter{
&stdoutWriter,
Expand Down