Skip to content

Commit

Permalink
Update test DB and stop writing channelconnection.error_count which i…
Browse files Browse the repository at this point in the history
…s now nullable
  • Loading branch information
rowanseymour committed Aug 12, 2021
1 parent 50551f9 commit d66c044
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 12 deletions.
7 changes: 0 additions & 7 deletions core/models/channel_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const (
ConnectionStatusPending = ConnectionStatus("P")
ConnectionStatusQueued = ConnectionStatus("Q")
ConnectionStatusWired = ConnectionStatus("W")
ConnectionStatusRinging = ConnectionStatus("R")
ConnectionStatusInProgress = ConnectionStatus("I")
ConnectionStatusBusy = ConnectionStatus("B")
ConnectionStatusFailed = ConnectionStatus("F")
Expand Down Expand Up @@ -79,7 +78,6 @@ type ChannelConnection struct {
ContactID ContactID `json:"contact_id" db:"contact_id"`
ContactURNID URNID `json:"contact_urn_id" db:"contact_urn_id"`
OrgID OrgID `json:"org_id" db:"org_id"`
ErrorCount int `json:"error_count" db:"error_count"`
StartID StartID `json:"start_id" db:"start_id"`
}
}
Expand Down Expand Up @@ -113,7 +111,6 @@ INSERT INTO
channel_id,
contact_id,
contact_urn_id,
error_count,
retry_count
)
Expand All @@ -129,7 +126,6 @@ VALUES(
:channel_id,
:contact_id,
:contact_urn_id,
0,
0
)
RETURNING
Expand Down Expand Up @@ -205,7 +201,6 @@ SELECT
cc.contact_id as contact_id,
cc.contact_urn_id as contact_urn_id,
cc.org_id as org_id,
cc.error_count as error_count,
fsc.flowstart_id as start_id
FROM
channels_channelconnection as cc
Expand Down Expand Up @@ -242,7 +237,6 @@ SELECT
cc.contact_id as contact_id,
cc.contact_urn_id as contact_urn_id,
cc.org_id as org_id,
cc.error_count as error_count,
fsc.flowstart_id as start_id
FROM
channels_channelconnection as cc
Expand Down Expand Up @@ -284,7 +278,6 @@ SELECT
cc.contact_id as contact_id,
cc.contact_urn_id as contact_urn_id,
cc.org_id as org_id,
cc.error_count as error_count,
fsc.flowstart_id as start_id
FROM
channels_channelconnection as cc
Expand Down
Binary file modified mailroom_test.dump
Binary file not shown.
4 changes: 2 additions & 2 deletions testsuite/testdata/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ var IncomingExtraFlow = &Flow{10006, "376d3de6-7f0e-408c-80d6-b1919738bc80"}
var ParentTimeoutFlow = &Flow{10007, "81c0f323-7e06-4e0c-a960-19c20f17117c"}
var CampaignFlow = &Flow{10009, "3a92a964-3a8d-420b-9206-2cd9d884ac30"}

var CreatedOnField = &Field{3, "fd18a69d-7514-4b76-9fad-072641995e17"}
var LastSeenOnField = &Field{5, "660ebe03-b717-4a80-aebf-9b7c718266e1"}
var CreatedOnField = &Field{3, "53499958-0a0a-48a5-bb5f-8f9f4d8af77b"}
var LastSeenOnField = &Field{5, "4307df2e-b00b-42b6-922b-4a1dcfc268d8"}
var GenderField = &Field{6, "3a5891e4-756e-4dc9-8e12-b7a766168824"}
var AgeField = &Field{7, "903f51da-2717-47c7-a0d3-f2f32877013d"}
var JoinedField = &Field{8, "d83aae24-4bbf-49d0-ab85-6bfd201eac6d"}
Expand Down
4 changes: 2 additions & 2 deletions testsuite/testdata/contacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ type Field struct {
func InsertContact(db *sqlx.DB, org *Org, uuid flows.ContactUUID, name string, language envs.Language) *Contact {
var id models.ContactID
must(db.Get(&id,
`INSERT INTO contacts_contact (org_id, is_active, status, uuid, name, language, created_on, modified_on, created_by_id, modified_by_id)
VALUES($1, TRUE, 'A', $2, $3, $4, NOW(), NOW(), 1, 1) RETURNING id`, org.ID, uuid, name, language,
`INSERT INTO contacts_contact (org_id, is_active, status, ticket_count, uuid, name, language, created_on, modified_on, created_by_id, modified_by_id)
VALUES($1, TRUE, 'A', 0, $2, $3, $4, NOW(), NOW(), 1, 1) RETURNING id`, org.ID, uuid, name, language,
))
return &Contact{id, uuid, "", models.NilURNID}
}
Expand Down
2 changes: 1 addition & 1 deletion web/org/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func TestMetrics(t *testing.T) {
Username: "metrics",
Password: promToken,
Contains: []string{
`rapidpro_group_contact_count{group_name="Active",group_uuid="14f6ea01-456b-4417-b0b8-35e942f549f1",group_type="system",org="UNICEF"} 124`,
`rapidpro_group_contact_count{group_name="Active",group_uuid="b97f69f7-5edf-45c7-9fda-d37066eae91d",group_type="system",org="UNICEF"} 124`,
`rapidpro_group_contact_count{group_name="Doctors",group_uuid="c153e265-f7c9-4539-9dbc-9b358714b638",group_type="user",org="UNICEF"} 121`,
`rapidpro_channel_msg_count{channel_name="Vonage",channel_uuid="19012bfd-3ce3-4cae-9bb9-76cf92c73d49",channel_type="NX",msg_direction="out",msg_type="message",org="UNICEF"} 0`,
},
Expand Down

0 comments on commit d66c044

Please sign in to comment.