Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #692: add version information to all resources
- Loading branch information
1 parent
efa72a4
commit 1a5ca8c
Showing
16 changed files
with
359 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// +build integration | ||
|
||
// To enable compilation of this file in Goland, go to "Settings -> Go -> Vendoring & Build Tags -> Custom Tags" and add "integration" | ||
|
||
/* | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package e2e | ||
|
||
import ( | ||
"testing" | ||
"time" | ||
|
||
"github.com/apache/camel-k/pkg/apis/camel/v1alpha1" | ||
"github.com/apache/camel-k/pkg/util/defaults" | ||
. "github.com/onsi/gomega" | ||
v1 "k8s.io/api/core/v1" | ||
) | ||
|
||
func TestPlatformUpgrade(t *testing.T) { | ||
withNewTestNamespace(func(ns string) { | ||
RegisterTestingT(t) | ||
Expect(kamel("install", "-n", ns).Execute()).Should(BeNil()) | ||
Eventually(platformVersion(ns)).Should(Equal(defaults.Version)) | ||
|
||
// Scale the operator down to zero | ||
Expect(scaleOperator(ns, 0)).Should(BeNil()) | ||
Eventually(operatorPod(ns)).Should(BeNil()) | ||
|
||
// Change the version to an older one | ||
Expect(setPlatformVersion(ns, "an.older.one")).Should(BeNil()) | ||
Eventually(platformVersion(ns)).Should(Equal("an.older.one")) | ||
|
||
// Scale the operator up | ||
Expect(scaleOperator(ns, 1)).Should(BeNil()) | ||
Eventually(operatorPod(ns)).ShouldNot(BeNil()) | ||
|
||
// Check the platform version change | ||
Eventually(platformVersion(ns)).Should(Equal(defaults.Version)) | ||
}) | ||
} | ||
|
||
func TestIntegrationUpgrade(t *testing.T) { | ||
withNewTestNamespace(func(ns string) { | ||
RegisterTestingT(t) | ||
Expect(kamel("install", "-n", ns).Execute()).Should(BeNil()) | ||
Eventually(platformVersion(ns)).Should(Equal(defaults.Version)) | ||
|
||
// Run an integration | ||
Expect(kamel("run", "-n", ns, "files/js.js").Execute()).Should(BeNil()) | ||
Eventually(integrationPodPhase(ns, "js"), 5*time.Minute).Should(Equal(v1.PodRunning)) | ||
initialImage := integrationPodImage(ns, "js")() | ||
|
||
// Scale the operator down to zero | ||
Expect(scaleOperator(ns, 0)).Should(BeNil()) | ||
Eventually(operatorPod(ns)).Should(BeNil()) | ||
|
||
// Change the version to an older one | ||
Expect(setIntegrationVersion(ns, "js", "an.older.one")).Should(BeNil()) | ||
Expect(setAllKitsVersion(ns, "an.older.one")).Should(BeNil()) | ||
Eventually(integrationVersion(ns, "js")).Should(Equal("an.older.one")) | ||
Eventually(kitsWithVersion(ns, "an.older.one")).Should(Equal(1)) | ||
Eventually(kitsWithVersion(ns, defaults.Version)).Should(Equal(0)) | ||
|
||
// Scale the operator up | ||
Expect(scaleOperator(ns, 1)).Should(BeNil()) | ||
Eventually(operatorPod(ns)).ShouldNot(BeNil()) | ||
|
||
// Clear the integration phase | ||
Expect(setIntegrationPhase(ns, "js", v1alpha1.IntegrationPhaseNone)).Should(BeNil()) | ||
|
||
// Check the integration version change | ||
Eventually(integrationVersion(ns, "js")).Should(Equal(defaults.Version)) | ||
Eventually(kitsWithVersion(ns, "an.older.one")).Should(Equal(1)) // old one is not recycled | ||
Eventually(kitsWithVersion(ns, defaults.Version)).Should(Equal(1)) | ||
Eventually(integrationPodImage(ns, "js")).ShouldNot(Equal(initialImage)) // rolling deployment triggered | ||
Eventually(integrationPodPhase(ns, "js"), 5*time.Minute).Should(Equal(v1.PodRunning)) | ||
}) | ||
} |
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.