You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to the Haskell world, and I want to start contributing to an open-source library as a means of improving myself.
I picked this project because I'm a web developer by trade (though not training), and communicating with REST APIs is definitely in my wheel house.
That being said, how am I supposed to run the test suite for this library?
I have a running rest suite, I have twilio test credentials in the environment in which I am running the test suite, but then I get an error (the error is below).
It's obvious from the error that we are making a request to an endpoint that doesn't allow test credentials. Is the expectation for the test suite that live credentials would be put in there?
twilio-0.2.0.0: test (suite: Tests)
Tests: HttpExceptionRequest Request {
host = "api.twilio.com"
port = 443
secure = True
requestHeaders = [("Authorization","Basic IAmHidingThisBecauseIDon'tWantToBeHacked!")]
path = "/2010-04-01/Accounts.json"
queryString = ""
method = "GET"
proxy = Nothing
rawBody = False
redirectCount = 10
responseTimeout = ResponseTimeoutDefault
requestVersion = HTTP/1.1
}
(StatusCodeException (Response {responseStatus = Status {statusCode = 403, statusMessage = "FORBIDDEN"}, responseVersion = HTTP/1.1, responseHeaders = [("Access-Control-Allow-Credentials","true"),("Access-Control-Allow-Headers","Accept, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since"),("Access-Control-Allow-Methods","GET, POST, DELETE, OPTIONS"),("Access-Control-Allow-Origin","*"),("Access-Control-Expose-Headers","ETag"),("Content-Type","application/json"),("Date","Fri, 13 Oct 2017 15:44:48 GMT"),("Twilio-Request-Duration","0.013"),("Twilio-Request-Id","RQa95adc7d0fe64dc8b171c98397cfc861"),("X-Powered-By","AT-5000"),("X-Shenanigans","none"),("Content-Length","155"),("Connection","keep-alive")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose}) "{\"code\": 20008, \"message\": \"Resource not accessible with Test Account Credentials\", \"more_info\": \"https://www.twilio.com/docs/errors/20008\", \"status\": 403}")
Test suite failure for package twilio-0.2.0.0
Tests: exited with: ExitFailure 1
Logs printed to console
The text was updated successfully, but these errors were encountered:
That's great to hear! This is a pretty small hobby project. It lacks many features, some things we don't have a solution for yet (like, paging! it's a bit embarrassing 😅), and—as you've noticed (and others—the testing isn't in the best place. But, if you're willing to choose-your-own-adventure here, I hope you can contribute!
The tests we have currently are integration tests that require non-test credentials which are read in from the ACCOUNT_SID and AUTH_TOKEN environment variables. Travis CI will inject these environment variables into any PR opened from a branch on the repository itself, but it will not inject them on PRs opened from forks (see here).
You can override ACCOUNT_SID and AUTH_TOKEN, but the integration tests currently hard-code phone numbers specific to the test account (see here and here). In order to be able to run these on any account, we need to
Let these phone numbers be configurable, and
Document what capabilities these phone numbers should have (e.g., ability to send/receive SMS, etc.) and how to provision them with Twilio.
Just this would be an improvement for our integration tests, but we also really need unit tests, too. Right now, any changes to the JSON parsing have to be tested by way of the integration tests, which slows down development.
Hi Folks,
I'm new to the Haskell world, and I want to start contributing to an open-source library as a means of improving myself.
I picked this project because I'm a web developer by trade (though not training), and communicating with REST APIs is definitely in my wheel house.
That being said, how am I supposed to run the test suite for this library?
I have a running rest suite, I have twilio test credentials in the environment in which I am running the test suite, but then I get an error (the error is below).
It's obvious from the error that we are making a request to an endpoint that doesn't allow test credentials. Is the expectation for the test suite that live credentials would be put in there?
The text was updated successfully, but these errors were encountered: