updates for tests
This commit is contained in:
parent
2cb276ca05
commit
9179d8924d
3 changed files with 7 additions and 5 deletions
|
@ -267,8 +267,9 @@ func (rc *RunContext) createStepContainerName(stepID string) string {
|
||||||
|
|
||||||
prefix := regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(rc.createContainerName(), "-")
|
prefix := regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(rc.createContainerName(), "-")
|
||||||
suffix := regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(stepID, "-")
|
suffix := regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(stepID, "-")
|
||||||
containerName := trimToLen(prefix, 30-len(suffix))
|
prefix = trimToLen(prefix, 30-(1+len(suffix)))
|
||||||
return fmt.Sprintf("%s%s%s", prefix, containerName, suffix)
|
name := strings.Trim(fmt.Sprintf("%s-%s", prefix, suffix), "-")
|
||||||
|
return name
|
||||||
}
|
}
|
||||||
|
|
||||||
func trimToLen(s string, l int) string {
|
func trimToLen(s string, l int) string {
|
||||||
|
|
|
@ -57,13 +57,13 @@ func TestRunEvent(t *testing.T) {
|
||||||
table := table
|
table := table
|
||||||
t.Run(table.workflowPath, func(t *testing.T) {
|
t.Run(table.workflowPath, func(t *testing.T) {
|
||||||
platforms := map[string]string{
|
platforms := map[string]string{
|
||||||
"ubuntu-latest": "ubuntu:18.04",
|
"ubuntu-latest": "node:12.6-buster-slim",
|
||||||
}
|
}
|
||||||
runnerConfig := &Config{
|
runnerConfig := &Config{
|
||||||
Workdir: "testdata",
|
Workdir: "testdata",
|
||||||
EventName: table.eventName,
|
EventName: table.eventName,
|
||||||
Platforms: platforms,
|
Platforms: platforms,
|
||||||
ReuseContainers: true,
|
ReuseContainers: false,
|
||||||
}
|
}
|
||||||
runner, err := New(runnerConfig)
|
runner, err := New(runnerConfig)
|
||||||
assert.NilError(t, err, table.workflowPath)
|
assert.NilError(t, err, table.workflowPath)
|
||||||
|
|
3
pkg/runner/testdata/node/push.yml
vendored
3
pkg/runner/testdata/node/push.yml
vendored
|
@ -6,11 +6,12 @@ jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- run: which node
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- uses: actions/setup-node@v1
|
- uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: 12
|
node-version: 12
|
||||||
registry-url: https://registry.npmjs.org/
|
registry-url: https://registry.npmjs.org/
|
||||||
|
- run: which node
|
||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|
Loading…
Reference in a new issue