Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): Removed STAGING_RUNTIME_REPO from Makefile #5641

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 2 additions & 4 deletions e2e/support/test_staging_hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@
)

func init() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably the entire init() func can be removed to avoid the build error.

Copy link
Author

Choose a reason for hiding this comment

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

I have removed init function, Is it correct now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks. However I noticed I was wrong. In the diff code snippet I did not see that the func is also having a second part with more logic. We need to restore it and just get rid of the build error. In order to verify that, you should try to build locally before submitting the change. Just do make build and you should compile successfully before submitting the PR.

// Let's use the STAGING_RUNTIME_REPO if available
runtimeRepo := os.Getenv("STAGING_RUNTIME_REPO")
if runtimeRepo != "" {

KamelHooks = append(KamelHooks, func(args []string) []string {
if len(args) > 0 && args[0] == "install" {
args = append(args, fmt.Sprintf("--maven-repository=%s", runtimeRepo))

Check failure on line 36 in e2e/support/test_staging_hooks.go

View workflow job for this annotation

GitHub Actions / telemetry-it

undefined: runtimeRepo

Check failure on line 36 in e2e/support/test_staging_hooks.go

View workflow job for this annotation

GitHub Actions / builder-it (Jib)

undefined: runtimeRepo

Check failure on line 36 in e2e/support/test_staging_hooks.go

View workflow job for this annotation

GitHub Actions / common-it

undefined: runtimeRepo

Check failure on line 36 in e2e/support/test_staging_hooks.go

View workflow job for this annotation

GitHub Actions / knative-test

undefined: runtimeRepo

Check failure on line 36 in e2e/support/test_staging_hooks.go

View workflow job for this annotation

GitHub Actions / olm

undefined: runtimeRepo

Check failure on line 36 in e2e/support/test_staging_hooks.go

View workflow job for this annotation

GitHub Actions / quarkus-native

undefined: runtimeRepo

Check failure on line 36 in e2e/support/test_staging_hooks.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

undefined: runtimeRepo

Check failure on line 36 in e2e/support/test_staging_hooks.go

View workflow job for this annotation

GitHub Actions / common-it-advanced

undefined: runtimeRepo

Check failure on line 36 in e2e/support/test_staging_hooks.go

View workflow job for this annotation

GitHub Actions / yaks-test

undefined: runtimeRepo

Check failure on line 36 in e2e/support/test_staging_hooks.go

View workflow job for this annotation

GitHub Actions / upgrade

undefined: runtimeRepo

Check failure on line 36 in e2e/support/test_staging_hooks.go

View workflow job for this annotation

GitHub Actions / non-olm

undefined: runtimeRepo
}
return args
})
}


// this hook can be also used to test a released version of the operator, e.g. the staging version during a voting period
// Uncomment the following lines and change references to enable the hook
Expand Down
21 changes: 6 additions & 15 deletions script/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ OPM := opm

# Used to push pre-release artifacts
STAGING_IMAGE := docker.io/camelk/camel-k
STAGING_RUNTIME_REPO :=

# Kamelets options
INSTALL_DEFAULT_KAMELETS ?= true
Expand Down Expand Up @@ -169,7 +168,6 @@ bump-replace:
@mvn -f java/crds/pom.xml versions:set -DgenerateBackupPoms=false -DnewVersion=$(VERSION)
@mvn -f java/maven-logging/pom.xml versions:set -DgenerateBackupPoms=false -DnewVersion=$(VERSION)
@sed -i 's/^LAST_RELEASED_VERSION ?= .*$//LAST_RELEASED_VERSION ?= $(LAST_RELEASED_VERSION)/' ./script/Makefile
@sed -i 's/^STAGING_RUNTIME_REPO :=.*$//STAGING_RUNTIME_REPO :=/' ./script/Makefile

bump: bump-replace codegen bundle

Expand Down Expand Up @@ -271,7 +269,7 @@ endif
# the time to complete (they are used also as smoke test for nightly release)
#
test-common: do-build
FAILED=0; STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)"; \
FAILED=0; \
go test -timeout 90m -v ./e2e/common/... -tags=integration -parallel=$(TEST_COMMON_PARALLEL_COUNT) $(TEST_INTEGRATION_COMMON_LANG_RUN) $(GOTESTFMT) || ((FAILED++)); \
exit $${FAILED}

