Do not rely on active internet connection and 3rd party server at the tests

Aron Novak - August 27, 2009 - 08:47
Project:FeedAPI
Version:6.x-1.x-dev
Component:Code (general)
Category:task
Priority:critical
Assigned:Aron Novak
Status:closed
Description

All of the test cases depend on a 3rd party server and internet connection.
All of the test XML files should be hosted locally, inside the module tests directory.

#1

Aron Novak - August 27, 2009 - 13:57
Status:active» needs review

Obvious.

AttachmentSize
560882_eliminate_3rd_party_dependency_at_tests.patch 37.46 KB

#2

alex_b - September 17, 2009 - 20:21
Status:needs review» needs work

url() will break the tests if clean urls is not enabled. Use global $base_url instead.

#3

Aron Novak - September 18, 2009 - 08:06
Status:needs work» needs review

#2: why do you think so? http://api.drupal.org/api/function/url/6 - it seems that this function is aware of clean url setting.

#4

alex_b - September 24, 2009 - 22:47

Because when you build a url for a file, you don't want a query string in your url. The code as it stands right now, would create URLs that look like:

http://localhost?q=tests/files/test_feed.rss

which would break, because tests/files/test_feed.rss is not served from Drupal but from a file and therefore always needs to be

http://localhost/tests/files/test_feed.rss

#5

Aron Novak - September 25, 2009 - 13:03

#4: thanks for the explanation!

Here i added a wrapper to generate test file URLs and using base_url of course.

The previous patch seems to be bogus also, cause a dynamic .php feed remained in the test suite. Now it's all good, can be executed without net connection

AttachmentSize
560882-5_eliminate_3rd_party_dependency_at_tests.patch 46.91 KB

#6

Aron Novak - October 2, 2009 - 14:16
Status:needs review» fixed

Committed.
All of the tests can be executed w/o net connection (although a bit slower)

#7

System Message - October 16, 2009 - 14:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.