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

Run Devfile personalization in interactive mode from empty directory #6351

Merged
merged 2 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions pkg/init/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,14 +240,9 @@ func (o *InitClient) PersonalizeName(devfile parser.DevfileObj, flags map[string

func (o InitClient) PersonalizeDevfileConfig(devfileobj parser.DevfileObj, flags map[string]string, fs filesystem.Filesystem, dir string) (parser.DevfileObj, error) {
var backend backend.InitBackend
onlyDevfile, err := location.DirContainsOnlyDevfile(fs, dir)
if err != nil {
return parser.DevfileObj{}, err
}

// Interactive mode since no flags are provided
if len(flags) == 0 && !onlyDevfile {
// Other files present in the directory; hence alizer is run
if len(flags) == 0 {
backend = o.interactiveBackend
} else {
backend = o.flagsBackend
Expand Down
3 changes: 3 additions & 0 deletions tests/e2escenarios/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ var _ = Describe("E2E Test", func() {
helper.ExpectString(ctx, "Select project type")
helper.SendLine(ctx, "Node.js")

helper.ExpectString(ctx, "Select container for which you want to change configuration?")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Which starter project do you want to use")
helper.SendLine(ctx, "nodejs-starter")

Expand Down
21 changes: 21 additions & 0 deletions tests/integration/interactive_init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ var _ = Describe("odo init interactive command tests", Label(helper.LabelNoClust
helper.ExpectString(ctx, "Select project type")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Select container for which you want to change configuration?")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Which starter project do you want to use")
helper.SendLine(ctx, "")

Expand All @@ -76,6 +79,9 @@ var _ = Describe("odo init interactive command tests", Label(helper.LabelNoClust
helper.ExpectString(ctx, "Select project type")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Select container for which you want to change configuration?")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Which starter project do you want to use")
helper.SendLine(ctx, "")

Expand Down Expand Up @@ -113,6 +119,9 @@ var _ = Describe("odo init interactive command tests", Label(helper.LabelNoClust
helper.ExpectString(ctx, "Select project type")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Select container for which you want to change configuration?")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Which starter project do you want to use")
helper.SendLine(ctx, starter)

Expand Down Expand Up @@ -144,6 +153,9 @@ var _ = Describe("odo init interactive command tests", Label(helper.LabelNoClust
helper.ExpectString(ctx, "Select project type")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Select container for which you want to change configuration?")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Which starter project do you want to use")
helper.SendLine(ctx, "")

Expand Down Expand Up @@ -174,6 +186,9 @@ var _ = Describe("odo init interactive command tests", Label(helper.LabelNoClust
helper.ExpectString(ctx, "Select project type")
helper.SendLine(ctx, "Vert.x Java")

helper.ExpectString(ctx, "Select container for which you want to change configuration?")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Which starter project do you want to use")
helper.SendLine(ctx, "vertx-cache-example-redhat")

Expand Down Expand Up @@ -265,6 +280,9 @@ var _ = Describe("odo init interactive command tests", Label(helper.LabelNoClust
helper.ExpectString(ctx, "Select project type")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Select container for which you want to change configuration?")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Which starter project do you want to use")
helper.SendLine(ctx, "")
})
Expand Down Expand Up @@ -414,6 +432,9 @@ var _ = Describe("odo init interactive command tests", Label(helper.LabelNoClust
helper.ExpectString(ctx, "Select project type")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Select container for which you want to change configuration?")
helper.SendLine(ctx, "")

helper.ExpectString(ctx, "Which starter project do you want to use")
helper.SendLine(ctx, "")

Expand Down