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!

Comments

eaton’s picture

5. A default publickey/privatekey pair would be provided in code, tied to an Amazon AWS account not used for anything else.

It'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...

pancho’s picture

Without 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.

marcelovani’s picture

Issue summary: View changes
StatusFileSize
new24.03 KB

Adding initial tests as a starting point
Test covers field formatter for various displays

marcelovani’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev
Assigned: Unassigned » marcelovani
Status: Active » Needs review
marcelovani’s picture

I just realized, the tests will not run because we need tests to enable Automated tests

  • marcelovani committed 8b98eb1 on 7.x-2.x
    Issue #1007272 by marcelovani: Tests for Amazon module
    
marcelovani’s picture

Status: Needs review » Fixed

Marking 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.

  • marcelovani committed ec4fddf on 7.x-2.x
    Issue #1007272 by marcelovani: Use amazon item from US store
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.