Skip to content

Commit

Permalink
v3 task metadata validator tests enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
haikuoliu committed Dec 10, 2018
1 parent 0e0b6a9 commit dbef89c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,11 @@ func verifyTaskMetadataResponse(taskMetadataRawMsg json.RawMessage) error {
json.Unmarshal(taskMetadataRawMsg, &taskMetadataResponseMap)

taskExpectedFieldEqualMap := map[string]interface{}{
"Cluster": "ecs-functional-tests",
"DesiredStatus": "RUNNING",
"KnownStatus": "RUNNING",
}

taskExpectedFieldNotEmptyArray := []string{"TaskARN", "Family", "Revision", "PullStartedAt", "PullStoppedAt", "Containers", "AvailabilityZone"}
taskExpectedFieldNotEmptyArray := []string{"Cluster", "TaskARN", "Family", "Revision", "PullStartedAt", "PullStoppedAt", "Containers", "AvailabilityZone"}

for fieldName, fieldVal := range taskExpectedFieldEqualMap {
if err = fieldEqual(taskMetadataResponseMap, fieldName, fieldVal); err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,11 @@ func verifyTaskMetadataResponse(taskMetadataRawMsg json.RawMessage) error {
json.Unmarshal(taskMetadataRawMsg, &taskMetadataResponseMap)

taskExpectedFieldEqualMap := map[string]interface{}{
"Cluster": "ecs-functional-tests",
"DesiredStatus": "RUNNING",
"KnownStatus": "RUNNING",
}

taskExpectedFieldNotEmptyArray := []string{"TaskARN", "Family", "Revision", "PullStartedAt", "PullStoppedAt", "Containers", "AvailabilityZone"}
taskExpectedFieldNotEmptyArray := []string{"Cluster", "TaskARN", "Family", "Revision", "PullStartedAt", "PullStoppedAt", "Containers", "AvailabilityZone"}

for fieldName, fieldVal := range taskExpectedFieldEqualMap {
if err = fieldEqual(taskMetadataResponseMap, fieldName, fieldVal); err != nil {
Expand Down

0 comments on commit dbef89c

Please sign in to comment.