Skip to content

Commit

Permalink
Refactoring route command integration test
Browse files Browse the repository at this point in the history
Route command summary table shows the protocol when
the cli points to CAPI with a version higher or equal
to 3.104.0. V8's Minimum CAPI version is 3.99.0,
therefore we need to skip the assertion of this protocol
when the testuses CAPI minimum version.

Co-authored-by: Alexander Berezovsky <[email protected]>
  • Loading branch information
Juan Diego Gonzalez and a-b committed Sep 16, 2021
1 parent 67681a0 commit e8d41cf
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions integration/v7/isolated/route_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package isolated
import (
"fmt"

"code.cloudfoundry.org/cli/api/cloudcontroller/ccversion"
. "code.cloudfoundry.org/cli/cf/util/testhelpers/matchers"
"code.cloudfoundry.org/cli/integration/helpers"
. "github.com/onsi/ginkgo"
Expand Down Expand Up @@ -119,6 +120,12 @@ var _ = Describe("route command", func() {
Eventually(session).Should(Say(`\n`))
Eventually(session).Should(Say(`Destinations:`))
Eventually(session).Should(Say(`\s+app\s+process\s+port\s+protocol`))
Eventually(session).Should(Exit(0))
})

It("displays the protocol in the route summary and exits without failing", func() {
helpers.SkipIfVersionLessThan(ccversion.MinVersionHTTP2RoutingV3)
session := helpers.CF("route", domainName, "--hostname", hostname, "--path", path)
Eventually(session).Should(Say(`\s+killer\s+web\s+8080\s+http1`))
Eventually(session).Should(Exit(0))
})
Expand Down Expand Up @@ -161,6 +168,12 @@ var _ = Describe("route command", func() {
Eventually(session).Should(Say(`\n`))
Eventually(session).Should(Say(`Destinations:`))
Eventually(session).Should(Say(`\s+app\s+process\s+port\s+protocol`))
Eventually(session).Should(Exit(0))
})

It("displays the protocol in the route summary and exits without failing", func() {
helpers.SkipIfVersionLessThan(ccversion.MinVersionHTTP2RoutingV3)
session := helpers.CF("route", tcpDomain.Name, "--port", fmt.Sprintf("%d", port))
Eventually(session).Should(Say(`\s+killer\s+web\s+8080\s+tcp`))
Eventually(session).Should(Exit(0))
})
Expand Down

0 comments on commit e8d41cf

Please sign in to comment.