Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
henrybear327 committed Dec 11, 2024
1 parent a299551 commit dca1a57
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ jobs:
- uses: actions/setup-go@41dfa10bad2bb2ae585af6ee5bb4d7d973ad74ed # v5.1.0
with:
go-version: 1.23.4
- name: Install Chainsaw
uses: kyverno/action-install-chainsaw@f2b47b97dc889c12702113753d713f01ec268de5 #v0.2.12
- name: Check Chainsaw installation
run: chainsaw version
- name: Import environment variables from file
run: |
cat ".github/env" >> "$GITHUB_ENV"
Expand Down
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ install-$(GO_PACKAGE_NAME_GOLANGCI_LINT):
echo "$(GO_PACKAGE_NAME_GOLANGCI_LINT) is installed" ; \
fi

# check if chainsaw is installed or not
GO_PACKAGE_NAME_CHAINSAW := chainsaw
install-$(GO_PACKAGE_NAME_CHAINSAW):
@if [ ! -x "$(GOBIN)/$(GO_PACKAGE_NAME_CHAINSAW)" ]; then \
echo "Installing $(GO_PACKAGE_NAME_CHAINSAW)..." ; \
go install $(GO_PACKAGE_NAME_CHAINSAW) ; \
else \
echo "$(GO_PACKAGE_NAME_CHAINSAW) is installed" ; \
fi

.PHONY: all
all: build

Expand Down Expand Up @@ -223,10 +233,10 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
$(ENVTEST): $(LOCALBIN)
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@87bcfec

generate_mocks: # TODO: auto install go install go.uber.org/mock/mockgen@latest
generate_mocks: ## TODO: auto install go install go.uber.org/mock/mockgen@latest
mkdir -p ${GEN_DIR}
mockgen -destination ${GEN_DIR}/${NETBOX_MOCKS_OUTPUT_FILE} -source=${INTERFACE_DEFITIONS_DIR}

.PHONY: test-e2e
test-e2e: # notice that if we apply several CRs at the same time, the IP/Prefix/etc. allocated to the CR might differ each time due to the timing of execution for reservation on the NetBox side
test-e2e: install-$(GO_PACKAGE_NAME_CHAINSAW)
chainsaw test --namespace e2e

0 comments on commit dca1a57

Please sign in to comment.