Skip to content

Commit

Permalink
fix(tests): Always run Envoy compatibility test for current version (#…
Browse files Browse the repository at this point in the history
…3201)

This was otherwise only run at _final_ release time, not even with RCs,
which is much too late to fix it.

Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
  • Loading branch information
michaelbeaumont authored and pull[bot] committed May 23, 2022
1 parent ab9c64e commit 3187c1f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 48 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ workflows:
<<: *release_workflow_filters
requires:
- go_cache
target: test test/release
target: test
- release:
<<: *release_workflow_filters
requires:
Expand Down
1 change: 1 addition & 0 deletions mk/envoy.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ KUMA_DIR ?= .
BUILD_ENVOY_FROM_SOURCES ?= false

ENVOY_TAG ?= b16d390f11376e47f479778f2362ea4f48bdc895 # commit hash or git tag
# Remember to update pkg/version/compatibility.go
ENVOY_VERSION = $(shell ${KUMA_DIR}/tools/envoy/version.sh ${ENVOY_TAG})

ifeq ($(GOOS),linux)
Expand Down
4 changes: 0 additions & 4 deletions mk/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,3 @@ test/kuma-dp: test/kuma ## Dev: Run `kuma-dp` tests only
.PHONY: test/kumactl
test/kumactl: PKG_LIST=./app/kumactl/... ./pkg/config/app/kumactl/...
test/kumactl: test/kuma ## Dev: Run `kumactl` tests only

.PHONY: test/release
test/release: # Dev: Run release tests
$(GO_TEST) $(GO_TEST_OPTS) -tags=release ./test/release/...
2 changes: 1 addition & 1 deletion pkg/version/compatibility.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ var CompatibilityMatrix = Compatibility{
func (c Compatibility) DataplaneConstraints(version string) (*DataplaneCompatibility, error) {
v, err := semver.NewVersion(version)
if err != nil {
return nil, errors.Wrapf(err, "could not build a constraint %s", version)
return nil, errors.Wrapf(err, "could not build a constraint for Kuma version %s", version)
}

var matchedCompat []DataplaneCompatibility
Expand Down
14 changes: 13 additions & 1 deletion pkg/version/compatibility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ var _ = Describe("Compatibility", func() {
_, err := version.CompatibilityMatrix.DataplaneConstraints("!@#")

// then
Expect(err).To(MatchError(`could not build a constraint !@#: Invalid Semantic Version`))
Expect(err).To(MatchError(`could not build a constraint for Kuma version !@#: Invalid Semantic Version`))
})

It("should throw an error when there are multiple matching constraints", func() {
Expand All @@ -67,4 +67,16 @@ var _ = Describe("Compatibility", func() {
// then
Expect(err).To(MatchError("more than one constraint for version 1.0.0: 1.16.0, 1.16.0"))
})

It("should include an entry that matches the master version after a release is made", func() {
// given
currentVersion := version.Build.Version

// when
dpComptibility, err := version.CompatibilityMatrix.DataplaneConstraints(currentVersion)

// then
Expect(err).ToNot(HaveOccurred())
Expect(dpComptibility).ToNot(BeNil(), "Update version.CompatibilityMatrix with a tag including prereleases so there is information about the master branch.")
})
})
23 changes: 0 additions & 23 deletions test/release/compatibility_test.go

This file was deleted.

4 changes: 0 additions & 4 deletions test/release/doc.go

This file was deleted.

14 changes: 0 additions & 14 deletions test/release/release_suite_test.go

This file was deleted.

0 comments on commit 3187c1f

Please sign in to comment.