-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚸 Fix output for CI, add simple tests
- Loading branch information
1 parent
7021e67
commit 4a97d9e
Showing
4 changed files
with
82 additions
and
11 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package core | ||
|
||
import ( | ||
"fmt" | ||
"github.com/JetBrains/qodana-cli/v2024/platform" | ||
"testing" | ||
) | ||
|
||
func TestImageChecks(t *testing.T) { | ||
testCases := []struct { | ||
linter string | ||
isUnofficial bool | ||
hasExactVersion bool | ||
isCompatible bool | ||
}{ | ||
{ | ||
"hadolint", | ||
true, | ||
false, | ||
false, | ||
}, | ||
{ | ||
"jetbrains/qodana", | ||
false, | ||
false, | ||
false, | ||
}, | ||
{ | ||
"jetbrains/qodana:latest", | ||
false, | ||
false, | ||
false, | ||
}, | ||
{ | ||
"jetbrains/qodana:2022.1", | ||
false, | ||
true, | ||
false, | ||
}, | ||
{ | ||
fmt.Sprintf("jetbrains/qodana:%s", platform.ReleaseVersion), | ||
false, | ||
true, | ||
true, | ||
}, | ||
} | ||
for _, tc := range testCases { | ||
t.Run(tc.linter, func(t *testing.T) { | ||
if isUnofficialLinter(tc.linter) != tc.isUnofficial { | ||
t.Errorf("isUnofficial: got %v, want %v", isUnofficialLinter(tc.linter), tc.isUnofficial) | ||
} | ||
if hasExactVersionTag(tc.linter) != tc.hasExactVersion { | ||
t.Errorf("hasExactVersion: got %v, want %v", hasExactVersionTag(tc.linter), tc.hasExactVersion) | ||
} | ||
if isCompatibleLinter(tc.linter) != tc.isCompatible { | ||
t.Errorf("isCompatible: got %v, want %v", isCompatibleLinter(tc.linter), tc.isCompatible) | ||
} | ||
}) | ||
} | ||
} |
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