It seems that the tests fails, because of the registry database not being loaded. See http://qa.drupal.org/pifr/test/529008

exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'discimport_commerce.simpletest463477registry' doesn't exist' in /home/lsolesen/workspace/discimport_dk_build/includes/database/database.inc:2139
Stack trace:
#0 /home/lsolesen/workspace/discimport_dk_build/includes/database/database.inc(2139): PDOStatement->execute(Array)
#1 /home/lsolesen/workspace/discimport_dk_build/includes/database/database.inc(664): DatabaseStatementBase->execute(Array, Array)
#2 /home/lsolesen/workspace/discimport_dk_build/includes/bootstrap.inc(3035): DatabaseConnection->query('SELECT filename...', Array)
#3 /home/lsolesen/workspace/discimport_dk_build/includes/bootstrap.inc(2970): _registry_check_code('class', 'Quickpay')
#4 [internal function]: drupal_autoload_class('Quickpay')
#5 /home/lsolesen/workspace/discimport_dk_build/profiles/discimport_dk/modules/contrib/quickpay/tests/quickpay.test(34): spl_autoload_call('Quickpay')
#6 /home/lsolesen/workspace/discimport_dk_build/modules/simpletest/drupal_web_test_case.php(496): QuickPayUnitTest->setUp()
#7 /home/lsolesen/workspace/discimport_dk_build/scripts/run-tests.sh(366): DrupalTestCase->run()
#8 /home/lsolesen/workspace/discimport_dk_build/scripts/run-tests.sh(22): simpletest_script_run_one_test('7', 'QuickPayUnitTes...')
#9 {main}

Next exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'discimport_commerce.simpletest463477registry' doesn't exist' in /home/lsolesen/workspace/discimport_dk_build/includes/database/database.inc:2139
Stack trace:
#0 /home/lsolesen/workspace/discimport_dk_build/includes/database/database.inc(2139): PDOStatement->execute(Array)
#1 /home/lsolesen/workspace/discimport_dk_build/includes/database/database.inc(664): DatabaseStatementBase->execute(Array, Array)
#2 /home/lsolesen/workspace/discimport_dk_build/includes/bootstrap.inc(3035): DatabaseConnection->query('SELECT filename...', Array)
#3 /home/lsolesen/workspace/discimport_dk_build/includes/bootstrap.inc(2954): _registry_check_code('interface', 'Quickpay')
#4 [internal function]: drupal_autoload_interface('Quickpay')
#5 /home/lsolesen/workspace/discimport_dk_build/profiles/discimport_dk/modules/contrib/quickpay/tests/quickpay.test(34): spl_autoload_call('Quickpay')
#6 /home/lsolesen/workspace/discimport_dk_build/modules/simpletest/drupal_web_test_case.php(496): QuickPayUnitTest->setUp()
#7 /home/lsolesen/workspace/discimport_dk_build/scripts/run-tests.sh(366): DrupalTestCase->run()
#8 /home/lsolesen/workspace/discimport_dk_build/scripts/run-tests.sh(22): simpletest_script_run_one_test('7', 'QuickPayUnitTes...')
#9 {main}FATAL QuickPayUnitTest: test runner returned a non-zero error code (1).
CommentFileSizeAuthor
#3 issue-2005490-3.patch466 byteslsolesen
#1 issue-2005490.patch589 byteslsolesen

Comments

lsolesen’s picture

StatusFileSize
new589 bytes

DISREGARD: Does not solve the problem.

lsolesen’s picture

Status: Active » Needs review

Maybe you should enable automated testing on patches also?

lsolesen’s picture

StatusFileSize
new466 bytes

Here is a patch which makes it possible to actually test some code (due to http://drupal.org/node/887134). However, it seems that the tests still needs a proper merchant id.

xen’s picture

Tried running the tests from a site instead of the run-tests.sh script? How about drush test-run?

I'd love to have automated testing of patches, but that would require a QuickPay account with public access, so to speak.

lsolesen’s picture

If one could abstract the class a little more, so a stub or mock could be used for the transaction with quickpay, many of the other things could be tested without actually speaking to quickpay.

Anyhow, the attached patch should probably be committed, because you need to include the file manually as the registry is not working in the DrupalUnitTestCase (only in the DrupalWebTestCase).

xen’s picture

That's odd, it's been like that from day one, and the tests have been working fine. But I've only ever run it from a test site.

I'll get it committed.

Problem with creating a mock service of some kind is that we'd have to mock most of QuickPay's API, and if, say, the MD5 calculation is wrong, there's a equal chance that the mock service MD5 generation would also be wrong, thus not catching the error in any case.

I'll shoot a mail off to QuickPay and see if we can't figure something out.

lsolesen’s picture

Cool. I would be great with automatic tests.

xen’s picture

Status: Needs review » Fixed

Actually, I thought some other hurdles for automatic testing:

We can't test the payment window, as it's a page on an external site, and selenium tests aren't supported by d.o.

Secondly, I don't know if it is possible to send a request to the testbots sites from the outside, which is rather required for testing the callbacks (assuming we'd solve the first problem).

Thirdly, QuickPay needs to be configured with the IPs of the origin server, and we don't know where the tests might run.

In fact, the tests in the module doesn't cover the part of the module that's most interesting to test (the payment window), so they're not getting much attention.

I should look into creating some addon Selenium or Behat based tests, so it would at least be possible to test most things locally, but time is a scarce resource.

I've committed the patch.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Added current error message.