mirror of
https://github.com/redhat-developer/odo.git
synced 2025-10-19 03:06:19 +03:00
Move UI out of experimental mode (#7012)
* Make UI not experimental * Display API and UI URLs * Remove link to old sources * Fix integration tests * Add UI to Usage Data * Add a "Using the GUI to edit the Devfile" page to doc * Add link to odo.dev specific page * Apply suggestions from code review Co-authored-by: Armel Soro <armel@rm3l.org> * Change favicon with odo logo * Display web console URL as part of the Dev status * Update UI static files * Document that Comments not supported * Add UI screenshots --------- Co-authored-by: Armel Soro <armel@rm3l.org>
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ActiveState/termtest/expect"
|
||||
@@ -206,8 +205,7 @@ func StartDevMode(options DevSessionOpts) (devSession DevSession, err error) {
|
||||
result.ErrOut = string(errContents)
|
||||
result.Endpoints = getPorts(string(outContents), options.CustomAddress)
|
||||
if options.StartAPIServer {
|
||||
// errContents because the server message is still printed as a log/warning
|
||||
result.APIServerEndpoint = getAPIServerPort(string(errContents))
|
||||
result.APIServerEndpoint = getAPIServerPort(string(outContents))
|
||||
}
|
||||
return result, nil
|
||||
|
||||
@@ -395,10 +393,8 @@ func getPorts(s, address string) map[string]string {
|
||||
}
|
||||
|
||||
// getAPIServerPort returns the address at which api server is running
|
||||
//
|
||||
// `I0617 11:40:44.124391 49578 starterserver.go:36] API Server started at localhost:20000/api/v1`
|
||||
func getAPIServerPort(s string) string {
|
||||
re := regexp.MustCompile(`(API Server started at localhost:[0-9]+\/api\/v1)`)
|
||||
matches := re.FindString(s)
|
||||
return strings.Split(matches, "at ")[1]
|
||||
re := regexp.MustCompile(`API Server started at http://(localhost:[0-9]+\/api\/v1)`)
|
||||
matches := re.FindStringSubmatch(s)
|
||||
return matches[1]
|
||||
}
|
||||
|
||||
@@ -105,44 +105,6 @@ var _ = Describe("odo dev command with api server tests", func() {
|
||||
Expect(resp.StatusCode).To(BeEquivalentTo(http.StatusOK))
|
||||
})
|
||||
|
||||
It("should describe the API Server port in the experimental mode", func() {
|
||||
args := []string{"describe", "component"}
|
||||
if podman {
|
||||
args = append(args, "--platform", "podman")
|
||||
}
|
||||
stdout := helper.Cmd("odo", args...).AddEnv("ODO_EXPERIMENTAL_MODE=true").ShouldPass().Out()
|
||||
Expect(stdout).To(ContainSubstring("Dev Control Plane"))
|
||||
Expect(stdout).To(ContainSubstring("API: http://%s", devSession.APIServerEndpoint))
|
||||
if customPort {
|
||||
Expect(stdout).To(ContainSubstring("Web UI: http://localhost:%d/", localPort))
|
||||
} else {
|
||||
Expect(stdout).To(MatchRegexp("Web UI: http:\\/\\/localhost:[0-9]+\\/"))
|
||||
}
|
||||
})
|
||||
|
||||
It("should describe the API Server port in the experimental mode (JSON)", func() {
|
||||
args := []string{"describe", "component", "-o", "json"}
|
||||
if podman {
|
||||
args = append(args, "--platform", "podman")
|
||||
}
|
||||
stdout := helper.Cmd("odo", args...).AddEnv("ODO_EXPERIMENTAL_MODE=true").ShouldPass().Out()
|
||||
helper.IsJSON(stdout)
|
||||
helper.JsonPathExist(stdout, "devControlPlane")
|
||||
plt := "cluster"
|
||||
if podman {
|
||||
plt = "podman"
|
||||
}
|
||||
helper.JsonPathContentHasLen(stdout, "devControlPlane", 1)
|
||||
helper.JsonPathContentIs(stdout, "devControlPlane.0.platform", plt)
|
||||
if customPort {
|
||||
helper.JsonPathContentIs(stdout, "devControlPlane.0.localPort", strconv.Itoa(localPort))
|
||||
} else {
|
||||
helper.JsonPathContentIsValidUserPort(stdout, "devControlPlane.0.localPort")
|
||||
}
|
||||
helper.JsonPathContentIs(stdout, "devControlPlane.0.apiServerPath", "/api/v1/")
|
||||
helper.JsonPathContentIs(stdout, "devControlPlane.0.webInterfacePath", "/")
|
||||
})
|
||||
|
||||
It("should describe the API Server port", func() {
|
||||
args := []string{"describe", "component"}
|
||||
if podman {
|
||||
@@ -151,7 +113,11 @@ var _ = Describe("odo dev command with api server tests", func() {
|
||||
stdout := helper.Cmd("odo", args...).ShouldPass().Out()
|
||||
Expect(stdout).To(ContainSubstring("Dev Control Plane"))
|
||||
Expect(stdout).To(ContainSubstring("API: http://%s", devSession.APIServerEndpoint))
|
||||
Expect(stdout).ToNot(ContainSubstring("Web UI: http://localhost:%d/", localPort))
|
||||
if customPort {
|
||||
Expect(stdout).To(ContainSubstring("Web UI: http://localhost:%d/", localPort))
|
||||
} else {
|
||||
Expect(stdout).To(MatchRegexp("Web UI: http:\\/\\/localhost:[0-9]+\\/"))
|
||||
}
|
||||
})
|
||||
|
||||
It("should describe the API Server port (JSON)", func() {
|
||||
@@ -174,7 +140,7 @@ var _ = Describe("odo dev command with api server tests", func() {
|
||||
helper.JsonPathContentIsValidUserPort(stdout, "devControlPlane.0.localPort")
|
||||
}
|
||||
helper.JsonPathContentIs(stdout, "devControlPlane.0.apiServerPath", "/api/v1/")
|
||||
helper.JsonPathDoesNotExist(stdout, "devControlPlane.0.webInterfacePath")
|
||||
helper.JsonPathContentIs(stdout, "devControlPlane.0.webInterfacePath", "/")
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user