Skip to content

Commit

Permalink
add UT
Browse files Browse the repository at this point in the history
  • Loading branch information
gsquared94 committed Feb 11, 2021
1 parent c43e858 commit 75a1747
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cmd/skaffold/app/cmd/parse_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,24 @@ requires:
createCfg("cfg00", "image00", ".", []latest.ConfigDependency{{Names: []string{"cfg01"}}, {Path: "doc2", Names: []string{"cfg21"}}}),
},
},
{
description: "dependencies in same file",
documents: []document{
{path: "skaffold.yaml", configs: []mockCfg{{name: "cfg00", requiresStanza: `
requires:
- path: doc1
`}}},
{path: "doc1/skaffold.yaml", configs: []mockCfg{{name: "cfg10", requiresStanza: `
requires:
- configs: [cfg11]
`}, {name: "cfg11", requiresStanza: ""}}},
},
expected: []*latest.SkaffoldConfig{
createCfg("cfg11", "image11", "doc1", nil),
createCfg("cfg10", "image10", "doc1", []latest.ConfigDependency{{Names: []string{"cfg11"}}}),
createCfg("cfg00", "image00", ".", []latest.ConfigDependency{{Path: "doc1"}}),
},
},
{
description: "looped dependencies",
documents: []document{
Expand Down

0 comments on commit 75a1747

Please sign in to comment.