wyntarvox: (Default)
wyntarvox ([personal profile] wyntarvox) wrote in [site community profile] dw_dev2009-11-10 10:01 am
Entry tags:

Proving Tests and $LJ::IS_DEV_SERVER

I'm working on t/console-changejournaltype.t One reason it fails is that the console command "change_journal_type" hasn't been updated to be WTF-friendly. This is fairly straightforward to fix, but there's another problem with it.

The can_execute sub for change_journal_type checks for either of two things: a) the user executing the command has the appropriate priv; OR b) $LJ::IS_DEV_SERVER is true. The test, however, only cares about whether the temp_user has the appropriate priv. When the test tries to have temp_user execute change_journal_type without the appropriate priv, it expects the command to error with an inappropriate priv error. However, because on my Dreamhack I have $LJ::IS_DEV_SERVER set to true, the command in fact succeeds which in turn causes the test to fail.

My question is, is it okay to set $LJ::IS_DEV_SERVER to false to get the tests to pass, or should they pass regardless (so we have to rework the tests, for example, to pass if temp_user has the appropriate priv or if $LJ::IS_DEV_SERVER is true)?

Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org