mirror of
https://github.com/qdm12/gluetun.git
synced 2026-05-10 04:30:20 +02:00
hotfix(constants/providers): remove TestWorkflowHasAll to decouple CI files from tests
This commit is contained in:
@@ -1,12 +1,9 @@
|
|||||||
package providers
|
package providers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
|
||||||
"gopkg.in/yaml.v3"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_All(t *testing.T) {
|
func Test_All(t *testing.T) {
|
||||||
@@ -24,33 +21,3 @@ func Test_AllWithCustom(t *testing.T) {
|
|||||||
assert.Contains(t, all, Custom)
|
assert.Contains(t, all, Custom)
|
||||||
assert.Len(t, all, len(All())+1)
|
assert.Len(t, all, len(All())+1)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWorkflowHasAll(t *testing.T) {
|
|
||||||
t.Parallel()
|
|
||||||
|
|
||||||
const path = "../../../.github/workflows/update-servers-list.yml"
|
|
||||||
file, err := os.Open(path)
|
|
||||||
require.NoError(t, err)
|
|
||||||
defer file.Close()
|
|
||||||
|
|
||||||
var data struct {
|
|
||||||
On struct {
|
|
||||||
WorkflowDispatch struct {
|
|
||||||
Inputs struct {
|
|
||||||
Provider struct {
|
|
||||||
Options []string `yaml:"options"`
|
|
||||||
} `yaml:"provider"`
|
|
||||||
} `yaml:"inputs"`
|
|
||||||
} `yaml:"workflow_dispatch"`
|
|
||||||
} `yaml:"on"`
|
|
||||||
}
|
|
||||||
decoder := yaml.NewDecoder(file)
|
|
||||||
err = decoder.Decode(&data)
|
|
||||||
require.NoError(t, err)
|
|
||||||
|
|
||||||
providers := All()
|
|
||||||
expected := make([]string, len(providers)+1)
|
|
||||||
expected[0] = "all"
|
|
||||||
copy(expected[1:], providers)
|
|
||||||
assert.Equal(t, expected, data.On.WorkflowDispatch.Inputs.Provider.Options)
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user