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

Feature/pn 310 sms ttl #15

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open

Feature/pn 310 sms ttl #15

wants to merge 25 commits into from

Conversation

bogh
Copy link
Collaborator

@bogh bogh commented Mar 21, 2017

This PR should be merged after: #7

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 67.604% when pulling 1aec698 on feature/pn-310-sms-ttl into 2b9d5e9 on master.

countCh := make(chan bool)
doneCh := make(chan struct{})
// no request should be made in case the sms is expired
go dummyNexmoEndpointWithHandlerFunc(t, countCh, port, func(t *testing.T, countCh chan bool) http.HandlerFunc {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better way to do it.Make a new NexmoHandler and if a request reaches the http server.
a.FailNow() the request.In this way no doneCh is needed.

Copy link
Collaborator Author

@bogh bogh Mar 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean another function that handles it? Because we have no NexmoHandler atm.

IsError: true,
}

assert.Equal(t, "!"+ERROR_BAD_REQUEST+" "+"you are so bad.", string(msg.Bytes()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:) ha ha ha ..Such Badness

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was there before. I just moved it. :))

@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 67.444% when pulling fd82c39 on feature/pn-310-sms-ttl into a74bed7 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 67.462% when pulling 3df9fea on feature/pn-310-sms-ttl into a74bed7 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 67.791% when pulling fc351ad on feature/pn-310-sms-ttl into ccca983 on master.

@@ -150,7 +150,7 @@ func (m *Message) SetFilter(key, value string) {
// Checks are made using `Expires` field timezone
func (m *Message) IsExpired() bool {
if m.Expires == nil {
return true
return false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

"Expires": msg.Expires.Format(time.RFC3339),
"Created": time.Unix(msg.Time, 0).Format(time.RFC3339),
}).Info("Expired message received")
mTotalExpiredMessages.Add(1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a prometheus equivalent for this in another PR

@@ -35,3 +36,26 @@ func TestNexmoSender_SendWithError(t *testing.T) {
a.Error(err)
a.Equal(ErrRetryFailed, err)
}

func TestNexmoSender_SendExpiredMessage(t *testing.T) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: I moved the test to sms_integration_test.go

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 67.643% when pulling ab14544 on feature/pn-310-sms-ttl into ccca983 on master.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling bfc87cf on feature/pn-310-sms-ttl into ** on master**.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 68.076% when pulling 8770557 on feature/pn-310-sms-ttl into 1741c20 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 67.982% when pulling 9f6dec6 on feature/pn-310-sms-ttl into 1741c20 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 67.831% when pulling da2ee2d on feature/pn-310-sms-ttl into 1741c20 on master.

Copy link
Collaborator

@stefanscheidt stefanscheidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too long ago. I can not review this request anymore. Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants