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

chore(log): remove prefix out: and err: prefix #287

Merged
merged 1 commit into from
Nov 17, 2024
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
4 changes: 2 additions & 2 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,11 @@ loop:
break loop
case outline := <-stdoutChan:
if outline != "" {
p.log(host, "out:", outline)
p.log(host, outline)
}
case errline := <-stderrChan:
if errline != "" {
p.log(host, "err:", errline)
p.log(host, errline)
}
case err = <-errChan:
}
Expand Down
50 changes: 25 additions & 25 deletions plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,17 +365,17 @@ func TestCommandOutput(t *testing.T) {
whoami
uname
localhost: ======END======
localhost: out: /home/drone-scp
localhost: out: drone-scp
localhost: out: Linux
localhost: /home/drone-scp
localhost: drone-scp
localhost: Linux
127.0.0.1: ======CMD======
127.0.0.1: pwd
whoami
uname
127.0.0.1: ======END======
127.0.0.1: out: /home/drone-scp
127.0.0.1: out: drone-scp
127.0.0.1: out: Linux
127.0.0.1: /home/drone-scp
127.0.0.1: drone-scp
127.0.0.1: Linux
`
)

Expand Down Expand Up @@ -444,7 +444,7 @@ func TestFingerprint(t *testing.T) {
var (
buffer bytes.Buffer
expected = `
out: drone-scp
drone-scp
`
)

Expand Down Expand Up @@ -475,7 +475,7 @@ func TestScriptStopWithMultipleHostAndSyncMode(t *testing.T) {
var (
buffer bytes.Buffer
expected = `
err: mkdir: can't create directory 'a/b/c': No such file or directory
mkdir: can't create directory 'a/b/c': No such file or directory
`
)

Expand Down Expand Up @@ -506,7 +506,7 @@ func TestScriptStop(t *testing.T) {
var (
buffer bytes.Buffer
expected = `
err: mkdir: can't create directory 'a/b/c': No such file or directory
mkdir: can't create directory 'a/b/c': No such file or directory
`
)

Expand Down Expand Up @@ -536,8 +536,8 @@ func TestNoneScriptStop(t *testing.T) {
var (
buffer bytes.Buffer
expected = `
err: mkdir: can't create directory 'a/b/c': No such file or directory
err: mkdir: can't create directory 'd/e/f': No such file or directory
mkdir: can't create directory 'a/b/c': No such file or directory
mkdir: can't create directory 'd/e/f': No such file or directory
`
)

Expand Down Expand Up @@ -584,13 +584,13 @@ func TestEnvOutput(t *testing.T) {
export ENV_6='test"'
export ENV_7='test,!#;?.@$~'\''"'
======END======
out: [test]
out: [test test]
out: [test ]
out: [ test test ]
out: [test']
out: [test"]
out: [test,!#;?.@$~'"]
[test]
[test test]
[test ]
[ test test ]
[test']
[test"]
[test,!#;?.@$~'"]
`
)

Expand Down Expand Up @@ -719,8 +719,8 @@ func TestUseInsecureCipher(t *testing.T) {
var (
buffer bytes.Buffer
expected = `
err: mkdir: can't create directory 'a/b/c': No such file or directory
err: mkdir: can't create directory 'd/e/f': No such file or directory
mkdir: can't create directory 'a/b/c': No such file or directory
mkdir: can't create directory 'd/e/f': No such file or directory
`
)

Expand Down Expand Up @@ -871,9 +871,9 @@ func TestAllEnvs(t *testing.T) {
var (
buffer bytes.Buffer
expected = `
out: [foobar]
out: [foobar]
out: [foobar]
[foobar]
[foobar]
[foobar]
`
)

Expand Down Expand Up @@ -915,7 +915,7 @@ func TestSudoCommand(t *testing.T) {
var (
buffer bytes.Buffer
expected = `
out: root
root
`
)

Expand All @@ -942,7 +942,7 @@ func TestCommandWithIPv6(t *testing.T) {
var (
buffer bytes.Buffer
expected = `
out: drone-scp
drone-scp
`
)

Expand Down
Loading