mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
e2e: Add ability to skip known bad Consul versions in compat test. (#26867)
If the latest Consul version has known bugs that cause failures of the test suite, it is useful to be able to skip this. Otherwise, CI will fail on all PRs and release branches until a new version is released.
This commit is contained in:
@@ -27,6 +27,18 @@ const (
|
||||
exactConsulVersionEnv = "NOMAD_E2E_CONSULCOMPAT_CONSUL_VERSION"
|
||||
)
|
||||
|
||||
var (
|
||||
// skipped versions are specific versions we skip due to known issues with
|
||||
// that version.
|
||||
//
|
||||
// 1.22.0-rc1 is skipped as it introduced a dual stack check in the connect
|
||||
// envoy command that did not use passed HTTP API flags to construct the
|
||||
// config object and would always use defaults.
|
||||
skippedVersions = []*version.Version{
|
||||
version.Must(version.NewVersion("1.22.0-rc1")),
|
||||
}
|
||||
)
|
||||
|
||||
func downloadConsulBuild(t *testing.T, b build, baseDir string) {
|
||||
path := filepath.Join(baseDir, binDir, b.Version)
|
||||
must.NoError(t, os.MkdirAll(path, 0755))
|
||||
@@ -58,6 +70,15 @@ func getMinimumVersion(t *testing.T) *version.Version {
|
||||
return v
|
||||
}
|
||||
|
||||
func skipVersion(v *version.Version) bool {
|
||||
for _, sv := range skippedVersions {
|
||||
if v.Equal(sv) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type build struct {
|
||||
Version string `json:"version"`
|
||||
OS string `json:"os"`
|
||||
@@ -134,6 +155,9 @@ func scanConsulVersions(t *testing.T, minimum *version.Version) *set.Set[build]
|
||||
if !usable(v, minimum) {
|
||||
continue
|
||||
}
|
||||
if skipVersion(v) {
|
||||
continue
|
||||
}
|
||||
for _, build := range obj.Builds {
|
||||
if keep(build) {
|
||||
track.add(v, build)
|
||||
|
||||
Reference in New Issue
Block a user