mirror of
https://github.com/portainer/portainer.git
synced 2025-07-29 18:29:44 +02:00
chore(ci): run lint and test on all pkgs [EE-6201] (#10481)
This commit is contained in:
parent
2e15cad048
commit
82951093b5
13 changed files with 35 additions and 66 deletions
|
@ -14,7 +14,7 @@ func Test_enableFeaturesFromFlags(t *testing.T) {
|
|||
supportedFeatures := []Feature{"supported", "supported2", "supported3", "supported4", "supported5"}
|
||||
|
||||
t.Run("supported features should be supported", func(t *testing.T) {
|
||||
Init(supportedFeatures)
|
||||
initSupportedFeatures(supportedFeatures)
|
||||
|
||||
for _, featureFlag := range supportedFeatures {
|
||||
is.True(IsSupported(featureFlag))
|
||||
|
@ -22,7 +22,7 @@ func Test_enableFeaturesFromFlags(t *testing.T) {
|
|||
})
|
||||
|
||||
t.Run("unsupported features should not be supported", func(t *testing.T) {
|
||||
Init(supportedFeatures)
|
||||
initSupportedFeatures(supportedFeatures)
|
||||
|
||||
is.False(IsSupported("unsupported"))
|
||||
})
|
||||
|
@ -35,13 +35,12 @@ func Test_enableFeaturesFromFlags(t *testing.T) {
|
|||
}
|
||||
|
||||
for _, test := range tests {
|
||||
Init(supportedFeatures)
|
||||
|
||||
os.Unsetenv("PORTAINER_FEATURE_FLAGS")
|
||||
os.Setenv("PORTAINER_FEATURE_FLAGS", strings.Join(test.envFeatureFlags, ","))
|
||||
|
||||
t.Run("testing", func(t *testing.T) {
|
||||
Parse(test.cliFeatureFlags)
|
||||
Parse(test.cliFeatureFlags, supportedFeatures)
|
||||
supported := toFeatureMap(test.cliFeatureFlags, test.envFeatureFlags)
|
||||
|
||||
// add env flags to supported flags
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue