Skip to content

Commit fb225d8

Browse files
committed
🐛 QD-13130 Add test for unknown product in flavour
1 parent a36da27 commit fb225d8

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

platform/commoncontext/analyzer_cli_options_test.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func TestNativePathAnalyzerParams(t *testing.T) {
7979
linter string
8080
qodanaDistEnv string
8181
expectedLinter product.Linter
82+
fatal bool
8283
setup func(t *testing.T)
8384
}{
8485
{
@@ -87,6 +88,7 @@ func TestNativePathAnalyzerParams(t *testing.T) {
8788
"",
8889
distPath,
8990
product.JvmLinter,
91+
false,
9092
func(t *testing.T) {},
9193
},
9294
{
@@ -95,6 +97,7 @@ func TestNativePathAnalyzerParams(t *testing.T) {
9597
"",
9698
"",
9799
product.JvmLinter,
100+
false,
98101
func(t *testing.T) {},
99102
},
100103
{
@@ -103,6 +106,7 @@ func TestNativePathAnalyzerParams(t *testing.T) {
103106
"",
104107
distPath,
105108
product.JvmLinter,
109+
false,
106110
func(t *testing.T) {},
107111
},
108112
{
@@ -111,6 +115,7 @@ func TestNativePathAnalyzerParams(t *testing.T) {
111115
"",
112116
distPath + "wrong",
113117
product.JvmLinter,
118+
true,
114119
func(t *testing.T) {},
115120
},
116121
{
@@ -119,10 +124,22 @@ func TestNativePathAnalyzerParams(t *testing.T) {
119124
"",
120125
distPath,
121126
product.JvmCommunityLinter,
127+
false,
122128
func(t *testing.T) {
123129
makeDistFlavourFile(distPath, product.JvmCommunityLinter.ProductCode)
124130
},
125131
},
132+
{
133+
"Pass through dist & flavour - unknown dist",
134+
distPath,
135+
"",
136+
distPath,
137+
product.UnknownLinter,
138+
true,
139+
func(t *testing.T) {
140+
makeDistFlavourFile(distPath, "wrong code")
141+
},
142+
},
126143
}
127144

128145
for _, tt := range tests {
@@ -132,7 +149,7 @@ func TestNativePathAnalyzerParams(t *testing.T) {
132149
tt.setup(t)
133150
}
134151
t.Setenv(qdenv.QodanaDistEnv, tt.qodanaDistEnv)
135-
if tt.name == "Unknown dist" {
152+
if tt.fatal {
136153
defer func() { logrus.StandardLogger().ExitFunc = nil }()
137154
var fatal bool
138155
logrus.StandardLogger().ExitFunc = func(int) { fatal = true }

0 commit comments

Comments
 (0)