forked from cloudfoundry/cli
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recently we changed `cf auth --client-credentials` to not save the ClientSecret. This renders "refreshing" for client-credentials impossible. Streaming logs through the NOAA Client previously relied on refreshing to get a new token. This change is to update it to pass the current access token through by default. A similar change could be made to v3action and v7action. We decided that was out of scope for our current release patch. [#165777485](https://www.pivotaltracker.com/story/show/165777485) Co-authored-by: Brendan Smith <brsmith@pivotal.io> Co-authored-by: Will Murphy <wmurphy@pivotal.io>
- Loading branch information
1 parent
9ecdaaf
commit 4a2de69
Showing
4 changed files
with
125 additions
and
7 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
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,57 @@ | ||
package push | ||
|
||
import ( | ||
"code.cloudfoundry.org/cli/integration/helpers" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
. "github.com/onsi/gomega/gbytes" | ||
. "github.com/onsi/gomega/gexec" | ||
) | ||
|
||
var _ = Describe("push with only an app name when authenticated with client-credentials", func() { | ||
var ( | ||
appName string | ||
clientID string | ||
) | ||
|
||
BeforeEach(func() { | ||
appName = helpers.NewAppName() | ||
clientID = helpers.LoginCFWithClientCredentials() | ||
helpers.TargetOrgAndSpace(organization, space) | ||
}) | ||
|
||
AfterEach(func() { | ||
helpers.LogoutCF() | ||
}) | ||
|
||
Describe("app existence", func() { | ||
When("the app does not exist", func() { | ||
It("creates the app", func() { | ||
helpers.WithHelloWorldApp(func(dir string) { | ||
session := helpers.CustomCF(helpers.CFEnv{WorkingDirectory: dir}, PushCommandName, appName) | ||
Eventually(session).Should(Say(`Pushing app %s to org %s / space %s as %s\.\.\.`, appName, organization, space, clientID)) | ||
Eventually(session).Should(Say(`Getting app info\.\.\.`)) | ||
Eventually(session).Should(Say(`Creating app with these attributes\.\.\.`)) | ||
Eventually(session).Should(Say(`\+\s+name:\s+%s`, appName)) | ||
Eventually(session).Should(Say(`\s+routes:`)) | ||
Eventually(session).Should(Say(`(?i)\+\s+%s.%s`, appName, helpers.DefaultSharedDomain())) | ||
Eventually(session).Should(Say(`Mapping routes\.\.\.`)) | ||
Eventually(session).Should(Say(`Comparing local files to remote cache\.\.\.`)) | ||
Eventually(session).Should(Say(`Packaging files to upload\.\.\.`)) | ||
Eventually(session).Should(Say(`Uploading files\.\.\.`)) | ||
Eventually(session).Should(Say("100.00%")) | ||
Eventually(session).Should(Say(`Waiting for API to complete processing files\.\.\.`)) | ||
helpers.ConfirmStagingLogs(session) | ||
Eventually(session).Should(Say(`Waiting for app to start\.\.\.`)) | ||
Eventually(session).Should(Say(`requested state:\s+started`)) | ||
Eventually(session).Should(Exit(0)) | ||
}) | ||
|
||
session := helpers.CF("app", appName) | ||
Eventually(session).Should(Say(`name:\s+%s`, appName)) | ||
Eventually(session).Should(Exit(0)) | ||
}) | ||
}) | ||
}) | ||
}) |