From 03955798be9ed4879fe3d4637a8f140a09f79599 Mon Sep 17 00:00:00 2001 From: Andy Goldstein Date: Wed, 1 Feb 2023 15:57:05 -0500 Subject: [PATCH] Fix ready-to-test location Signed-off-by: Andy Goldstein --- Makefile | 16 ++++++++-------- cmd/sharded-test-server/main.go | 2 +- cmd/test-server/main.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index ad7af34ff86..e435d5e94c5 100644 --- a/Makefile +++ b/Makefile @@ -265,11 +265,11 @@ endif test-e2e-shared: require-kind build-all build-kind-images mkdir -p "$(LOG_DIR)" "$(WORK_DIR)/.kcp" kind get kubeconfig > "$(WORK_DIR)/.kcp/kind.kubeconfig" - rm -f "$(WORK_DIR)/ready-to-test" + rm -f "$(WORK_DIR)/.kcp/ready-to-test" UNSAFE_E2E_HACK_DISABLE_ETCD_FSYNC=true NO_GORUN=1 \ ./bin/test-server --quiet --log-file-path="$(LOG_DIR)/kcp.log" $(TEST_SERVER_ARGS) 2>&1 & PID=$$! && echo "PID $$PID" && \ trap 'kill -TERM $$PID' TERM INT EXIT && \ - while [ ! -f "$(WORK_DIR)/ready-to-test" ]; do sleep 1; done && \ + while [ ! -f "$(WORK_DIR)/.kcp/ready-to-test" ]; do sleep 1; done && \ NO_GORUN=1 GOOS=$(OS) GOARCH=$(ARCH) \ $(GO_TEST) -race $(COUNT_ARG) $(PARALLELISM_ARG) $(WHAT) $(TEST_ARGS) \ -args --use-default-kcp-server --syncer-image="$(SYNCER_IMAGE)" --kcp-test-image="$(TEST_IMAGE)" --pcluster-kubeconfig="$(abspath $(WORK_DIR)/.kcp/kind.kubeconfig)" $(SUITES_ARG) \ @@ -289,11 +289,11 @@ test-e2e-shared-minimal: LOG_DIR ?= $(WORK_DIR)/.kcp endif test-e2e-shared-minimal: build-all mkdir -p "$(LOG_DIR)" "$(WORK_DIR)/.kcp" - rm -f "$(WORK_DIR)/ready-to-test" + rm -f "$(WORK_DIR)/.kcp/ready-to-test" UNSAFE_E2E_HACK_DISABLE_ETCD_FSYNC=true NO_GORUN=1 \ ./bin/test-server --quiet --log-file-path="$(LOG_DIR)/kcp.log" $(TEST_SERVER_ARGS) 2>&1 & PID=$$! && echo "PID $$PID" && \ trap 'kill -TERM $$PID' TERM INT EXIT && \ - while [ ! -f "$(WORK_DIR)/ready-to-test" ]; do sleep 1; done && \ + while [ ! -f "$(WORK_DIR)/.kcp/ready-to-test" ]; do sleep 1; done && \ NO_GORUN=1 GOOS=$(OS) GOARCH=$(ARCH) \ $(GO_TEST) -race $(COUNT_ARG) $(PARALLELISM_ARG) $(WHAT) $(TEST_ARGS) \ -args --use-default-kcp-server $(SUITES_ARG) \ @@ -315,11 +315,11 @@ endif test-e2e-sharded: require-kind build-all build-kind-images mkdir -p "$(LOG_DIR)" "$(WORK_DIR)/.kcp" kind get kubeconfig > "$(WORK_DIR)/.kcp/kind.kubeconfig" - rm -f "$(WORK_DIR)/ready-to-test" + rm -f "$(WORK_DIR)/.kcp/ready-to-test" UNSAFE_E2E_HACK_DISABLE_ETCD_FSYNC=true NO_GORUN=1 \ ./bin/sharded-test-server --quiet --v=2 --log-dir-path="$(LOG_DIR)" --work-dir-path="$(WORK_DIR)" --shard-run-virtual-workspaces=false $(TEST_SERVER_ARGS) --number-of-shards=$(SHARDS) 2>&1 & PID=$$!; echo "PID $$PID" && \ trap 'kill -TERM $$PID' TERM INT EXIT && \ - while [ ! -f "$(WORK_DIR)/ready-to-test" ]; do sleep 1; done && \ + while [ ! -f "$(WORK_DIR)/.kcp/ready-to-test" ]; do sleep 1; done && \ NO_GORUN=1 GOOS=$(OS) GOARCH=$(ARCH) \ $(GO_TEST) -race $(COUNT_ARG) $(PARALLELISM_ARG) $(WHAT) $(TEST_ARGS) \ -args --use-default-kcp-server --shard-kubeconfigs=root=$(PWD)/.kcp-0/admin.kubeconfig$(shell if [ $(SHARDS) -gt 1 ]; then seq 1 $$[$(SHARDS) - 1]; fi | while read n; do echo -n ",shard-$$n=$(PWD)/.kcp-$$n/admin.kubeconfig"; done) \ @@ -342,10 +342,10 @@ test-e2e-sharded-minimal: LOG_DIR ?= $(WORK_DIR)/.kcp endif test-e2e-sharded-minimal: build-all mkdir -p "$(LOG_DIR)" "$(WORK_DIR)/.kcp" - rm -f "$(WORK_DIR)/ready-to-test" + rm -f "$(WORK_DIR)/.kcp/ready-to-test" UNSAFE_E2E_HACK_DISABLE_ETCD_FSYNC=true NO_GORUN=1 ./bin/sharded-test-server --quiet --v=2 --log-dir-path="$(LOG_DIR)" --work-dir-path="$(WORK_DIR)" --shard-run-virtual-workspaces=false $(TEST_SERVER_ARGS) --number-of-shards=$(SHARDS) 2>&1 & PID=$$!; echo "PID $$PID" && \ trap 'kill -TERM $$PID' TERM INT EXIT && \ - while [ ! -f "$(WORK_DIR)/ready-to-test" ]; do sleep 1; done && \ + while [ ! -f "$(WORK_DIR)/.kcp/ready-to-test" ]; do sleep 1; done && \ NO_GORUN=1 GOOS=$(OS) GOARCH=$(ARCH) $(GO_TEST) -race $(COUNT_ARG) $(PARALLELISM_ARG) $(WHAT) $(TEST_ARGS) \ -args --use-default-kcp-server --shard-kubeconfigs=root=$(PWD)/.kcp-0/admin.kubeconfig$(shell if [ $(SHARDS) -gt 1 ]; then seq 1 $$[$(SHARDS) - 1]; fi | while read n; do echo -n ",shard-$$n=$(PWD)/.kcp-$$n/admin.kubeconfig"; done) \ $(SUITES_ARGS) \ diff --git a/cmd/sharded-test-server/main.go b/cmd/sharded-test-server/main.go index c8887b73baa..98c1b2140e9 100644 --- a/cmd/sharded-test-server/main.go +++ b/cmd/sharded-test-server/main.go @@ -305,7 +305,7 @@ func start(proxyFlags, shardFlags []string, logDirPath, workDirPath string, numb } } - readyToTestFile, err := os.Create(filepath.Join(workDirPath, "ready-to-test")) + readyToTestFile, err := os.Create(filepath.Join(workDirPath, ".kcp", "ready-to-test")) if err != nil { return fmt.Errorf("error creating ready-to-test file: %w", err) } diff --git a/cmd/test-server/main.go b/cmd/test-server/main.go index 01579e970f1..514a00d7a78 100644 --- a/cmd/test-server/main.go +++ b/cmd/test-server/main.go @@ -117,7 +117,7 @@ func start(shardFlags []string, quiet bool) error { return err } - readyToTestFile, err := os.Create("ready-to-test") + readyToTestFile, err := os.Create(filepath.Join(".kcp", "ready-to-test")) if err != nil { return fmt.Errorf("error creating ready-to-test file: %w", err) }