[dw-free] Framework for JS unit tests
[commit: http://hg.dwscoalition.org/dw-free/rev/5cad96087a9a]
http://bugs.dwscoalition.org/show_bug.cgi?id=3524
Don't include in the routing table at all, if we're not a dev server.
Patch by
fu.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=3524
Don't include in the routing table at all, if we're not a dev server.
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- cgi-bin/DW/Controller/Dev.pm
-------------------------------------------------------------------------------- diff -r 7987e36ba2a6 -r 5cad96087a9a cgi-bin/DW/Controller/Dev.pm --- a/cgi-bin/DW/Controller/Dev.pm Tue Feb 22 17:12:12 2011 +0800 +++ b/cgi-bin/DW/Controller/Dev.pm Tue Feb 22 17:43:00 2011 +0800 @@ -7,7 +7,7 @@ # Authors: # Afuna <coder.dw@afunamatata.com> # -# Copyright (c) 2010 by Dreamwidth Studios, LLC. +# Copyright (c) 2010-2011 by Dreamwidth Studios, LLC. # # This program is free software; you may redistribute it and/or modify it under # the same terms as Perl itself. For a copy of the license, please reference @@ -23,7 +23,8 @@ DW::Routing->register_static( '/dev/clas DW::Routing->register_static( '/dev/classes', 'dev/classes.tt', app => 1 ); -DW::Routing->register_regex( '/dev/tests/([^/]+)(?:/(.*))?', \&tests_handler, app => 1 ); +DW::Routing->register_regex( '/dev/tests/([^/]+)(?:/(.*))?', \&tests_handler, app => 1 ) + if $LJ::IS_DEV_SERVER; sub tests_handler { my ( $opts ) = @_; @@ -31,7 +32,6 @@ sub tests_handler { my $lib = $opts->subpatterns->[1] || ""; my $r = DW::Request->get; - return $r->NOT_FOUND unless $LJ::IS_DEV_SERVER; # force a site scheme which only shows the bare content # but still prints out resources included using need_res --------------------------------------------------------------------------------
no subject
Or am I missing something?
[edit: To make clear; I don't have an issue with the tests not being included in the main repo. But I think that if we do put them in a separate repo, then we should have the switch for whether the tests are on *in that repo*, so that when the code for tests is checked out, the tests are automatically enabled, and if the test repo isn't there, they're disabled. Then there wouldn't be an issue.]
no subject
Whether the tests are available will depend (likely) on whether the multicvs.conf is configured to copy over the test files in the proper locations. If so, we may be able to dispense of the IS_DEV_SERVER checks -- but this is a different issue from what was addressed in the changeset above.