todomvc-api icon indicating copy to clipboard operation
todomvc-api copied to clipboard

document running dredd manually

Open proppy opened this issue 11 years ago • 7 comments

for lang != .js

proppy avatar Oct 28 '14 17:10 proppy

Here is what I did in the end to run tests successfully on my repo:

  1. sudo npm install -g [email protected]
  2. sudo npm install -g [email protected]
  3. sudo npm install -g [email protected]
  4. dredd todos.apib http://localhost:8080 --hookfiles=hooks.js

Note: I am currently including local copies of todo.apib and hooks.js in my repo: https://github.com/webmaven/appengine-todos-morepath

webmaven avatar Nov 02 '14 20:11 webmaven

What I'd like to see is a workflow more like this:

  1. npm install todomvc-api -g
  2. todomvc-api test http://localhost:8080

webmaven avatar Nov 03 '14 00:11 webmaven

  1. sudo npm install -g [email protected]
  2. sudo npm install -g [email protected]
  3. sudo npm install -g [email protected]

All of these steps are combined by just npm install todomvc-api -- we have those modules as dependencies. They are also not global modules, which is what the -g flag means, so no need to install them as such.

  1. npm install todomvc-api -g
  2. todomvc-api test http://localhost:8080

In our case, our backend is Node/Express, so it's easy for us to integrate it into our JS tooling stack. For non-Node implementations, you would prefer having a system-wide, cli test command? Will you integrate API validation tests into your application's test suite somehow? I'm curious how these pieces would fit together, and if we can provide a more ideal solution.

** edit ** Updated link

stephenplusplus avatar Nov 03 '14 00:11 stephenplusplus

All of these steps are combined by just npm install todomvc-api [snip] They are also not global modules, which is what the -g flag means, so no need to install them as such.

I screwed something up when I just installed todomvc-api locally. I wasn't able to run the Dredd command.

For non-Node implementations, you would prefer having a system-wide, cli test command?

Well, other stacks like Rails may have better support for API Blueprints than Python, but for Python I do prefer a CLI command. It need not be installed globally, though, and need not be specific to TodoMVC-API. Almost any variation on:

  1. npm install $PACKAGENAME
  2. dredd $OPTIONS

or:

  1. npm install $PACKAGENAME
  2. todomvcapi $OPTIONS

Would be fine with me.

Will you integrate API validation tests into your application's test suite somehow?

I suppose I could, but I wasn't planning on doing much more than running the API validation manually. Morepath is also a new framework, and there isn't much documentation or culture around testing just yet.

webmaven avatar Nov 03 '14 02:11 webmaven

At @stephenplusplus' suggestion on #10: Bump.

webmaven avatar Nov 09 '14 18:11 webmaven

I think we should document how to run dredd manually after installing todomvc-api, it should be in node_modules/.bin

proppy avatar Nov 11 '14 00:11 proppy

Bump

webmaven avatar Nov 19 '14 20:11 webmaven