From 13eee1a344e9589f3b7d3458524488e078c42b42 Mon Sep 17 00:00:00 2001 From: Jason Ge Date: Wed, 19 Oct 2011 18:26:21 -0700 Subject: [PATCH] Add test to check all symbols can be loaded Summary: make sure all symboles can be loaded to avoid issues like missing methods in descendants of abstract base class. Test Plan: ran it and verified it passes; remove a method in a descendant class and verified that the test failed. Reviewers: epriestley, nh Reviewed By: nh CC: aran, nh, jungejason Differential Revision: 1023 --- scripts/install/update_phabricator.sh | 8 +++++ src/__phutil_library_map__.php | 2 ++ .../diffusion/controller/symbol/__init__.php | 1 + .../PhabricatorInfrastructureTestCase.php | 34 +++++++++++++++++++ src/infrastructure/__tests__/__init__.php | 15 ++++++++ 5 files changed, 60 insertions(+) create mode 100644 src/infrastructure/__tests__/PhabricatorInfrastructureTestCase.php create mode 100644 src/infrastructure/__tests__/__init__.php diff --git a/scripts/install/update_phabricator.sh b/scripts/install/update_phabricator.sh index ebde400efe..42b716b001 100755 --- a/scripts/install/update_phabricator.sh +++ b/scripts/install/update_phabricator.sh @@ -25,6 +25,13 @@ fi (cd $ROOT/phabricator && git pull && git submodule update --init) +### RUN TESTS ################################################################## + +# This is an acceptance test that makes sure all symboles can be loaded to +# avoid issues like missing methods in descendants of abstract base class. +(cd $ROOT/phabricator && ../arcanist/bin/arc unit src/infrastructure/__tests__/) + + ### GENERATE DOCUMENTATION ##################################################### # This generates documentation if you have diviner/ checked out. You generally @@ -38,6 +45,7 @@ then (cd $ROOT/phabricator && $ROOT/diviner/bin/diviner .) fi + ### CYCLE APACHE AND DAEMONS ################################################### # Stop Apache. Depening on what system you're running, you may need to use diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 70bda6f6ee..3f547eb798 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -469,6 +469,7 @@ phutil_register_library_map(array( 'PhabricatorIRCObjectNameHandler' => 'infrastructure/daemon/irc/handler/objectname', 'PhabricatorIRCProtocolHandler' => 'infrastructure/daemon/irc/handler/protocol', 'PhabricatorImageTransformer' => 'applications/files/transform', + 'PhabricatorInfrastructureTestCase' => 'infrastructure/__tests__', 'PhabricatorJavelinLinter' => 'infrastructure/lint/linter/javelin', 'PhabricatorLintEngine' => 'infrastructure/lint/engine', 'PhabricatorLiskDAO' => 'applications/base/storage/lisk', @@ -1099,6 +1100,7 @@ phutil_register_library_map(array( 'PhabricatorIRCBot' => 'PhabricatorDaemon', 'PhabricatorIRCObjectNameHandler' => 'PhabricatorIRCHandler', 'PhabricatorIRCProtocolHandler' => 'PhabricatorIRCHandler', + 'PhabricatorInfrastructureTestCase' => 'PhabricatorTestCase', 'PhabricatorJavelinLinter' => 'ArcanistLinter', 'PhabricatorLintEngine' => 'PhutilLintEngine', 'PhabricatorLiskDAO' => 'LiskDAO', diff --git a/src/applications/diffusion/controller/symbol/__init__.php b/src/applications/diffusion/controller/symbol/__init__.php index a89701bdea..d1babcd62e 100644 --- a/src/applications/diffusion/controller/symbol/__init__.php +++ b/src/applications/diffusion/controller/symbol/__init__.php @@ -9,6 +9,7 @@ phutil_require_module('phabricator', 'aphront/response/redirect'); phutil_require_module('phabricator', 'applications/diffusion/controller/base'); phutil_require_module('phabricator', 'applications/diffusion/query/symbol'); +phutil_require_module('phabricator', 'applications/diffusion/request/base'); phutil_require_module('phabricator', 'applications/repository/storage/arcanistproject'); phutil_require_module('phabricator', 'applications/repository/storage/repository'); phutil_require_module('phabricator', 'storage/queryfx'); diff --git a/src/infrastructure/__tests__/PhabricatorInfrastructureTestCase.php b/src/infrastructure/__tests__/PhabricatorInfrastructureTestCase.php new file mode 100644 index 0000000000..75cddb51a0 --- /dev/null +++ b/src/infrastructure/__tests__/PhabricatorInfrastructureTestCase.php @@ -0,0 +1,34 @@ +selectAndLoadSymbols(); + } +} + diff --git a/src/infrastructure/__tests__/__init__.php b/src/infrastructure/__tests__/__init__.php new file mode 100644 index 0000000000..714cba8a31 --- /dev/null +++ b/src/infrastructure/__tests__/__init__.php @@ -0,0 +1,15 @@ +