Skip to content

Commit d8cae2a

Browse files
committed
Add tests for Helm synthesis with chart-name option
Signed-off-by: Matthew Cane <matthew.cane@citizensadvice.org.uk>
1 parent ef69599 commit d8cae2a

File tree

2 files changed

+248
-0
lines changed

2 files changed

+248
-0
lines changed

test/synth/__snapshots__/synth-stdout.test.ts.snap

Lines changed: 136 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/synth/synth-stdout.test.ts

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,118 @@ describe('Helm synthesis', () => {
10091009
// This would be run 4 times with test.each
10101010
await synth(synthOptions);
10111011
});
1012+
1013+
test.each([
1014+
[
1015+
withOnlyCliInputs,
1016+
{
1017+
format: SynthesisFormat.HELM,
1018+
chartVersion: '1.1.1',
1019+
chartName: 'custom-chart-name',
1020+
postSynth: matchSynthSnapshot,
1021+
},
1022+
],
1023+
[
1024+
withOnlyConfigInputs,
1025+
{
1026+
config: {
1027+
synthConfig: {
1028+
format: SynthesisFormat.HELM,
1029+
chartVersion: '1.1.1',
1030+
chartName: 'custom-chart-name',
1031+
},
1032+
},
1033+
postSynth: matchSynthSnapshot,
1034+
},
1035+
],
1036+
[
1037+
withSameInputsInBoth,
1038+
{
1039+
format: SynthesisFormat.HELM,
1040+
chartVersion: '1.1.1',
1041+
chartName: 'custom-chart-name',
1042+
config: {
1043+
synthConfig: {
1044+
format: SynthesisFormat.HELM,
1045+
chartVersion: '1.1.1',
1046+
chartName: 'custom-chart-name',
1047+
},
1048+
},
1049+
postSynth: matchSynthSnapshot,
1050+
},
1051+
],
1052+
[
1053+
withDifferentInputsInBoth,
1054+
{
1055+
format: SynthesisFormat.HELM,
1056+
chartVersion: '1.1.1',
1057+
chartName: 'cli-chart-name',
1058+
config: {
1059+
synthConfig: {
1060+
format: SynthesisFormat.HELM,
1061+
chartVersion: '1.1.1',
1062+
chartName: 'config-chart-name',
1063+
},
1064+
},
1065+
postSynth: matchSynthSnapshot,
1066+
},
1067+
],
1068+
])('--chart-name is used when specified %s', async (_testName, synthOptions) => {
1069+
await synth(synthOptions);
1070+
});
1071+
1072+
test.each([
1073+
[
1074+
withOnlyCliInputs,
1075+
{
1076+
format: SynthesisFormat.HELM,
1077+
chartVersion: '1.1.1',
1078+
postSynth: matchSynthSnapshot,
1079+
},
1080+
],
1081+
[
1082+
withOnlyConfigInputs,
1083+
{
1084+
config: {
1085+
synthConfig: {
1086+
format: SynthesisFormat.HELM,
1087+
chartVersion: '1.1.1',
1088+
},
1089+
},
1090+
postSynth: matchSynthSnapshot,
1091+
},
1092+
],
1093+
[
1094+
withSameInputsInBoth,
1095+
{
1096+
format: SynthesisFormat.HELM,
1097+
chartVersion: '1.1.1',
1098+
config: {
1099+
synthConfig: {
1100+
format: SynthesisFormat.HELM,
1101+
chartVersion: '1.1.1',
1102+
},
1103+
},
1104+
postSynth: matchSynthSnapshot,
1105+
},
1106+
],
1107+
[
1108+
withDifferentInputsInBoth,
1109+
{
1110+
format: SynthesisFormat.HELM,
1111+
chartVersion: '1.1.1',
1112+
config: {
1113+
synthConfig: {
1114+
format: SynthesisFormat.PLAIN,
1115+
chartVersion: '1.1.1',
1116+
},
1117+
},
1118+
postSynth: matchSynthSnapshot,
1119+
},
1120+
],
1121+
])('default chart name is used when --chart-name is not specified %s', async (_testName, synthOptions) => {
1122+
await synth(synthOptions);
1123+
});
10121124
});
10131125

10141126
interface SynthCliOptions {

0 commit comments

Comments
 (0)