Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display information about the running API Server and web UI in odo describe component output #6964

4 changes: 3 additions & 1 deletion tests/helper/helper_dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func StartDevMode(options DevSessionOpts) (devSession DevSession, err error) {
return DevSession{}, err
}

env := append(make([]string, 0, len(options.EnvVars)), options.EnvVars...)
args := []string{"dev"}
if options.NoCommands {
args = append(args, "--no-commands")
Expand All @@ -163,6 +164,7 @@ func StartDevMode(options DevSessionOpts) (devSession DevSession, err error) {
args = append(args, "--address", options.CustomAddress)
}
if options.StartAPIServer {
env = append(env, "ODO_EXPERIMENTAL_MODE=true")
args = append(args, "--api-server")
if options.APIServerPort != 0 {
args = append(args, "--api-server-port", fmt.Sprintf("%d", options.APIServerPort))
Expand All @@ -180,7 +182,7 @@ func StartDevMode(options DevSessionOpts) (devSession DevSession, err error) {
cmd.Cmd.Stdout = c.Tty()
cmd.Cmd.Stderr = c.Tty()

session := cmd.AddEnv(options.EnvVars...).Runner().session
session := cmd.AddEnv(env...).Runner().session
timeoutInSeconds := 420
if options.TimeoutInSeconds != 0 {
timeoutInSeconds = options.TimeoutInSeconds
Expand Down
6 changes: 2 additions & 4 deletions tests/integration/cmd_dev_api_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/utils/pointer"

"github.com/redhat-developer/odo/pkg/labels"
"github.com/redhat-developer/odo/tests/helper"
"k8s.io/utils/pointer"
)

var _ = Describe("odo dev command with api server tests", func() {
Expand Down Expand Up @@ -49,7 +50,6 @@ var _ = Describe("odo dev command with api server tests", func() {
opts := helper.DevSessionOpts{
RunOnPodman: podman,
StartAPIServer: true,
EnvVars: []string{"ODO_EXPERIMENTAL_MODE=true"},
}
if customPort {
opts.APIServerPort = localPort
Expand Down Expand Up @@ -88,7 +88,6 @@ var _ = Describe("odo dev command with api server tests", func() {
opts := helper.DevSessionOpts{
RunOnPodman: podman,
StartAPIServer: true,
EnvVars: []string{"ODO_EXPERIMENTAL_MODE=true"},
}
var err error
devSession, err = helper.StartDevMode(opts)
Expand Down Expand Up @@ -184,7 +183,6 @@ var _ = Describe("odo dev command with api server tests", func() {
CmdlineArgs: args,
RunOnPodman: podman,
StartAPIServer: true,
EnvVars: []string{"ODO_EXPERIMENTAL_MODE=true"},
})
Expect(err).ToNot(HaveOccurred())
})
Expand Down