Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions events/codebuild.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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