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

Update integration tests to utilize StopLight.io's Prism version v2.X #755

Closed
thinkingserious opened this issue Oct 2, 2018 · 5 comments
Labels
difficulty: hard fix is hard in difficulty type: twilio enhancement feature request on Twilio's roadmap

Comments

@thinkingserious
Copy link
Contributor

Issue Summary

We use a mock server for integration/contract testing that is driven by our OpenAPI specification and StopLight.io's Prism service. The service is spun up utilizing the prism.sh script in this repo.

Before writing any code, we suggest you review our CONTRIBUTING.md file and propose your solution for discussion here in the comments. Thank you!

Aceptance Criteria

  • we automatically use the latest v2.X version of Prism locally, in Travis CI and in Docker
  • tests pass locally, in Travis CI and using Docker
  • update CONTRIBUTING.md documentation, if necessary

Notes & References

@thinkingserious thinkingserious added difficulty: hard fix is hard in difficulty hacktoberfest status: help wanted requesting help from the community type: twilio enhancement feature request on Twilio's roadmap and removed type: enhancement labels Oct 2, 2018
@aslafy-z
Copy link
Contributor

aslafy-z commented Oct 5, 2018

I had a try with prism v2 but i'm not able to run the mock server (haven't tried docker release).
Openned an issue here: stoplightio/prism#152

Here are my findings:

New installer url: https://raw.githubusercontent.com/stoplightio/prism/2.x/install.sh
New command to mock: prism mock --spec https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json
Update tests globbing:

  • "**/*.spec.js" becomes $(find . -name '*.spec.js' ! -ipath '*node_modules*')
  • "packages/client/**/*.spec.js" becomes $(find packages/client -name '*.spec.js' ! -ipath '*node_modules*')

Also, It seems that incorrect values are sent to api in packages/client/src/client.spec.js (Prism 0.6 was trowing bunch of errors about this)
eg: /v3/access_settings/whitelist/{rule_id} should be /v3/access_settings/whitelist/MYRULE, no ?
If needed, here the list of the in-url variables names grabbed in this client.spec.js:
rule_id alert_id api_key_id group_id email campaign_id client_type
custom_field_id list_id recipient_id segment_id pool_name id_address
batch_id request_id sender_id subuser_name token username template_id
version_id batch_id hostname id ip link_id

EDIT: Just seen it working in the CI pipeline (https://travis-ci.org/sendgrid/sendgrid-nodejs/jobs/437594883). Doesn't work so good here.

@YoungNastyMan
Copy link

I got Prism 2.0 working locally. I shall try to take this up if that's ok.

@YoungNastyMan
Copy link

It looks like Prism 2.x no longer understands the X-Mock header. It apparently uses an __code query string parameter now as mentioned here

@devchas devchas added status: work in progress Twilio or the community is in the process of implementing and removed help wanted status: help wanted requesting help from the community labels Oct 11, 2018
@YoungNastyMan
Copy link

@thinkingserious Any inputs on this? If there's that I need to change in the PR, please let me know.

@childish-sambino
Copy link
Contributor

Closing as prism integration has been moved to https://github.com/sendgrid/sendgrid-oai/

@childish-sambino childish-sambino removed the status: work in progress Twilio or the community is in the process of implementing label Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: hard fix is hard in difficulty type: twilio enhancement feature request on Twilio's roadmap
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants