Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add phase-type of QUEUED as constant #234

Merged
merged 4 commits into from Oct 11, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions events/codebuild.go
Expand Up @@ -27,6 +27,7 @@ type CodeBuildPhaseType string

const (
CodeBuildPhaseTypeSubmitted CodeBuildPhaseType = "SUBMITTED"
CodeBuildPhaseTypeQueued = "QUEUED"
CodeBuildPhaseTypeProvisioning = "PROVISIONING"
CodeBuildPhaseTypeDownloadSource = "DOWNLOAD_SOURCE"
CodeBuildPhaseTypeInstall = "INSTALL"
Expand Down
19 changes: 18 additions & 1 deletion events/codebuild_test.go
Expand Up @@ -2,10 +2,11 @@ package events

import (
"encoding/json"
"github.com/stretchr/testify/require"
"io/ioutil"
"testing"
"time"

"github.com/stretchr/testify/require"
)

func TestUnmarshalCodeBuildEvent(t *testing.T) {
Expand Down Expand Up @@ -71,6 +72,14 @@ func TestUnmarshalCodeBuildEvent(t *testing.T) {
PhaseType: CodeBuildPhaseTypeSubmitted,
PhaseStatus: CodeBuildPhaseStatusSucceeded,
},
{
PhaseContext: []interface{}{},
StartTime: CodeBuildTime(time.Date(2017, 9, 1, 16, 12, 29, 0, time.UTC)),
EndTime: CodeBuildTime(time.Date(2019, 9, 13, 4, 12, 29, 0, time.UTC)),
Duration: DurationSeconds(0),
PhaseType: CodeBuildPhaseTypeQueued,
PhaseStatus: CodeBuildPhaseStatusSucceeded,
},
{
PhaseContext: []interface{}{},
StartTime: CodeBuildTime(time.Date(2017, 9, 1, 16, 12, 29, 0, time.UTC)),
Expand Down Expand Up @@ -200,6 +209,14 @@ func TestUnmarshalCodeBuildEvent(t *testing.T) {
PhaseType: CodeBuildPhaseTypeSubmitted,
PhaseStatus: CodeBuildPhaseStatusSucceeded,
},
{
PhaseContext: []interface{}{},
StartTime: CodeBuildTime(time.Date(2017, 9, 1, 16, 12, 29, 0, time.UTC)),
EndTime: CodeBuildTime(time.Date(2019, 9, 13, 4, 12, 29, 0, time.UTC)),
Duration: DurationSeconds(0),
PhaseType: CodeBuildPhaseTypeQueued,
PhaseStatus: CodeBuildPhaseStatusSucceeded,
},
{
PhaseContext: []interface{}{},
StartTime: CodeBuildTime(time.Date(2017, 9, 1, 16, 12, 29, 0, time.UTC)),
Expand Down
8 changes: 8 additions & 0 deletions events/testdata/codebuild-phase-change.json
Expand Up @@ -49,6 +49,14 @@
"phase-type": "SUBMITTED",
"phase-status": "SUCCEEDED"
},
{
"phase-context": [],
"start-time": "Sep 1, 2017 4:12:29 PM",
"end-time": "Sep 13, 2019 4:12:29 AM",
"duration-in-seconds": 0.0,
"phase-type": "QUEUED",
"phase-status": "SUCCEEDED"
},
{
"phase-context": [],
"start-time": "Sep 1, 2017 4:12:29 PM",
Expand Down
8 changes: 8 additions & 0 deletions events/testdata/codebuild-state-change.json
Expand Up @@ -54,6 +54,14 @@
"phase-type": "SUBMITTED",
"phase-status": "SUCCEEDED"
},
{
"phase-context": [],
"start-time": "Sep 1, 2017 4:12:29 PM",
"end-time": "Sep 13, 2019 4:12:29 AM",
"duration-in-seconds": 0.0,
"phase-type": "QUEUED",
"phase-status": "SUCCEEDED"
},
{
"phase-context": [],
"start-time": "Sep 1, 2017 4:12:29 PM",
Expand Down