-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop single namespace assumption from E2E tests (#1446)
* Drop single namespace assumption from E2E tests Also adds a test for cross namespace association that currently only works in local mode. * CR Fix: Change test function comment * Fix test failure
- Loading branch information
1 parent
a2aa835
commit bd233c1
Showing
22 changed files
with
120 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
// or more contributor license agreements. Licensed under the Elastic License; | ||
// you may not use this file except in compliance with the Elastic License. | ||
|
||
package kb | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/elastic/cloud-on-k8s/operators/test/e2e/test" | ||
"github.com/elastic/cloud-on-k8s/operators/test/e2e/test/elasticsearch" | ||
"github.com/elastic/cloud-on-k8s/operators/test/e2e/test/kibana" | ||
) | ||
|
||
// TestCrossNSAssociation tests associating Elasticsearch and Kibana running in different namespaces. | ||
func TestCrossNSAssociation(t *testing.T) { | ||
// This test currently does not work in the E2E environment because each namespace has a dedicated | ||
// controller (see https://github.com/elastic/cloud-on-k8s/issues/1438) | ||
if !test.Ctx().Local { | ||
t.SkipNow() | ||
} | ||
|
||
esNamespace := test.Ctx().ManagedNamespace(0) | ||
kbNamespace := test.Ctx().ManagedNamespace(1) | ||
name := "test-cross-ns-assoc" | ||
|
||
esBuilder := elasticsearch.NewBuilder(name). | ||
WithNamespace(esNamespace). | ||
WithESMasterDataNodes(1, elasticsearch.DefaultResources). | ||
WithRestrictedSecurityContext() | ||
|
||
kbBuilder := kibana.NewBuilder(name). | ||
WithNamespace(kbNamespace). | ||
WithNodeCount(1). | ||
WithRestrictedSecurityContext() | ||
kbBuilder.Kibana.Spec.ElasticsearchRef.Name = name | ||
kbBuilder.Kibana.Spec.ElasticsearchRef.Namespace = esNamespace | ||
|
||
builders := []test.Builder{esBuilder, kbBuilder} | ||
test.RunMutations(t, builders, builders) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.