Skip to content

Commit 28e79e2

Browse files
soltyshAndy Goldstein
authored andcommitted
Fix extended tests
1 parent 2eeb200 commit 28e79e2

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

test/extended/deployments/deployments.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/openshift/origin/pkg/client"
1919
deployapi "github.com/openshift/origin/pkg/deploy/api"
2020
deployutil "github.com/openshift/origin/pkg/deploy/util"
21+
imageapi "github.com/openshift/origin/pkg/image/api"
2122
exutil "github.com/openshift/origin/test/extended/util"
2223
)
2324

@@ -297,9 +298,9 @@ var _ = g.Describe("deploymentconfigs", func() {
297298
o.Expect(waitForLatestCondition(oc, name, deploymentRunTimeout, deploymentReachedCompletion)).NotTo(o.HaveOccurred())
298299

299300
g.By("verifying the post deployment action happened: tag is set")
300-
var out string
301+
var istag *imageapi.ImageStreamTag
301302
pollErr := wait.PollImmediate(100*time.Millisecond, 1*time.Minute, func() (bool, error) {
302-
out, err = oc.Run("get").Args("istag/sample-stream:deployed").Output()
303+
istag, err = oc.Client().ImageStreamTags(oc.Namespace()).Get("sample-stream", "deployed")
303304
if errors.IsNotFound(err) {
304305
return false, nil
305306
}
@@ -313,8 +314,8 @@ var _ = g.Describe("deploymentconfigs", func() {
313314
}
314315
o.Expect(pollErr).NotTo(o.HaveOccurred())
315316

316-
if !strings.Contains(out, "origin-pod") {
317-
err = fmt.Errorf("expected %q to be part of the image reference in %q", "origin-pod", out)
317+
if istag.Tag == nil || istag.Tag.From == nil || istag.Tag.From.Name != "openshift/origin-pod" {
318+
err = fmt.Errorf("expected %q to be part of the image reference in %#v", "openshift/origin-pod", istag)
318319
o.Expect(err).NotTo(o.HaveOccurred())
319320
}
320321
})

test/extended/testdata/deployments/custom-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ spec:
2626
echo Halfway
2727
openshift-deploy
2828
echo Finished
29+
sleep 1
2930
template:
3031
metadata:
3132
labels:
@@ -38,6 +39,6 @@ spec:
3839
name: myapp
3940
command:
4041
- /bin/sleep
41-
- "100"
42+
- "10"
4243
triggers:
4344
- type: ConfigChange

0 commit comments

Comments
 (0)