It's time to have a SimpleTest test suite for this module.
The reservation has always been that it would have to hit the Amazon backend, which would violate rate limits and might fail (and that it would have to have a special key).
Here's a proposed approach:
1. Develop a stub backend that returns current XML for a number of items.
2. A test class can determine whether it's to use the stub backend or the real one.
3. Most test classes would use the stub backend
4. One class would test basic functionality against the real backend.
5. A default publickey/privatekey pair would be provided in code, tied to an Amazon AWS account not used for anything else.
We'll do this in D7 first, then backport to D6.
Are you willing to work on this? Assign it to yourself and get started!
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | tests_for_amazon_module-1007272-3.patch | 24.03 KB | marcelovani |
Comments
Comment #1
eaton commentedIt'll probably require some quick TOS investigation to determine whether shipping this with the module would be verboten. Especially in with stuff like the testbot, there's a chance for it to multiply the load of even relatively light tests dramatically...
Comment #2
panchoWithout having investigated the TOS, it seems to me plain impossible to include a pair of test keys.
Firstly, the keys are not open source, so they must not be stored in the repo.
Secondly, once published, they could and would be used and abused for different purposes and would become deactivated by Amazon as soon as they find out.
Actually I see these two approaches:
1. Including some valid XML responses with the tests, as proposed by Randy, is possible. This would mean we'd be immune against changes in protocol or Amazon server downtimes. If the test runs through, we know that our module works as designed.
2. To do some tests against the real server, we could set up a closed source tool running on some server that would provide the pair of keys and reroute certain requests to Amazon. This would require a server hosting this tool.
I'd start with the former approach and see how far we can get with it. Then we can still add some real server tests if the latter approach turns out to be feasible.
Comment #3
marcelovaniAdding initial tests as a starting point
Test covers field formatter for various displays
Comment #4
marcelovaniComment #5
marcelovaniI just realized, the tests will not run because we need tests to enable Automated tests
Comment #7
marcelovaniMarking as fixed for now. We can re-open or create another issues if new tests are needed. I will try to turn on Automated tests and see if it works.