updates for tests

This commit is contained in:
Casey Lee 2020-02-21 22:19:59 -08:00
parent 2cb276ca05
commit 9179d8924d
No known key found for this signature in database
GPG Key ID: 1899120ECD0A1784
3 changed files with 7 additions and 5 deletions

View File

@ -267,8 +267,9 @@ func (rc *RunContext) createStepContainerName(stepID string) string {
prefix := regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(rc.createContainerName(), "-")
suffix := regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(stepID, "-")
containerName := trimToLen(prefix, 30-len(suffix))
return fmt.Sprintf("%s%s%s", prefix, containerName, suffix)
prefix = trimToLen(prefix, 30-(1+len(suffix)))
name := strings.Trim(fmt.Sprintf("%s-%s", prefix, suffix), "-")
return name
}
func trimToLen(s string, l int) string {

View File

@ -57,13 +57,13 @@ func TestRunEvent(t *testing.T) {
table := table
t.Run(table.workflowPath, func(t *testing.T) {
platforms := map[string]string{
"ubuntu-latest": "ubuntu:18.04",
"ubuntu-latest": "node:12.6-buster-slim",
}
runnerConfig := &Config{
Workdir: "testdata",
EventName: table.eventName,
Platforms: platforms,
ReuseContainers: true,
ReuseContainers: false,
}
runner, err := New(runnerConfig)
assert.NilError(t, err, table.workflowPath)

View File

@ -6,11 +6,12 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- run: which node
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: which node
- name: Install Dependencies
run: npm install