Skip to content

Commit

Permalink
Fix random behavior on test (#1481)
Browse files Browse the repository at this point in the history
Signed-off-by: Javier López Barba <javier@okteto.com>
  • Loading branch information
jLopezbarb committed May 6, 2021
1 parent 9f0f7d9 commit 924fd7e
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions pkg/model/stack_test.go
Expand Up @@ -86,11 +86,14 @@ services:
if len(s.Services["vote"].Environment) != 2 {
t.Errorf("'vote.env' was not parsed: %+v", s)
}
if s.Services["vote"].Environment[0].Name != "OPTION_A" || s.Services["vote"].Environment[0].Value != "Cats" {
t.Errorf("'vote.env[0]' was not parsed: %+v", s)
}
if s.Services["vote"].Environment[1].Name != "OPTION_B" || s.Services["vote"].Environment[1].Value != "Dogs" {
t.Errorf("'vote.env[1]' was not parsed: %+v", s)
for _, env := range s.Services["vote"].Environment {
if env.Name == "OPTION_A" && env.Value == "Cats" {
continue
} else if env.Name == "OPTION_B" && env.Value == "Dogs" {
continue
} else {
t.Errorf("'vote.env' was not parsed correctly: %+v", s.Services["vote"].Environment)
}
}
if len(s.Services["vote"].Ports) != 1 {
t.Errorf("'vote.ports' was not parsed: %+v", s)
Expand Down Expand Up @@ -229,15 +232,9 @@ services:
} else if env.Name == "OPTION_B" && env.Value == "Dogs" {
continue
} else {
t.Errorf("'vote.env' was not parsed correctly: %+v", s)
t.Errorf("'vote.env' was not parsed correctly: %+v", s.Services["vote"].Environment)
}
}
if s.Services["vote"].Environment[0].Name != "OPTION_A" || s.Services["vote"].Environment[0].Value != "Cats" {
t.Errorf("'vote.env[0]' was not parsed: %+v", s)
}
if s.Services["vote"].Environment[1].Name != "OPTION_B" || s.Services["vote"].Environment[1].Value != "Dogs" {
t.Errorf("'vote.env[1]' was not parsed: %+v", s)
}
if len(s.Services["vote"].Ports) != 1 {
t.Errorf("'vote.ports' was not parsed: %+v", s)
}
Expand Down

0 comments on commit 924fd7e

Please sign in to comment.