-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the capability to run dry runs on shell script steps. Did some slight refactorings to add tests. Also moved AKS Kubeconfig creation into Resource group to only call it once, as it is not required to run it for every stip since it can be reused
- Loading branch information
Showing
13 changed files
with
353 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package config | ||
|
||
import "testing" | ||
|
||
func TestGetByPath(t *testing.T) { | ||
tests := []struct { | ||
name string | ||
vars Variables | ||
path string | ||
want any | ||
found bool | ||
}{ | ||
{ | ||
name: "simple", | ||
vars: Variables{ | ||
"key": "value", | ||
}, | ||
path: "key", | ||
want: "value", | ||
found: true, | ||
}, | ||
{ | ||
name: "nested", | ||
vars: Variables{ | ||
"key": Variables{ | ||
"key": "value", | ||
}, | ||
}, | ||
path: "key.key", | ||
want: "value", | ||
found: true, | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
got, found := tt.vars.GetByPath(tt.path) | ||
if got != tt.want { | ||
t.Errorf("Variables.GetByPath() got = %v, want %v", got, tt.want) | ||
} | ||
if found != tt.found { | ||
t.Errorf("Variables.GetByPath() found = %v, want %v", found, tt.found) | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.