@@ -33,10 +33,10 @@ func TestAddpath(t *testing.T) {
|
||||
rc := new(RunContext)
|
||||
handler := rc.commandHandler(ctx)
|
||||
|
||||
handler("::add-path::/zoo")
|
||||
handler("::add-path::/zoo\n")
|
||||
assert.Equal("/zoo:", rc.Env["PATH"])
|
||||
|
||||
handler("::add-path::/booo")
|
||||
handler("::add-path::/booo\n")
|
||||
assert.Equal("/booo:/zoo:", rc.Env["PATH"])
|
||||
}
|
||||
|
||||
|
@@ -128,7 +128,11 @@ func (rc *RunContext) runContainer(containerSpec *model.ContainerSpec) common.Ex
|
||||
|
||||
rawLogger := common.Logger(ctx).WithField("raw_output", true)
|
||||
logWriter := common.NewLineWriter(rc.commandHandler(ctx), func(s string) {
|
||||
rawLogger.Debugf(s)
|
||||
if rc.Config.LogOutput {
|
||||
rawLogger.Infof(s)
|
||||
} else {
|
||||
rawLogger.Debugf(s)
|
||||
}
|
||||
})
|
||||
|
||||
return container.NewDockerRunExecutor(container.NewDockerRunExecutorInput{
|
||||
|
@@ -22,6 +22,7 @@ type Config struct {
|
||||
EventPath string // path to JSON file to use for event.json in containers
|
||||
ReuseContainers bool // reuse containers to maintain state
|
||||
ForcePull bool // force pulling of the image, if already present
|
||||
LogOutput bool // log the output from docker run
|
||||
}
|
||||
|
||||
type runnerImpl struct {
|
||||
|
@@ -37,18 +37,15 @@ func TestRunEvent(t *testing.T) {
|
||||
eventName string
|
||||
errorMessage string
|
||||
}{
|
||||
{"basic", "push", ""},
|
||||
{"fail", "push", "exit with `FAILURE`: 1"},
|
||||
{"runs-on", "push", ""},
|
||||
/*
|
||||
{"basic", "push", ""},
|
||||
{"fail", "push", "exit with `FAILURE`: 1"},
|
||||
{"runs-on", "push", ""},
|
||||
{"job-container", "push", ""},
|
||||
{"uses-docker-url", "push", ""},
|
||||
{"remote-action-docker", "push", ""},
|
||||
{"remote-action-js", "push", ""},
|
||||
{"local-action-docker-url", "push", ""},
|
||||
{"local-action-dockerfile", "push", ""},
|
||||
*/
|
||||
{"job-container", "push", ""},
|
||||
{"uses-docker-url", "push", ""},
|
||||
{"remote-action-docker", "push", ""},
|
||||
{"remote-action-js", "push", ""},
|
||||
{"local-action-docker-url", "push", ""},
|
||||
{"local-action-dockerfile", "push", ""},
|
||||
}
|
||||
log.SetLevel(log.DebugLevel)
|
||||
|
||||
|
Reference in New Issue
Block a user