diff --git a/Jenkinsfile b/Jenkinsfile index db1c36391..76bcd965c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -186,7 +186,7 @@ def RunIntegrationTest(k, v) { STORAGE_PROVIDER_TESTS='''+"${env.testProvider}"+''' \ TEST_ARGUMENTS='''+"${env.testArgs}"+''' kubectl config view - _output/tests/linux_amd64/integration -test.v -test.timeout 7200s --host_type '''+"${k}"+''' --logs '''+"${env.getLogs}"+''' --helm /tmp/rook-tests-scripts-helm/linux-amd64/helm 2>&1 | tee _output/tests/integrationTests.log''' + _output/tests/linux_amd64/integration -test.v -test.timeout 7200s --base_test_dir "" --host_type '''+"${k}"+''' --logs '''+"${env.getLogs}"+''' --helm /tmp/rook-tests-scripts-helm/linux-amd64/helm 2>&1 | tee _output/tests/integrationTests.log''' } finally{ sh "journalctl -u kubelet > _output/tests/kubelet_${v}.log" diff --git a/tests/framework/installer/environment.go b/tests/framework/installer/environment.go index 52b425f88..e910256ee 100644 --- a/tests/framework/installer/environment.go +++ b/tests/framework/installer/environment.go @@ -26,6 +26,7 @@ type EnvironmentManifest struct { Helm string RookImageName string ToolboxImageName string + BaseTestDir string SkipInstallRook bool LoadVolumeNumber int LoadConcurrentRuns int @@ -43,6 +44,7 @@ func init() { flag.StringVar(&Env.Helm, "helm", "helm", "Path to helm binary") flag.StringVar(&Env.RookImageName, "rook_image", "rook/ceph", "Docker image name for the rook container to install, must be in docker hub or local environment") flag.StringVar(&Env.ToolboxImageName, "toolbox_image", "rook/ceph", "Docker image name of the toolbox container to install, must be in docker hub or local environment") + flag.StringVar(&Env.BaseTestDir, "base_test_dir", "/data", "Base test directory, for use only when kubernetes master is running on localhost") flag.BoolVar(&Env.SkipInstallRook, "skip_install_rook", false, "Indicate if Rook need to installed - false if tests are being running at Rook that is pre-installed") flag.IntVar(&Env.LoadConcurrentRuns, "load_parallel_runs", 20, "number of routines for load test") flag.IntVar(&Env.LoadVolumeNumber, "load_volumes", 1, "number of volumes(file,object or block) to be created for load test") @@ -50,4 +52,5 @@ func init() { flag.StringVar(&Env.LoadSize, "load_size", "medium", "load size for each thread performing operations - small,medium or large.") flag.BoolVar(&Env.EnableChaos, "enable_chaos", false, "used to determine if random pods in a namespace are to be killed during load test.") flag.StringVar(&Env.Logs, "logs", "", "Gather rook logs, eg - all") + flag.Parse() } diff --git a/tests/framework/installer/installer.go b/tests/framework/installer/installer.go index bde5fb259..b6b29e9a6 100644 --- a/tests/framework/installer/installer.go +++ b/tests/framework/installer/installer.go @@ -19,7 +19,6 @@ package installer import ( "fmt" "os" - "runtime" "strings" "testing" @@ -77,14 +76,13 @@ func SkipTestSuite(name string) bool { } func init() { - // this default will only work if running kubernetes on the local machine - baseTestDir, _ = os.Getwd() - - // The following settings could apply to any environment when the kube context is running on the host and the tests are running inside a - // VM such as minikube. This is a cheap test for this condition, we need to find a better way to automate these settings. - if runtime.GOOS == "darwin" { + // If the base test directory is actively set to empty (as in CI), we use the current working directory. + baseTestDir = Env.BaseTestDir + if baseTestDir == "" { + baseTestDir, _ = os.Getwd() + } + if baseTestDir == "/data" { createBaseTestDir = false - baseTestDir = "/data" } }