Skip to content

Commit 07c658d

Browse files
Merge pull request #1179 from DavidHurta/tests-extension-update-makefile
OTA-1403: Update and Verify Test Metadata Using Makefile
2 parents 80bd498 + a90e78e commit 07c658d

File tree

5 files changed

+55
-21
lines changed

5 files changed

+55
-21
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{
3+
"name": "[cvo-testing] cluster-version-operator-tests should support passing tests",
4+
"labels": {},
5+
"resources": {
6+
"isolation": {}
7+
},
8+
"source": "openshift:payload:cluster-version-operator",
9+
"lifecycle": "blocking",
10+
"environmentSelector": {}
11+
}
12+
]

Makefile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,25 @@ integration-test:
1515
./hack/integration-test.sh
1616
.PHONY: integration-test
1717

18+
update: build
19+
hack/update-test-metadata.sh
20+
.PHONY: update
21+
1822
format:
1923
go fmt ./...
2024
.PHONY: format
2125

22-
verify: verify-yaml
26+
verify: verify-yaml verify-update
2327
.PHONY: verify
2428

2529
verify-yaml:
2630
hack/verify-yaml.sh
2731
.PHONY: verify-yaml
2832

33+
verify-update: update
34+
git diff --exit-code HEAD
35+
.PHONY: verify-update
36+
2937
clean:
3038
rm -rf _output/
3139
rm -rf bin

hack/build-go.sh

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,11 @@
22

33
set -eu
44

5-
REPO=github.com/openshift/cluster-version-operator
6-
GOFLAGS=${GOFLAGS:--mod=vendor}
7-
GLDFLAGS=${GLDFLAGS:-}
8-
9-
eval $(go env | grep -e "GOHOSTOS" -e "GOHOSTARCH")
10-
11-
GOOS=${GOOS:-${GOHOSTOS}}
12-
GOARCH=${GOARCH:-${GOHOSTARCH}}
13-
145
# Go to the root of the repo
156
cd "$(git rev-parse --show-cdup)"
167

17-
VERSION_OVERRIDE=${VERSION_OVERRIDE:-${OS_GIT_VERSION:-}}
18-
if [ -z "${VERSION_OVERRIDE:-}" ]; then
19-
echo "Using version from git..."
20-
VERSION_OVERRIDE=$(git describe --abbrev=8 --dirty --always)
21-
fi
22-
23-
eval $(go env)
24-
25-
if [ -z ${BIN_PATH+a} ]; then
26-
export BIN_PATH=_output/${GOOS}/${GOARCH}
27-
fi
8+
# Source build variables
9+
source hack/build-info.sh
2810

2911
echo "Building binaries into ${BIN_PATH}"
3012
mkdir -p ${BIN_PATH}

hack/build-info.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
REPO=github.com/openshift/cluster-version-operator
6+
GOFLAGS=${GOFLAGS:--mod=vendor}
7+
GLDFLAGS=${GLDFLAGS:-}
8+
9+
eval $(go env | grep -e "GOHOSTOS" -e "GOHOSTARCH")
10+
11+
GOOS=${GOOS:-${GOHOSTOS}}
12+
GOARCH=${GOARCH:-${GOHOSTARCH}}
13+
14+
VERSION_OVERRIDE=${VERSION_OVERRIDE:-${OS_GIT_VERSION:-}}
15+
if [ -z "${VERSION_OVERRIDE:-}" ]; then
16+
echo "Using version from git..."
17+
VERSION_OVERRIDE=$(git describe --abbrev=8 --dirty --always)
18+
fi
19+
20+
eval $(go env)
21+
22+
if [ -z ${BIN_PATH+a} ]; then
23+
export BIN_PATH=_output/${GOOS}/${GOARCH}
24+
fi

hack/update-test-metadata.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
source hack/build-info.sh
6+
7+
# Update test metadata
8+
eval "${BIN_PATH}/cluster-version-operator-tests" "update"

0 commit comments

Comments
 (0)