GenerateScript should not return encoded script (#1397)

followup to #1395
This commit is contained in:
6543
2022-11-06 13:36:34 +01:00
committed by GitHub
parent 18311d4360
commit e8490a757f
8 changed files with 64 additions and 43 deletions

View File

@@ -15,7 +15,6 @@
package common
import (
"encoding/base64"
"testing"
"github.com/stretchr/testify/assert"
@@ -41,13 +40,13 @@ unset CI_NETRC_USERNAME
unset CI_NETRC_PASSWORD
unset CI_SCRIPT
echo + "echo \${PATH}"
echo + 'echo ${PATH}'
echo ${PATH}
echo + "go build"
echo + 'go build'
go build
echo + "go test"
echo + 'go test'
go test
`,
@@ -55,8 +54,6 @@ go test
}
for _, test := range testdata {
script := generateScriptPosix(test.from)
decoded, _ := base64.StdEncoding.DecodeString(script)
got := string(decoded)
assert.EqualValues(t, got, test.want, "Want encoded script for %s", test.from)
assert.EqualValues(t, test.want, script, "Want encoded script for %s", test.from)
}
}