Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move trait test to separate directory #2059

Merged
merged 1 commit into from
Feb 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package common
package traits

import (
"fmt"
Expand Down Expand Up @@ -47,7 +47,7 @@ func TestAffinityTrait(t *testing.T) {
if hostname != "" {
t.Run("Run Java with node affinity", func(t *testing.T) {
RegisterTestingT(t)
Expect(Kamel("run", "-n", ns, "files/Java.java",
Expect(Kamel("run", "-n", ns, "../files/Java.java",
"--name", "java1",
"-t", "affinity.enabled=true",
"-t", fmt.Sprintf("affinity.node-affinity-labels=kubernetes.io/hostname in(%s)", hostname)).Execute()).Should(BeNil())
Expand All @@ -68,7 +68,7 @@ func TestAffinityTrait(t *testing.T) {

t.Run("Run Java with pod affinity", func(t *testing.T) {
RegisterTestingT(t)
Expect(Kamel("run", "-n", ns, "files/Java.java",
Expect(Kamel("run", "-n", ns, "../files/Java.java",
"--name", "java2",
"-t", "affinity.enabled=true",
"-t", "affinity.pod-affinity-labels=camel.apache.org/integration").Execute()).Should(BeNil())
Expand All @@ -90,7 +90,7 @@ func TestAffinityTrait(t *testing.T) {
t.Run("Run Java with pod anti affinity", func(t *testing.T) {
RegisterTestingT(t)

Expect(Kamel("run", "-n", ns, "files/Java.java",
Expect(Kamel("run", "-n", ns, "../files/Java.java",
"--name", "java3",
"-t", "affinity.enabled=true",
"-t", "affinity.pod-anti-affinity-labels=camel.apache.org/integration").Execute()).Should(BeNil())
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions e2e/common/istio_test.go → e2e/common/traits/istio_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package common
package traits

import (
"testing"
Expand All @@ -37,7 +37,7 @@ func TestIstioTrait(t *testing.T) {
Expect(Kamel("install", "-n", ns).Execute()).Should(BeNil())

t.Run("Run Java with Istio", func(t *testing.T) {
Expect(Kamel("run", "-n", ns, "files/Java.java",
Expect(Kamel("run", "-n", ns, "../files/Java.java",
"-t", "istio.enabled=true").Execute()).Should(BeNil())
Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutLong).Should(Equal(v1.PodRunning))
Eventually(IntegrationCondition(ns, "java", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package common
package traits

import (
"fmt"
Expand All @@ -37,7 +37,7 @@ func TestJolokiaTrait(t *testing.T) {
Expect(Kamel("install", "-n", ns).Execute()).Should(BeNil())

t.Run("Run Java with Jolokia", func(t *testing.T) {
Expect(Kamel("run", "-n", ns, "files/Java.java",
Expect(Kamel("run", "-n", ns, "../files/Java.java",
"-t", "jolokia.enabled=true",
"-t", "jolokia.use-ssl-client-authentication=false",
"-t", "jolokia.protocol=http",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package common
package traits

import (
"testing"
Expand All @@ -30,7 +30,7 @@ import (
v1 "k8s.io/api/core/v1"
)

func TestAddons(t *testing.T) {
func TestMasterTrait(t *testing.T) {

WithNewTestNamespace(t, func(ns string) {
Expect(Kamel("install", "-n", ns).Execute()).Should(BeNil())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package common
package traits

import (
"fmt"
Expand Down Expand Up @@ -48,7 +48,7 @@ func TestPrometheusTrait(t *testing.T) {

Expect(Kamel("install", "-n", ns).Execute()).Should(BeNil())

Expect(Kamel("run", "-n", ns, "files/Java.java",
Expect(Kamel("run", "-n", ns, "../files/Java.java",
"-t", "prometheus.enabled=true",
"-t", fmt.Sprintf("prometheus.service-monitor=%v", createServiceMonitor)).Execute()).Should(BeNil())
Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutLong).Should(Equal(v1.PodRunning))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package common
package traits

import (
"testing"
Expand All @@ -41,7 +41,7 @@ func TestPullSecretTrait(t *testing.T) {
Expect(Kamel("install", "-n", ns).Execute()).Should(BeNil())

t.Run("Image pull secret is set on pod", func(t *testing.T) {
Expect(Kamel("run", "-n", ns, "files/Java.java",
Expect(Kamel("run", "-n", ns, "../files/Java.java",
"-t", "pull-secret.enabled=true",
"-t", "pull-secret.secret-name=dummy-secret").Execute()).Should(BeNil())
// pod may not run because the pull secret is dummy
Expand All @@ -55,7 +55,7 @@ func TestPullSecretTrait(t *testing.T) {
})

t.Run("Explicity disable image pull secret", func(t *testing.T) {
Expect(Kamel("run", "-n", ns, "files/Java.java",
Expect(Kamel("run", "-n", ns, "../files/Java.java",
"-t", "pull-secret.enabled=false").Execute()).Should(BeNil())
Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutLong).Should(Equal(v1.PodRunning))
Eventually(IntegrationCondition(ns, "java", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
Expand All @@ -75,7 +75,7 @@ func TestPullSecretTrait(t *testing.T) {
if ocp {
// OpenShift always has an internal registry so image pull secret is set by default
t.Run("Image pull secret is automatically set by default", func(t *testing.T) {
Expect(Kamel("run", "-n", ns, "files/Java.java").Execute()).Should(BeNil())
Expect(Kamel("run", "-n", ns, "../files/Java.java").Execute()).Should(BeNil())
Eventually(IntegrationPodPhase(ns, "java"), TestTimeoutLong).Should(Equal(v1.PodRunning))
Eventually(IntegrationCondition(ns, "java", camelv1.IntegrationConditionReady), TestTimeoutShort).Should(Equal(v1.ConditionTrue))
Eventually(IntegrationLogs(ns, "java"), TestTimeoutShort).Should(ContainSubstring("Magicstring!"))
Expand Down
2 changes: 1 addition & 1 deletion script/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ test: build
go test ./...

test-integration: build
STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" go test -timeout 60m -v ./e2e/common -tags=integration && go test -timeout 60m -v ./e2e/common/languages -tags=integration
STAGING_RUNTIME_REPO="$(STAGING_RUNTIME_REPO)" go test -timeout 60m -v ./e2e/common -tags=integration && go test -timeout 60m -v ./e2e/common/languages -tags=integration && go test -timeout 60m -v ./e2e/common/traits -tags=integration
#go test -timeout 60m -v ./e2e/common -tags=integration

test-knative: build
Expand Down