Add SimpleTest user agent information to drupal_http_request

boombatower - May 20, 2008 - 20:05
Project:Drupal
Version:7.x-dev
Component:simpletest.module
Category:task
Priority:critical
Assigned:boombatower
Status:closed
Description

This issue has been run into multiple times and even discussed several times with nothing done about it.

Internal Drupal functions like xmlrpc call drupal_http_request which makes an HTTP request. When tests try to call these functions they don't pass the SimpleTest user-agent (database-prefix) information like the cURL handler does.

This broke a number of tests that used to pass before the database-prefixing was implemented.

To fix this a patch similar to simpletest_review_blogapi_xmlrpc.patch at http://drupal.org/node/245955 should be created. Instead of that patch which is specific for xmlrpc stuff a more broad catch-all patch should be applied.

I have create a patch that fixes the issue.

AttachmentSizeStatusTest resultOperations
add_simpletest_user_agent.patch1.06 KBIgnoredNoneNone

#1

chx - May 20, 2008 - 20:09
Status:needs review» needs work

$simpletest_ua_key this is not used in core.

#2

boombatower - May 20, 2008 - 20:29

I was wondering about that since I remember discussion about it not being necessary.

#3

boombatower - May 20, 2008 - 20:31
Status:needs work» needs review

Updated patch. Previous one still worked since it just ignored the extra key. :)

AttachmentSizeStatusTest resultOperations
add_simpletest_user_agent.patch1.02 KBIgnoredNoneNone

#4

Dries - May 22, 2008 - 19:47
Status:needs review» needs work

I'd like to see a bit more code comments in the code. We should explain _why_ this is needed. Thanks for your hard work. :)

#5

boombatower - May 23, 2008 - 21:39
Status:needs work» needs review

Added more comments.

AttachmentSizeStatusTest resultOperations
add_simpletest_user_agent.patch1.21 KBIgnoredNoneNone

#6

Dries - May 26, 2008 - 20:24
Status:needs review» needs work

I still think it needs more documentation. Why do we have to use headers instead of, say, a database variable. I know the answer, but it would be good to explain this. You added the "what", but the "why" and "how" is still missing from the documentation. We're almost there ...

#7

boombatower - May 27, 2008 - 02:52
Status:needs work» needs review

Probably a good idea since it is a rather odd bit of code.

AttachmentSizeStatusTest resultOperations
add_simpletest_user_agent.patch1.43 KBIgnoredNoneNone

#8

boombatower - May 30, 2008 - 19:47
Status:needs review» reviewed & tested by the community

I think that has been reviewed and it just needed comments...

#9

boombatower - June 6, 2008 - 00:17

This is showing up in another issue so it would be nice to get it resolved.

#10

Damien Tournoud - June 6, 2008 - 00:30

For what is worth, this looks good now.

#11

catch - June 9, 2008 - 10:44
Priority:normal» critical

This fixes http://drupal.org/node/259988 - so confirming the RTBC and marking as critical.

#12

flobruit - June 9, 2008 - 13:12

#13

cwgordon7 - June 16, 2008 - 22:27

#14

boombatower - June 16, 2008 - 23:39

Yea! Three tests!

#15

Dries - June 24, 2008 - 22:10
Status:reviewed & tested by the community» fixed

Committed to CVS HEAD. Thanks.

#16

Anonymous (not verified) - July 8, 2008 - 22:13
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.