mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-10-15 19:42:06 +00:00
test updates
Signed-off-by: Casey Lee <cplee@nektos.com>
This commit is contained in:
parent
c236395c01
commit
eb7e10e86b
8 changed files with 33 additions and 24 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue