SEL-Columbia / formhub

Mobile Data Collection made easy.
http://formhub.org
BSD 2-Clause "Simplified" License
259 stars 163 forks source link

Retry slim dedicated server #1340

Closed vr2262 closed 10 years ago

vr2262 commented 10 years ago

Includes all the changes from slim_dedicated_server except:

  1. Does not use PostgreSQL for the tests... for some reason the tests really don't like it.
  2. Does not include the change from a4c4bb511d8366cc5fee9dff81767ce6de684f6a ... it causes many tests to fail and the user doesn't expect to be able to upload a form with a name that already exists.
  3. Uses testserver.com rather than example.org in two of the tests... for some reason one works but not the other.
vr2262 commented 10 years ago

Here is the diff between slim_dedicated_server (when I first took a look at it) and retry_slim_dedicated_server: https://github.com/SEL-Columbia/formhub/compare/8951d6fc6983dff9504a883491c8f2ea97aa8152...slim_dedicated_server

vr2262 commented 10 years ago

:ok_hand:

MartijnR commented 10 years ago

Is this it? The big one?

MartijnR commented 10 years ago

Is it @dpapathanasiou ?

OMG it is!

dpapathanasiou commented 10 years ago

It's more the the end of the beginning...

BTW, remember that whole discussion about not using 'testserver.com/bob' and using something more canonical like 'example.org'?

Well that fubar'd a whole bunch of tests, and we had to resort to restoring 'testserver.com/bob' to get it to work.

Any idea why? I thought enketo doesn't really care about that url as long as it is publically-visible.

MartijnR commented 10 years ago

Ah...

Actually Enketo's API doesn't care about the url period. It won't check whether it's publicly visible when responding (only when actually trying to load the webform).

The advantage of using the special testserver.com/xxx server url's is that you can easily test for more response codes and it does some cleanup afterwards. Maybe those failing tests were either testing exotic response codes or had to be augmented to clean up after themselves (quite important if you're launching a unique form with a random form_id every time the tests are run because this will actually create a db entry in Enketo).

Another reason for the failing tests could be that a server_url was used that was not linked with the Enketo server (returning 'no account' errors) or didn't use the right API key.