Respect directory option for steps again (#4319)

This commit is contained in:
6543
2024-11-06 23:21:56 +01:00
committed by GitHub
parent c9752bb735
commit bf5405b6cc
10 changed files with 96 additions and 61 deletions

View File

@@ -16,6 +16,7 @@ package common
import (
"testing"
"text/template"
"github.com/stretchr/testify/assert"
)
@@ -39,8 +40,8 @@ fi
unset CI_NETRC_USERNAME
unset CI_NETRC_PASSWORD
unset CI_SCRIPT
mkdir -p "$CI_WORKSPACE"
cd "$CI_WORKSPACE"
mkdir -p "/woodpecker/some"
cd "/woodpecker/some"
echo + 'echo ${PATH}'
echo ${PATH}
@@ -54,7 +55,13 @@ go test
},
}
for _, test := range testdata {
script := generateScriptPosix(test.from)
script := generateScriptPosix(test.from, "/woodpecker/some")
assert.EqualValues(t, test.want, script, "Want encoded script for %s", test.from)
}
}
func TestSetupScriptProtoParse(t *testing.T) {
// just ensure that we have a working `setupScriptTmpl` on runntime
_, err := template.New("").Parse(setupScriptProto)
assert.NoError(t, err)
}