Expand All @@ -283,7 +281,6 @@ test-smoke: do-build
if [[ $$TEST_SKIP_AFTER_FAILURE_COUNT = "" ]]; then \
TEST_SKIP_AFTER_FAILURE_COUNT=0; \
fi; \
FAILED=0; STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)"; \
echo "TEST_COMMON_PARALLEL_COUNT=$$TEST_COMMON_PARALLEL_COUNT"; \
echo "TEST_SKIP_AFTER_FAILURE_COUNT=$$TEST_SKIP_AFTER_FAILURE_COUNT"; \
go test -timeout 10m -count=1 -v ./e2e/common/main_test.go -tags=integration $(TEST_INTEGRATION_COMMON_LANG_RUN) $(GOTESTFMT) || ((FAILED++)); \
Expand Down Expand Up @@ -311,15 +308,15 @@ test-smoke: do-build
# Common tests that require some particular operator setting or need to be installed in multiple namespaces
#
test-advanced: do-build
FAILED=0; STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)"; \
FAILED=0; \
go test -timeout 90m -v ./e2e/advanced -tags=integration -parallel=$(TEST_ADVANCED_PARALLEL_COUNT) $(TEST_INSTALL_RUN) $(GOTESTFMT) || ((FAILED++)); \
exit $${FAILED}

#
# Installation procedure test using CLi and Kustomize methodologies
#
test-install: do-build
FAILED=0; STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)"; \
FAILED=0; \
go test -timeout 40m -v ./e2e/install/cli -tags=integration $(TEST_INSTALL_RUN) $(GOTESTFMT) || ((FAILED++)); \
go test -timeout 40m -v ./e2e/install/kustomize -tags=integration $(TEST_INSTALL_RUN) $(GOTESTFMT) || ((FAILED++)); \
go test -timeout 40m -v ./e2e/install/helm -tags=integration $(TEST_INSTALL_RUN) $(GOTESTFMT) || ((FAILED++)); \
Expand All @@ -329,43 +326,37 @@ test-install: do-build
# Installation procedure test using OLM (requires cluster to be setup accordingly)
#
test-install-olm: do-build
STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)"; \
go test -timeout 30m -v ./e2e/install/olm -tags=integration $(TEST_INSTALL_RUN) $(GOTESTFMT)

#
# Upgrade procedure test (requires cluster to be setup accordingly, ie OLM)
#
test-install-upgrade: do-build
STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)"; \
go test -timeout 30m -v ./e2e/install/upgrade -tags=integration $(TEST_INSTALL_RUN) $(GOTESTFMT)

#
# Knative tests that require the presence of Knative configuration
#
test-knative: do-build
STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)"; \
go test -timeout 60m -v ./e2e/knative -tags=integration $(TEST_KNATIVE_RUN) $(GOTESTFMT) || ((FAILED++)); \
exit $${FAILED}

#
# Builder tests that require a custom build strategy
#
test-builder: do-build
STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)"; \
go test -timeout 30m -v ./e2e/builder -tags=integration $(TEST_BUILDER_RUN) $(GOTESTFMT)

#
# Telemetry tests that require the configuration of telemetry endpoints
#
test-telemetry: do-build
STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" \
go test -timeout 30m -v ./e2e/telemetry -tags=integration $(TEST_TELEMETRY_RUN) $(GOTESTFMT)

#
# Quarkus native test (requires certain CPU and memory conditions)
#
test-quarkus-native: do-build
STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" \
go test -timeout 180m -v ./e2e/native -tags=integration $(TEST_QUARKUS_RUN) $(GOTESTFMT)

build-kamel:
Expand All @@ -384,7 +375,7 @@ ifneq ($(shell uname -s 2>/dev/null || echo Unknown),Linux)
endif

build-resources:
./script/get_catalog.sh $(DEFAULT_RUNTIME_VERSION) $(STAGING_RUNTIME_REPO)
./script/get_catalog.sh $(DEFAULT_RUNTIME_VERSION)

bundle-kamelets:
@echo "Preparing Kamelets bundle resource..."
Expand Down Expand Up @@ -479,7 +470,7 @@ images: build maven-overlay bundle-kamelets image-build build-kamel-platform

image-build:
ifneq (,$(findstring SNAPSHOT,$(DEFAULT_RUNTIME_VERSION)))
./script/package_maven_artifacts.sh -s "$(STAGING_RUNTIME_REPO)" -d "$(CAMEL_K_RUNTIME_DIR)" $(DEFAULT_RUNTIME_VERSION)
./script/package_maven_artifacts.sh -d "$(CAMEL_K_RUNTIME_DIR)" $(DEFAULT_RUNTIME_VERSION)
endif
@echo "####### Building Camel K operator arch $(IMAGE_ARCH) container image..."
mkdir -p build/_maven_output
Expand Down Expand Up @@ -581,7 +572,7 @@ release-kustomize:
./script/release_kustomize.sh

get-staging-repo:
@echo $(or ${STAGING_RUNTIME_REPO},https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots)
@echo https://repository.apache.org/content/repositories/snapshots@id=apache-snapshots@snapshots

.PHONY: do-build build build-kamel build-kamel-platform build-resources dep codegen images images-push images-push-staging image-build test check clean release cross-compile package-examples set-version git-tag check-licenses build-resources release-helm release-staging release-nightly get-staging-repo get-version bundle-kamelets
.PHONY: controller-gen kubectl kustomize operator-sdk opm
Expand Down
Loading