This simplifies the deploy overview, to only show 3 version fields: - CURRENT DEPLOYMENT - CURRENT ENV - NEW DEPLOYMENT It also fixes a few errors around version detection Reviewed-on: #508 Co-authored-by: p4u1 <p4u1_f4u1@riseup.net> Co-committed-by: p4u1 <p4u1_f4u1@riseup.net>
37 lines
513 B
Go
37 lines
513 B
Go
package recipe
|
|
|
|
import (
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestIsDirty(t *testing.T) {
|
|
r := Get("abra-test-recipe")
|
|
|
|
if err := r.EnsureExists(); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
assert.False(t, r.Dirty)
|
|
|
|
fpath := filepath.Join(r.Dir, "foo.txt")
|
|
f, err := os.Create(fpath)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
defer f.Close()
|
|
defer t.Cleanup(func() {
|
|
os.Remove(fpath)
|
|
})
|
|
|
|
dirty, err := r.IsDirty()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
|
|
assert.True(t, dirty)
|
|
}
|