Skip to content

Commit

Permalink
Add comments for unit test test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Racer159 committed Oct 31, 2023
1 parent 2a31040 commit 2251847
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/pkg/packager/composer/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ func TestCompose(t *testing.T) {
returnError: false,
expectedComposed: types.ZarfComponent{
Name: "import-hello",
// Files should always be appended with corrected directories
Files: []types.ZarfFile{
{Source: fmt.Sprintf("%s%stoday.txt", finalDirectory, string(os.PathSeparator))},
{Source: fmt.Sprintf("%s%sworld.txt", firstDirectory, string(os.PathSeparator))},
{Source: "hello.txt"},
},
// Charts should be merged if names match and appended if not with corrected directories
Charts: []types.ZarfChart{
{
Name: "hello",
Expand All @@ -119,6 +121,7 @@ func TestCompose(t *testing.T) {
},
},
},
// Manifests should be merged if names match and appended if not with corrected directories
Manifests: []types.ZarfManifest{
{
Name: "hello",
Expand All @@ -134,12 +137,14 @@ func TestCompose(t *testing.T) {
},
},
},
// DataInjections should always be appended with corrected directories
DataInjections: []types.ZarfDataInjection{
{Source: fmt.Sprintf("%s%stoday", finalDirectory, string(os.PathSeparator))},
{Source: fmt.Sprintf("%s%sworld", firstDirectory, string(os.PathSeparator))},
{Source: "hello"},
},
Actions: types.ZarfComponentActions{
// OnCreate actions should be appended with corrected directories that properly handle default directories
OnCreate: types.ZarfComponentActionSet{
Defaults: types.ZarfComponentActionDefaults{
Dir: "hello-dc",
Expand All @@ -165,6 +170,7 @@ func TestCompose(t *testing.T) {
{Cmd: "hello-fc", Dir: &firstDirectoryActionDefault},
},
},
// OnDeploy actions should be appended without corrected directories
OnDeploy: types.ZarfComponentActionSet{
Defaults: types.ZarfComponentActionDefaults{
Dir: "hello-dd",
Expand All @@ -190,6 +196,7 @@ func TestCompose(t *testing.T) {
{Cmd: "hello-fd"},
},
},
// OnRemove actions should be appended without corrected directories
OnRemove: types.ZarfComponentActionSet{
Defaults: types.ZarfComponentActionDefaults{
Dir: "hello-dr",
Expand All @@ -216,6 +223,7 @@ func TestCompose(t *testing.T) {
},
},
},
// Extensions should be appended with corrected directories
Extensions: extensions.ZarfComponentExtensions{
BigBang: &extensions.BigBang{
ValuesFiles: []string{
Expand Down

0 comments on commit 2251847

Please sign in to comment.