Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ OADP_BUCKET ?= $(shell cat $(OADP_BUCKET_FILE))
SETTINGS_TMP=/tmp/test-settings

.PHONY: test-e2e-setup
test-e2e-setup: login-required build-must-gather
test-e2e-setup: login-required
mkdir -p $(SETTINGS_TMP)
TMP_DIR=$(SETTINGS_TMP) \
OPENSHIFT_CI="$(OPENSHIFT_CI)" \
Expand All @@ -930,7 +930,14 @@ TEST_HCP ?= false
TEST_HCP_EXTERNAL ?= false
HCP_EXTERNAL_ARGS ?= ""
TEST_CLI ?= false
SKIP_MUST_GATHER ?= false
SKIP_MUST_GATHER ?= false
MUST_GATHER_REPO ?=
MUST_GATHER_BRANCH ?= oadp-dev
ifneq ($(MUST_GATHER_REPO),)
MUST_GATHER_IMAGE ?= ttl.sh/oadp-must-gather-$(MUST_GATHER_BRANCH)-$(GIT_REV):$(TTL_DURATION)
else
MUST_GATHER_IMAGE ?= quay.io/konveyor/oadp-must-gather:latest
endif
TEST_UPGRADE ?= false
FAIL_FAST ?= true
TEST_FILTER = (($(shell echo '! aws && ! gcp && ! azure && ! ibmcloud' | \
Expand Down Expand Up @@ -973,8 +980,21 @@ GINKGO_FLAGS = --vv \
--fail-fast=$(FAIL_FAST) \
--timeout=2h

.PHONY: build-must-gather
build-must-gather: ## Build must-gather image from GitHub source. Requires MUST_GATHER_REPO (e.g., openshift/oadp-must-gather). Uses MUST_GATHER_BRANCH (default: main).
ifeq ($(MUST_GATHER_REPO),)
$(error MUST_GATHER_REPO is required (e.g., openshift/oadp-must-gather))
endif
$(eval MUST_GATHER_TMP := $(shell mktemp -d))
git clone --depth=1 --branch $(MUST_GATHER_BRANCH) https://github.com/$(MUST_GATHER_REPO).git $(MUST_GATHER_TMP)
$(CONTAINER_TOOL) build --load -t $(MUST_GATHER_IMAGE) -f $(MUST_GATHER_TMP)/Dockerfile $(MUST_GATHER_TMP)
$(CONTAINER_TOOL) push $(MUST_GATHER_IMAGE)
rm -rf $(MUST_GATHER_TMP)
@echo "Must-gather image built and pushed: $(MUST_GATHER_IMAGE)"

Comment on lines +983 to +994
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Documentation inconsistency: comment says "default: main" but actual default is "oadp-dev".

The help comment on line 984 states Uses MUST_GATHER_BRANCH (default: main) but line 935 defines MUST_GATHER_BRANCH ?= oadp-dev.

📝 Proposed fix
 .PHONY: build-must-gather
-build-must-gather: ## Build must-gather image from GitHub source. Requires MUST_GATHER_REPO (e.g., openshift/oadp-must-gather). Uses MUST_GATHER_BRANCH (default: main).
+build-must-gather: ## Build must-gather image from GitHub source. Requires MUST_GATHER_REPO (e.g., openshift/oadp-must-gather). Uses MUST_GATHER_BRANCH (default: oadp-dev).
 ifeq ($(MUST_GATHER_REPO),)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 983 - 994, The help comment for the build-must-gather
target is inconsistent with the actual default; update the comment or the
variable so they match: either change the comment text "Uses MUST_GATHER_BRANCH
(default: main)" to "Uses MUST_GATHER_BRANCH (default: oadp-dev)" to reflect
MUST_GATHER_BRANCH ?= oadp-dev, or change the default assignment
(MUST_GATHER_BRANCH ?= oadp-dev) to MUST_GATHER_BRANCH ?= main so the comment
stays accurate; edit the Makefile comment adjacent to the build-must-gather
target and ensure MUST_GATHER_BRANCH is the intended default.

.PHONY: test-e2e
test-e2e: test-e2e-setup install-ginkgo ## Run E2E tests against OADP operator installed in cluster. For more information, check docs/developer/testing/TESTING.md
test-e2e: test-e2e-setup install-ginkgo $(if $(MUST_GATHER_REPO),build-must-gather) ## Run E2E tests against OADP operator installed in cluster. For more information, check docs/developer/testing/TESTING.md
MUST_GATHER_IMAGE=$(MUST_GATHER_IMAGE) \
ginkgo run -mod=mod $(GINKGO_FLAGS) $(GINKGO_ARGS) tests/e2e/ -- \
-settings=$(SETTINGS_TMP)/oadpcreds \
-provider=$(CLUSTER_TYPE) \
Expand Down Expand Up @@ -1079,11 +1099,3 @@ endif
@cp $(KUBEVIRT_DATAMOVER_PATH)/config/rbac/kustomization.yaml $(shell pwd)/config/kubevirt-datamover-controller_rbac/kustomization.yaml
@$(SED) -i '1i namePrefix: oadp-kubevirt-datamover-' $(shell pwd)/config/kubevirt-datamover-controller_rbac/kustomization.yaml
@make bundle

.PHONY: build-must-gather
build-must-gather: check-go ## Build OADP Must-gather binary must-gather/oadp-must-gather
ifeq ($(SKIP_MUST_GATHER),true)
echo "Skipping must-gather build"
else
cd must-gather && go build -mod=mod -a -o oadp-must-gather cmd/main.go
endif
5 changes: 4 additions & 1 deletion docs/developer/testing/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ To get started, you need to provide the following **required** environment varia
| `TEST_HCP` | Exclusively run Hypershift backup/restore testing | `false` | false |
| `TEST_UPGRADE` | Exclusively run upgrade tests. Need to first run `make catalog-test-upgrade`, if testing non production operator | `false` | false |
| `TEST_CLI` | Exclusively run CLI-based backup/restore testing | `false` | false |
| `SKIP_MUST_GATHER` | must-gather is compiled locally in the Makefile, may cause issue if local and cluster arch do not match| `false` | false |
| `SKIP_MUST_GATHER` | Skip running must-gather collection during E2E tests | `false` | false |
| `MUST_GATHER_IMAGE` | Container image to use for must-gather collection via `oc adm must-gather` | `quay.io/konveyor/oadp-must-gather:latest` | false |
| `MUST_GATHER_REPO` | GitHub repo (e.g., `openshift/oadp-must-gather`) to build must-gather from source. Sets `MUST_GATHER_IMAGE` to a ttl.sh image automatically | - | false |
| `MUST_GATHER_BRANCH` | Branch to use when building from `MUST_GATHER_REPO` | `oadp-dev` | false |

> **Note:**

Expand Down
41 changes: 0 additions & 41 deletions must-gather/Dockerfile

This file was deleted.

119 changes: 0 additions & 119 deletions must-gather/README.md

This file was deleted.

26 changes: 0 additions & 26 deletions must-gather/cmd/main.go

This file was deleted.

5 changes: 0 additions & 5 deletions must-gather/deprecated/gather_1h

This file was deleted.

5 changes: 0 additions & 5 deletions must-gather/deprecated/gather_1h_essential

This file was deleted.

5 changes: 0 additions & 5 deletions must-gather/deprecated/gather_24h

This file was deleted.

5 changes: 0 additions & 5 deletions must-gather/deprecated/gather_24h_essential

This file was deleted.

5 changes: 0 additions & 5 deletions must-gather/deprecated/gather_6h

This file was deleted.

5 changes: 0 additions & 5 deletions must-gather/deprecated/gather_6h_essential

This file was deleted.

5 changes: 0 additions & 5 deletions must-gather/deprecated/gather_72h

This file was deleted.

5 changes: 0 additions & 5 deletions must-gather/deprecated/gather_72h_essential

This file was deleted.

26 changes: 0 additions & 26 deletions must-gather/deprecated/gather_all

This file was deleted.

5 changes: 0 additions & 5 deletions must-gather/deprecated/gather_all_essential

This file was deleted.

5 changes: 0 additions & 5 deletions must-gather/deprecated/gather_metrics_dump

This file was deleted.

15 changes: 0 additions & 15 deletions must-gather/deprecated/gather_with_timeout

This file was deleted.

15 changes: 0 additions & 15 deletions must-gather/deprecated/gather_without_tls

This file was deleted.

Loading