Proving Tests and $LJ::IS_DEV_SERVER
Nov. 10th, 2009 10:01 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
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)?
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)?