Files
.github
.vscode
cmd
pkg
artifacts
common
container
exprparser
lookpath
model
runner
res
testdata
action.go
action_composite.go
action_test.go
command.go
command_test.go
container_mock_test.go
expression.go
expression_test.go
job_executor.go
job_executor_test.go
logger.go
reusable_workflow.go
run_context.go
run_context_test.go
runner.go
runner_test.go
step.go
step_action_local.go
step_action_local_test.go
step_action_remote.go
step_action_remote_test.go
step_docker.go
step_docker_test.go
step_factory.go
step_factory_test.go
step_run.go
step_run_test.go
step_test.go
workflowpattern
.actrc
.editorconfig
.gitignore
.gitleaksignore
.golangci.yml
.goreleaser.yml
.markdownlint.yml
.mega-linter.yml
.mergify.yml
.prettierignore
.prettierrc.yml
CODEOWNERS
CONTRIBUTING.md
IMAGES.md
LICENSE
Makefile
README.md
VERIFICATION
VERSION
act-cli.nuspec
codecov.yml
go.mod
go.sum
install.sh
main.go
act/pkg/runner/container_mock_test.go
ChristopherHX 21ea3d0d5f chore: Remove obsolete Container.UpdateFromPath ()
* chore: Remove obsolete Container.UpdateFromPath

* remove unused import
2023-02-16 16:11:26 +00:00

76 lines
2.1 KiB
Go

package runner
import (
"context"
"io"
"github.com/nektos/act/pkg/common"
"github.com/nektos/act/pkg/container"
"github.com/stretchr/testify/mock"
)
type containerMock struct {
mock.Mock
container.Container
container.LinuxContainerEnvironmentExtensions
}
func (cm *containerMock) Create(capAdd []string, capDrop []string) common.Executor {
args := cm.Called(capAdd, capDrop)
return args.Get(0).(func(context.Context) error)
}
func (cm *containerMock) Pull(forcePull bool) common.Executor {
args := cm.Called(forcePull)
return args.Get(0).(func(context.Context) error)
}
func (cm *containerMock) Start(attach bool) common.Executor {
args := cm.Called(attach)
return args.Get(0).(func(context.Context) error)
}
func (cm *containerMock) Remove() common.Executor {
args := cm.Called()
return args.Get(0).(func(context.Context) error)
}
func (cm *containerMock) Close() common.Executor {
args := cm.Called()
return args.Get(0).(func(context.Context) error)
}
func (cm *containerMock) UpdateFromEnv(srcPath string, env *map[string]string) common.Executor {
args := cm.Called(srcPath, env)
return args.Get(0).(func(context.Context) error)
}
func (cm *containerMock) UpdateFromImageEnv(env *map[string]string) common.Executor {
args := cm.Called(env)
return args.Get(0).(func(context.Context) error)
}
func (cm *containerMock) Copy(destPath string, files ...*container.FileEntry) common.Executor {
args := cm.Called(destPath, files)
return args.Get(0).(func(context.Context) error)
}
func (cm *containerMock) CopyDir(destPath string, srcPath string, useGitIgnore bool) common.Executor {
args := cm.Called(destPath, srcPath, useGitIgnore)
return args.Get(0).(func(context.Context) error)
}
func (cm *containerMock) Exec(command []string, env map[string]string, user, workdir string) common.Executor {
args := cm.Called(command, env, user, workdir)
return args.Get(0).(func(context.Context) error)
}
func (cm *containerMock) GetContainerArchive(ctx context.Context, srcPath string) (io.ReadCloser, error) {
args := cm.Called(ctx, srcPath)
err, hasErr := args.Get(1).(error)
if !hasErr {
err = nil
}
return args.Get(0).(io.ReadCloser), err
}