mirror of https://github.com/knative/client.git
fix(e2e): Removes workaround for ensuring LCR=LRR at client side (#524)
Related to #500 - The fix for serving#6060 merged (serving#6069), removing the workaround at client side e2e tests for additional LCR=LRR check after service update return. - Now we expect service status to have LCR=LRR if the service's conditions turned True after last update.
This commit is contained in:
parent
0efde628cb
commit
7024933f0a
|
|
@ -21,7 +21,6 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
|
||||||
|
|
||||||
"gotest.tools/assert"
|
"gotest.tools/assert"
|
||||||
"knative.dev/client/pkg/util"
|
"knative.dev/client/pkg/util"
|
||||||
|
|
@ -34,9 +33,6 @@ var targetFieldsLength = 4
|
||||||
// returns deployed service targets separated by '|' and each target fields seprated by comma
|
// returns deployed service targets separated by '|' and each target fields seprated by comma
|
||||||
var targetsJsonPath = "jsonpath={range .status.traffic[*]}{.tag}{','}{.revisionName}{','}{.percent}{','}{.latestRevision}{'|'}{end}"
|
var targetsJsonPath = "jsonpath={range .status.traffic[*]}{.tag}{','}{.revisionName}{','}{.percent}{','}{.latestRevision}{'|'}{end}"
|
||||||
|
|
||||||
var lcrJsonPath = "jsonpath={.status.latestCreatedRevisionName}"
|
|
||||||
var lrrJsonPath = "jsonpath={.status.latestReadyRevisionName}"
|
|
||||||
|
|
||||||
// TargetFields are used in e2e to store expected fields per traffic target
|
// TargetFields are used in e2e to store expected fields per traffic target
|
||||||
// and actual traffic targets fields of deployed service are converted into struct before comparing
|
// and actual traffic targets fields of deployed service are converted into struct before comparing
|
||||||
type TargetFields struct {
|
type TargetFields struct {
|
||||||
|
|
@ -366,24 +362,7 @@ func TestTrafficSplit(t *testing.T) {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Remove after serving/issue#6060 is fixed
|
|
||||||
// Since service update request has returned (True), lets retry 5 times
|
|
||||||
// with 2 seconds delay to ensure LCR = LRR, fail otherwise
|
|
||||||
func (test *e2eTest) ensureLRREqualToLCR(t *testing.T, serviceName string) {
|
|
||||||
for i := 0; i < 5; i++ {
|
|
||||||
lcr := test.serviceDescribeWithJsonPath(t, serviceName, lcrJsonPath)
|
|
||||||
lrr := test.serviceDescribeWithJsonPath(t, serviceName, lrrJsonPath)
|
|
||||||
if lcr == lrr {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
time.Sleep(time.Second * 2)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (test *e2eTest) verifyTargets(t *testing.T, serviceName string, expectedTargets []TargetFields) {
|
func (test *e2eTest) verifyTargets(t *testing.T, serviceName string, expectedTargets []TargetFields) {
|
||||||
// TODO: Workaround for serving/issue#6060, remove as fixed
|
|
||||||
test.ensureLRREqualToLCR(t, serviceName)
|
|
||||||
|
|
||||||
out := test.serviceDescribeWithJsonPath(t, serviceName, targetsJsonPath)
|
out := test.serviceDescribeWithJsonPath(t, serviceName, targetsJsonPath)
|
||||||
assert.Check(t, out != "")
|
assert.Check(t, out != "")
|
||||||
actualTargets, err := splitTargets(out, targetsSeparator, len(expectedTargets))
|
actualTargets, err := splitTargets(out, targetsSeparator, len(expectedTargets))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue