ref(*): cleanup timestamps in tests

pull/3945/head
Adam Reese 7 years ago
parent c5a76deba3
commit c5151fb7b3
No known key found for this signature in database
GPG Key ID: 06F35E60A7A18DD6

@ -28,8 +28,6 @@ import (
"k8s.io/helm/pkg/helm"
)
var date = time.Unix(242085845, 0)
func TestStatusCmd(t *testing.T) {
tests := []releaseCase{
{
@ -100,21 +98,21 @@ func TestStatusCmd(t *testing.T) {
releaseMockWithStatus(&release.Status{
Code: release.Status_DEPLOYED,
LastTestSuiteRun: &release.TestSuite{
StartedAt: date,
CompletedAt: date,
StartedAt: time.Now(),
CompletedAt: time.Now(),
Results: []*release.TestRun{
{
Name: "test run 1",
Status: release.TestRun_SUCCESS,
Info: "extra info",
StartedAt: date,
CompletedAt: date,
StartedAt: time.Now(),
CompletedAt: time.Now(),
},
{
Name: "test run 2",
Status: release.TestRun_FAILURE,
StartedAt: date,
CompletedAt: date,
StartedAt: time.Now(),
CompletedAt: time.Now(),
},
},
},
@ -137,8 +135,8 @@ func releaseMockWithStatus(status *release.Status) *release.Release {
return &release.Release{
Name: "flummoxed-chickadee",
Info: &release.Info{
FirstDeployed: date,
LastDeployed: date,
FirstDeployed: time.Now(),
LastDeployed: time.Now(),
Status: status,
},
}

@ -225,12 +225,11 @@ func chartStub() *chart.Chart {
}
func releaseStub() *release.Release {
date := time.Unix(242085845, 0)
return &release.Release{
Name: "lost-fish",
Info: &release.Info{
FirstDeployed: date,
LastDeployed: date,
FirstDeployed: time.Now(),
LastDeployed: time.Now(),
Status: &release.Status{Code: release.Status_DEPLOYED},
Description: "a release stub",
},

@ -222,12 +222,11 @@ func releaseStub() *release.Release {
}
func namedReleaseStub(name string, status release.StatusCode) *release.Release {
date := time.Unix(242085845, 0)
return &release.Release{
Name: name,
Info: &release.Info{
FirstDeployed: date,
LastDeployed: date,
FirstDeployed: time.Now(),
LastDeployed: time.Now(),
Status: &release.Status{Code: status},
Description: "Named Release Stub",
},
@ -259,14 +258,12 @@ func namedReleaseStub(name string, status release.StatusCode) *release.Release {
}
func upgradeReleaseVersion(rel *release.Release) *release.Release {
date := time.Unix(242085845, 0)
rel.Info.Status.Code = release.Status_SUPERSEDED
return &release.Release{
Name: rel.Name,
Info: &release.Info{
FirstDeployed: rel.Info.FirstDeployed,
LastDeployed: date,
LastDeployed: time.Now(),
Status: &release.Status{Code: release.Status_DEPLOYED},
},
Chart: rel.Chart,
@ -366,12 +363,11 @@ func releaseWithKeepStub(rlsName string) *release.Release {
},
}
date := time.Unix(242085845, 0)
return &release.Release{
Name: rlsName,
Info: &release.Info{
FirstDeployed: date,
LastDeployed: date,
FirstDeployed: time.Now(),
LastDeployed: time.Now(),
Status: &release.Status{Code: release.Status_DEPLOYED},
},
Chart: ch,

Loading…
Cancel
Save