From 2c72fbd514c53ff2e66f4d31ea24c65181a070b9 Mon Sep 17 00:00:00 2001 From: Nick Date: Tue, 3 Mar 2020 18:54:42 +0000 Subject: [PATCH] Remove FIO_USE_DOCKER env --- Makefile | 2 -- tests/tools/fio/fio.go | 15 ++++----------- tests/tools/fio/workload.go | 1 - 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 3d763e369..c69255c77 100644 --- a/Makefile +++ b/Makefile @@ -163,9 +163,7 @@ integration-tests: dist-binary KOPIA_EXE=$(KOPIA_INTEGRATION_EXE) $(GO_TEST) $(TEST_FLAGS) -count=1 -parallel $(PARALLEL) -timeout 600s github.com/kopia/kopia/tests/end_to_end_test robustness-tool-tests: - FIO_EXE="$(shell which fio)" \ FIO_DOCKER_IMAGE=$(FIO_DOCKER_TAG) \ - FIO_USE_DOCKER=1 \ $(GO_TEST) $(TEST_FLAGS) -count=1 -timeout 90s github.com/kopia/kopia/tests/tools/... stress-test: diff --git a/tests/tools/fio/fio.go b/tests/tools/fio/fio.go index a318bdd78..e880f4b26 100644 --- a/tests/tools/fio/fio.go +++ b/tests/tools/fio/fio.go @@ -36,9 +36,7 @@ // FioDockerImageEnvKey specifies the docker image tag to use. If // FioExeEnvKey is set, the local executable will be used instead of - // docker, even if this variable is also set. The exception is if - // FioUseDockerEnvKey is not an empty string, which will force - // use of the fio docker image independent of FioExeEnvKey. + // docker, even if this variable is also set. FioDockerImageEnvKey = "FIO_DOCKER_IMAGE" // LocalFioDataPathEnvKey is the local path where fio data will be @@ -49,10 +47,6 @@ // relative to the docker host. If left blank, defaults to local fio data path // (works unless running via docker from within a container, e.g. for development) HostFioDataPathEnvKey = "HOST_FIO_DATA_PATH" - - // FioUseDockerEnvKey forces the fio runner to use the docker image, even if - // an executable path is provided. - FioUseDockerEnvKey = "FIO_USE_DOCKER" ) // Known error messages @@ -75,7 +69,6 @@ func NewRunner() (fr *Runner, err error) { imgStr := os.Getenv(FioDockerImageEnvKey) localFioDataPathStr := os.Getenv(LocalFioDataPathEnvKey) hostFioDataPathStr := os.Getenv(HostFioDataPathEnvKey) - forceDocker := os.Getenv(FioUseDockerEnvKey) != "" var exeArgs []string @@ -89,7 +82,7 @@ func NewRunner() (fr *Runner, err error) { } switch { - case exeStr != "" && !forceDocker: + case exeStr != "": // Provided a local FIO executable to run Exe = exeStr @@ -171,13 +164,13 @@ func (fr *Runner) verifySetupWithTestWrites() error { opt := Options{}.WithNumFiles(nrFiles).WithFileSize(fileSizeB) + defer fr.DeleteRelDir("test") //nolint:errcheck + err := fr.WriteFiles(subDirPath, opt) if err != nil { return errors.Wrap(err, "unable to perform writes") } - defer fr.DeleteRelDir("test") //nolint:errcheck - fl, err := ioutil.ReadDir(filepath.Join(fr.LocalDataDir, subDirPath)) if err != nil { return errors.Wrapf(err, "error reading path %v", subDirPath) diff --git a/tests/tools/fio/workload.go b/tests/tools/fio/workload.go index f7a9df19a..9f75b4956 100644 --- a/tests/tools/fio/workload.go +++ b/tests/tools/fio/workload.go @@ -1,7 +1,6 @@ package fio import ( - "fmt" "os" "path/filepath"