diff --git a/.openshift-tests-extension/openshift_payload_cluster-version-operator.json b/.openshift-tests-extension/openshift_payload_cluster-version-operator.json new file mode 100644 index 000000000..25319f61b --- /dev/null +++ b/.openshift-tests-extension/openshift_payload_cluster-version-operator.json @@ -0,0 +1,12 @@ +[ + { + "name": "[cvo-testing] cluster-version-operator-tests should support passing tests", + "labels": {}, + "resources": { + "isolation": {} + }, + "source": "openshift:payload:cluster-version-operator", + "lifecycle": "blocking", + "environmentSelector": {} + } +] \ No newline at end of file diff --git a/Makefile b/Makefile index 7a7ea9da8..41ee8877b 100644 --- a/Makefile +++ b/Makefile @@ -15,17 +15,25 @@ integration-test: ./hack/integration-test.sh .PHONY: integration-test +update: build + hack/update-test-metadata.sh +.PHONY: update + format: go fmt ./... .PHONY: format -verify: verify-yaml +verify: verify-yaml verify-update .PHONY: verify verify-yaml: hack/verify-yaml.sh .PHONY: verify-yaml +verify-update: update + git diff --exit-code HEAD +.PHONY: verify-update + clean: rm -rf _output/ rm -rf bin diff --git a/hack/build-go.sh b/hack/build-go.sh index de2445f72..269d69156 100755 --- a/hack/build-go.sh +++ b/hack/build-go.sh @@ -2,29 +2,11 @@ set -eu -REPO=github.com/openshift/cluster-version-operator -GOFLAGS=${GOFLAGS:--mod=vendor} -GLDFLAGS=${GLDFLAGS:-} - -eval $(go env | grep -e "GOHOSTOS" -e "GOHOSTARCH") - -GOOS=${GOOS:-${GOHOSTOS}} -GOARCH=${GOARCH:-${GOHOSTARCH}} - # Go to the root of the repo cd "$(git rev-parse --show-cdup)" -VERSION_OVERRIDE=${VERSION_OVERRIDE:-${OS_GIT_VERSION:-}} -if [ -z "${VERSION_OVERRIDE:-}" ]; then - echo "Using version from git..." - VERSION_OVERRIDE=$(git describe --abbrev=8 --dirty --always) -fi - -eval $(go env) - -if [ -z ${BIN_PATH+a} ]; then - export BIN_PATH=_output/${GOOS}/${GOARCH} -fi +# Source build variables +source hack/build-info.sh echo "Building binaries into ${BIN_PATH}" mkdir -p ${BIN_PATH} diff --git a/hack/build-info.sh b/hack/build-info.sh new file mode 100755 index 000000000..7a57dfae8 --- /dev/null +++ b/hack/build-info.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -eu + +REPO=github.com/openshift/cluster-version-operator +GOFLAGS=${GOFLAGS:--mod=vendor} +GLDFLAGS=${GLDFLAGS:-} + +eval $(go env | grep -e "GOHOSTOS" -e "GOHOSTARCH") + +GOOS=${GOOS:-${GOHOSTOS}} +GOARCH=${GOARCH:-${GOHOSTARCH}} + +VERSION_OVERRIDE=${VERSION_OVERRIDE:-${OS_GIT_VERSION:-}} +if [ -z "${VERSION_OVERRIDE:-}" ]; then + echo "Using version from git..." + VERSION_OVERRIDE=$(git describe --abbrev=8 --dirty --always) +fi + +eval $(go env) + +if [ -z ${BIN_PATH+a} ]; then + export BIN_PATH=_output/${GOOS}/${GOARCH} +fi diff --git a/hack/update-test-metadata.sh b/hack/update-test-metadata.sh new file mode 100755 index 000000000..47575a3a6 --- /dev/null +++ b/hack/update-test-metadata.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -eu + +source hack/build-info.sh + +# Update test metadata +eval "${BIN_PATH}/cluster-version-operator-tests" "update"