2020-07-07 23:25:11 +02:00
|
|
|
package auto
|
|
|
|
|
|
|
|
import (
|
|
|
|
"path/filepath"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
)
|
|
|
|
|
2020-07-15 08:13:45 +02:00
|
|
|
func TestUpBasic(t *testing.T) {
|
2020-07-07 23:25:11 +02:00
|
|
|
p := Project{
|
|
|
|
Name: "testproj",
|
|
|
|
SourcePath: filepath.Join(".", "test", "testproj"),
|
|
|
|
}
|
|
|
|
s := &Stack{
|
|
|
|
Name: "int_test",
|
|
|
|
Project: p,
|
|
|
|
Overrides: &StackOverrides{
|
|
|
|
Config: map[string]string{"bar": "abc"},
|
|
|
|
Secrets: map[string]string{"buzz": "secret"},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
res, err := s.Up()
|
|
|
|
if err != nil {
|
|
|
|
t.Errorf("up failed, err: %v", err)
|
|
|
|
t.FailNow()
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.Equal(t, 2, len(res.Outputs), "expected two plain outputs")
|
|
|
|
assert.Equal(t, 1, len(res.SecretOutputs), "expected one secret output")
|
2020-07-15 08:13:45 +02:00
|
|
|
assert.Equal(t, "foo", res.Outputs["exp_static"])
|
|
|
|
assert.Equal(t, "abc", res.Outputs["exp_cfg"])
|
|
|
|
assert.Equal(t, "secret", res.SecretOutputs["exp_secret"])
|
2020-07-07 23:25:11 +02:00
|
|
|
}
|