0

I'm running contract driven development tests using dredd.

I know how to configure dredd tests to run either against a local or remote server, given a blueprint apib file. Typically, the relevant fields in my dredd config file will read like

blueprint: myblueprintfile.apib
endpoint: localhost:3000 <or any remote server>

I didn't find a way to automatically refer to the remote blueprint hosted on apiary though. what i would like to achieve is something along the lines of

blueprint: <remote apiary apib file>
endpoint: localhost:3000 <or any remote server>

I can basically achieve the same result by manually fetching the blueprint using apiary CLI and saving it to a local file, before running the actual dredd tests

export APIARY_API_KEY=<key>
apiary fetch --api-name=<name>

Is there a way to achieve this step directly from dredd configuration file?

Notice:

  • i'm working with an authenticated apiary private account
  • i'm not worry about the endpoint field above, my problem is having the blueprint field pointing to a remote apiary source automatically

Maybe this question is a duplicated one, but i've looked at previously related questions and didn't find anything

1 Answers1

1

While it's possible to point to a remotely stored .apib file, it will not work for a private documentation. At this point you can either:

  • Use the GitHub Sync to get the document on your machine
  • Automate fetching the document before testing with the Apiary CLI
Daria
  • 56
  • 5
  • Thank you Daria. I have already written a trivial bash script that downloads the .apib file from remote apiary using apiary CLI (using `apiary fetch` as in my question), and then runs dredd using the local file. I would have like to have this as part of the dredd configuration, without the further boilerplate of writing a bash script to automate, but i'm fine with this option if dredd does not support yet this behaviour for private documentation. I'll wait to see whether someone else wants to contribute to this question, otherwise i'm keen to mark this as the answer – alessandro candolini Oct 26 '18 at 13:17
  • As far as I know adding this functionality into Dredd is in the long-term plan. You can keep an eye on the issues here: https://github.com/apiaryio/dredd/issues/ Hope that helps. – Daria Oct 30 '18 at 10:32
  • 1
    You can actually vote and track this existing issue: https://github.com/apiaryio/dredd/issues/366 – Honza Javorek Mar 25 '19 at 11:35