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
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
@@ -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',
 | 
			
		||||
 
 | 
			
		||||
@@ -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');
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,34 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright 2011 Facebook, Inc.
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License");
 | 
			
		||||
 * you may not use this file except in compliance with the License.
 | 
			
		||||
 * You may obtain a copy of the License at
 | 
			
		||||
 *
 | 
			
		||||
 *   http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * Unless required by applicable law or agreed to in writing, software
 | 
			
		||||
 * distributed under the License is distributed on an "AS IS" BASIS,
 | 
			
		||||
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 | 
			
		||||
 * See the License for the specific language governing permissions and
 | 
			
		||||
 * limitations under the License.
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
final class PhabricatorInfrastructureTestCase
 | 
			
		||||
  extends PhabricatorTestCase {
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * This is more of an acceptance test case instead of a unittest. It verifies
 | 
			
		||||
   * that all symbols can be loaded correctly. It can catch problem like missing
 | 
			
		||||
   * methods in descendants of abstract base classes.
 | 
			
		||||
   */
 | 
			
		||||
  public function testEverythingImplemented() {
 | 
			
		||||
    // Note that we don't have a try catch block around the following because,
 | 
			
		||||
    // when it fails, it will cause a HPHP or PHP fatal which won't be caught
 | 
			
		||||
    // by try catch.
 | 
			
		||||
    $every_class = id(new PhutilSymbolLoader())->selectAndLoadSymbols();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										15
									
								
								src/infrastructure/__tests__/__init__.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/infrastructure/__tests__/__init__.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,15 @@
 | 
			
		||||
<?php
 | 
			
		||||
/**
 | 
			
		||||
 * This file is automatically generated. Lint this module to rebuild it.
 | 
			
		||||
 * @generated
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
phutil_require_module('phabricator', 'infrastructure/testing/testcase');
 | 
			
		||||
 | 
			
		||||
phutil_require_module('phutil', 'symbols');
 | 
			
		||||
phutil_require_module('phutil', 'utils');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
phutil_require_source('PhabricatorInfrastructureTestCase.php');
 | 
			
		||||
		Reference in New Issue
	
	Block a user