Skip to content

Commit

Permalink
Disable test agent with fleet mode in 8.0.1 (#6957)
Browse files Browse the repository at this point in the history
Move version checks to agent builder to skip tests due to the following stack bugs:
- Kibana bug "index conflict on install policy" (elastic/kibana#126611)
- Elastic agent bug "deadlock on startup" (#6331 (comment))
  • Loading branch information
thbkrkr authored Jun 27, 2023
1 parent a750388 commit 7f57f15
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 51 deletions.
12 changes: 0 additions & 12 deletions test/e2e/agent/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,6 @@ func TestMultipleOutputConfig(t *testing.T) {
}

func TestFleetMode(t *testing.T) {
v := version.MustParse(test.Ctx().ElasticStackVersion)

// https://github.com/elastic/cloud-on-k8s/issues/6331
if v.LT(version.MinFor(8, 7, 0)) && v.GE(version.MinFor(8, 6, 0)) {
t.SkipNow()
}

// installation of policies and integrations through Kibana file based configuration was broken between those versions:
if v.LT(version.MinFor(8, 1, 0)) && v.GTE(version.MinFor(8, 0, 0)) {
t.SkipNow()
}

name := "test-agent-fleet"

esBuilder := elasticsearch.NewBuilder(name).
Expand Down
19 changes: 0 additions & 19 deletions test/e2e/agent/recipes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ func TestMultiOutputRecipe(t *testing.T) {
}

func TestFleetKubernetesIntegrationRecipe(t *testing.T) {
v := version.MustParse(test.Ctx().ElasticStackVersion)

// https://github.com/elastic/cloud-on-k8s/issues/6331
if v.LT(version.MinFor(8, 7, 0)) && v.GE(version.MinFor(8, 6, 0)) {
t.SkipNow()
}

customize := func(builder agent.Builder) agent.Builder {
if !builder.Agent.Spec.FleetServerEnabled {
return builder
Expand Down Expand Up @@ -143,11 +136,6 @@ func TestFleetCustomLogsIntegrationRecipe(t *testing.T) {
t.Skip("Disabled since 8.8.0, refer to https://github.com/elastic/cloud-on-k8s/issues/5105")
}

// https://github.com/elastic/cloud-on-k8s/issues/6331
if v.LT(version.MinFor(8, 7, 0)) && v.GE(version.MinFor(8, 6, 0)) {
t.Skip("Disabled for 8.6.x, refer to https://github.com/elastic/cloud-on-k8s/issues/6331")
}

notLoggingPod := beat.NewPodBuilder("test")
loggingPod := beat.NewPodBuilder("test")
loggingPod.Pod.Namespace = "default"
Expand All @@ -174,13 +162,6 @@ func TestFleetCustomLogsIntegrationRecipe(t *testing.T) {
}

func TestFleetAPMIntegrationRecipe(t *testing.T) {
v := version.MustParse(test.Ctx().ElasticStackVersion)

// https://github.com/elastic/cloud-on-k8s/issues/6331
if v.LT(version.MinFor(8, 7, 0)) && v.GE(version.MinFor(8, 6, 0)) {
t.SkipNow()
}

customize := func(builder agent.Builder) agent.Builder {
if !builder.Agent.Spec.FleetServerEnabled {
return builder
Expand Down
5 changes: 0 additions & 5 deletions test/e2e/agent/tls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ import (
func TestFleetAgentWithoutTLS(t *testing.T) {
v := version.MustParse(test.Ctx().ElasticStackVersion)

// https://github.com/elastic/cloud-on-k8s/issues/6331
if v.LT(version.MinFor(8, 7, 0)) && v.GE(version.MinFor(8, 6, 0)) {
t.SkipNow()
}

// Disabling TLS for Fleet isn't supported before 7.16, as Elasticsearch doesn't allow
// api keys to be enabled when TLS is disabled.
if v.LT(version.MustParse("7.16.0")) {
Expand Down
14 changes: 0 additions & 14 deletions test/e2e/agent/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,16 @@ package agent
import (
"testing"

"github.com/elastic/cloud-on-k8s/v2/pkg/controller/common/version"
"github.com/elastic/cloud-on-k8s/v2/test/e2e/test"
"github.com/elastic/cloud-on-k8s/v2/test/e2e/test/agent"
"github.com/elastic/cloud-on-k8s/v2/test/e2e/test/elasticsearch"
"github.com/elastic/cloud-on-k8s/v2/test/e2e/test/kibana"
)

func TestAgentVersionUpgradeToLatest8x(t *testing.T) {

srcVersion, dstVersion := test.GetUpgradePathTo8x(test.Ctx().ElasticStackVersion)

test.SkipInvalidUpgrade(t, srcVersion, dstVersion)

sv := version.MustParse(srcVersion)
dv := version.MustParse(dstVersion)

// https://github.com/elastic/cloud-on-k8s/issues/6331
if sv.LT(version.MinFor(8, 7, 0)) && sv.GE(version.MinFor(8, 6, 0)) {
t.SkipNow()
}
if dv.LT(version.MinFor(8, 7, 0)) && dv.GE(version.MinFor(8, 6, 0)) {
t.SkipNow()
}

name := "test-agent-upgrade"
esBuilder := elasticsearch.NewBuilder(name).
WithVersion(srcVersion).
Expand Down
12 changes: 11 additions & 1 deletion test/e2e/test/agent/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,22 @@ type Builder struct {
}

func (b Builder) SkipTest() bool {
ver := version.MustParse(b.Agent.Spec.Version)
supportedVersions := version.SupportedAgentVersions

if b.Agent.Spec.FleetModeEnabled() {
supportedVersions = version.SupportedFleetModeAgentVersions

// Kibana bug "index conflict on install policy", https://github.com/elastic/kibana/issues/126611
if ver.GTE(version.MinFor(8, 0, 0)) && ver.LT(version.MinFor(8, 1, 0)) {
return true
}
// Elastic agent bug "deadlock on startup", https://github.com/elastic/cloud-on-k8s/issues/6331#issuecomment-1478320487
if ver.GE(version.MinFor(8, 6, 0)) && ver.LT(version.MinFor(8, 7, 0)) {
return true
}
}

ver := version.MustParse(b.Agent.Spec.Version)
return supportedVersions.WithinRange(ver) != nil
}

Expand Down

0 comments on commit 7f57f15

Please sign in to comment.