mirror of
https://github.com/portainer/portainer.git
synced 2025-07-20 13:59:40 +02:00
refactor(stack): stack build process backend only [EE-4342] (#7750)
This commit is contained in:
parent
83a1ce9d2a
commit
e9de484c3e
65 changed files with 2270 additions and 942 deletions
26
api/stacks/stackutils/util_test.go
Normal file
26
api/stacks/stackutils/util_test.go
Normal file
|
@ -0,0 +1,26 @@
|
|||
package stackutils
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
portainer "github.com/portainer/portainer/api"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_GetStackFilePaths(t *testing.T) {
|
||||
stack := &portainer.Stack{
|
||||
ProjectPath: "/tmp/stack/1",
|
||||
EntryPoint: "file-one.yml",
|
||||
}
|
||||
|
||||
t.Run("stack doesn't have additional files", func(t *testing.T) {
|
||||
expected := []string{"/tmp/stack/1/file-one.yml"}
|
||||
assert.ElementsMatch(t, expected, GetStackFilePaths(stack, true))
|
||||
})
|
||||
|
||||
t.Run("stack has additional files", func(t *testing.T) {
|
||||
stack.AdditionalFiles = []string{"file-two.yml", "file-three.yml"}
|
||||
expected := []string{"/tmp/stack/1/file-one.yml", "/tmp/stack/1/file-two.yml", "/tmp/stack/1/file-three.yml"}
|
||||
assert.ElementsMatch(t, expected, GetStackFilePaths(stack, true))
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue