-
Notifications
You must be signed in to change notification settings - Fork 6
Ra tests #51
base: develop
Are you sure you want to change the base?
Conversation
The RAML modifications here are fairly minimal. @postatum 's PR from the original version has quite a bit of detail in the RAML so I'll look into merging in what I can of his as well. (But, it would be a lot easier and cleaner if some of the issues in ramlfications were resolved first so we could use resourceTypes, traits and root-level declared schemas properly. I've looked at the code and it doesn't seem like there are huge issues to fix...) |
Looks good, but I thought we were going to test more than just basic request/response. @jstoiko what do you think? In local.ini.template note should be updated to also say that auth has to be disabled for tests to work. PS. I like users example data 😄 |
Nice work @vaz We should also test custom processors and authentication if that's possible |
You're right that ResourceTypes would be nice to have as our RAML file is getting bigger. I met @econchick last week who told me it was almost fixed. I see there's been some progress. Any chance we can help? |
@postatum so far there are tests for response body matching schema, response header (Location returned by POST), and the routes themselves. I wanted to put back in the automated queryParameter testing (similar to what you had but using example values) though I am having a harder time seeing how to do it in a way that is useful—since they all change behaviour in different ways it's not really possible to tell if a query param is doing its job without a custom test. It's also hard to test RAML's requirement that "all possible query parameters are declared" since we pass field names and other more complex stuff like ES aggregation syntax—the RAML would get incredibly verbose, if it's even possible to cover it all. We could see that it doesn't cause an error to pass params but that doesn't say much—many apps will just ignore extra query params. I think query param testing should have to stay in the realm of custom test. (I need to re-add support for required query params in auto tests, though.) RAML doesn't require that response codes be declared, only that the stuff you do declare is fulfilled properly, so a "returns a proper response code" test doesn't make sense either if we're following the spec. It also wants all possible non-standard response headers declared—but we so far aren't really using response headers much or providing an easy ramses-like way to customize them. I'll add the note about auth. @jstoiko there's a processor test (POST /users) checking that the lowercase function is called on email. Also yes, I think it would be beneficial to see if we can lend a hand on some of the more straightforward ramlfications fixes. I'll put the tasks that were mentioned into Pivotal in a bit. |
Awesome! Thank you. |
Thanks @econchick ! |
Added functional tests using Ra.
Works with ra on branch 101819816_custom_tests (this PR) - which should be ready to merge and release 1.0 I think.
Changes: