add more releases to list tests

Signed-off-by: Abhilash Gnan <abhilashgnan@gmail.com>
pull/5539/head
Abhilash Gnan 6 years ago
parent 20c4d29295
commit 537872526b

@ -26,14 +26,19 @@ import (
func TestListCmd(t *testing.T) {
defaultNamespace := "default"
timestamp1 := time.Unix(1452902400, 0).UTC()
timestamp2 := time.Unix(1452902401, 0).UTC()
sampleTimeSeconds := int64(1452902400)
timestamp1 := time.Unix(sampleTimeSeconds+1, 0).UTC()
timestamp2 := time.Unix(sampleTimeSeconds+2, 0).UTC()
timestamp3 := time.Unix(sampleTimeSeconds+3, 0).UTC()
timestamp4 := time.Unix(sampleTimeSeconds+4, 0).UTC()
chartInfo := &chart.Chart{
Metadata: &chart.Metadata{
Name: "chickadee",
Version: "1.0.0",
},
}
releaseFixture := []*release.Release{
{
Name: "starlord",
@ -105,6 +110,26 @@ func TestListCmd(t *testing.T) {
},
Chart: chartInfo,
},
{
Name: "hummingbird",
Version: 1,
Namespace: defaultNamespace,
Info: &release.Info{
LastDeployed: timestamp3,
Status: release.StatusDeployed,
},
Chart: chartInfo,
},
{
Name: "iguana",
Version: 2,
Namespace: defaultNamespace,
Info: &release.Info{
LastDeployed: timestamp4,
Status: release.StatusDeployed,
},
Chart: chartInfo,
},
}
tests := []cmdTestCase{{
@ -152,6 +177,11 @@ func TestListCmd(t *testing.T) {
cmd: "list --reverse",
golden: "output/list-reverse.txt",
rels: releaseFixture,
}, {
name: "list releases sorted by reversed release date",
cmd: "list --date --reverse",
golden: "output/list-date-reversed.txt",
rels: releaseFixture,
}, {
name: "list releases in short output format",
cmd: "list --short",

@ -0,0 +1,3 @@
NAME NAMESPACE REVISION UPDATED STATUS CHART
rocket default 1 2016-01-16 00:00:01 +0000 UTC failed chickadee-1.0.0
starlord default 2 2016-01-16 00:00:00 +0000 UTC deployed chickadee-1.0.0

@ -1,3 +1,5 @@
NAME NAMESPACE REVISION UPDATED STATUS CHART
rocket default 1 2016-01-16 00:00:01 +0000 UTC failed chickadee-1.0.0
starlord default 2 2016-01-16 00:00:00 +0000 UTC deployed chickadee-1.0.0
NAME NAMESPACE REVISION UPDATED STATUS CHART
hummingbird default 1 2016-01-16 00:00:03 +0000 UTC deployed chickadee-1.0.0
iguana default 2 2016-01-16 00:00:04 +0000 UTC deployed chickadee-1.0.0
rocket default 1 2016-01-16 00:00:02 +0000 UTC failed chickadee-1.0.0
starlord default 2 2016-01-16 00:00:01 +0000 UTC deployed chickadee-1.0.0

Loading…
Cancel
Save