Skip to content

Commit 13eee1a

Browse files
author
Jason Ge
committedOct 20, 2011
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
1 parent f447e5d commit 13eee1a

File tree

5 files changed

+60
-0
lines changed

5 files changed

+60
-0
lines changed
 

‎scripts/install/update_phabricator.sh

+8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ fi
2525
(cd $ROOT/phabricator && git pull && git submodule update --init)
2626

2727

28+
### RUN TESTS ##################################################################
29+
30+
# This is an acceptance test that makes sure all symboles can be loaded to
31+
# avoid issues like missing methods in descendants of abstract base class.
32+
(cd $ROOT/phabricator && ../arcanist/bin/arc unit src/infrastructure/__tests__/)
33+
34+
2835
### GENERATE DOCUMENTATION #####################################################
2936

3037
# This generates documentation if you have diviner/ checked out. You generally
@@ -38,6 +45,7 @@ then
3845
(cd $ROOT/phabricator && $ROOT/diviner/bin/diviner .)
3946
fi
4047

48+
4149
### CYCLE APACHE AND DAEMONS ###################################################
4250

4351
# Stop Apache. Depening on what system you're running, you may need to use

‎src/__phutil_library_map__.php

+2
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@
469469
'PhabricatorIRCObjectNameHandler' => 'infrastructure/daemon/irc/handler/objectname',
470470
'PhabricatorIRCProtocolHandler' => 'infrastructure/daemon/irc/handler/protocol',
471471
'PhabricatorImageTransformer' => 'applications/files/transform',
472+
'PhabricatorInfrastructureTestCase' => 'infrastructure/__tests__',
472473
'PhabricatorJavelinLinter' => 'infrastructure/lint/linter/javelin',
473474
'PhabricatorLintEngine' => 'infrastructure/lint/engine',
474475
'PhabricatorLiskDAO' => 'applications/base/storage/lisk',
@@ -1099,6 +1100,7 @@
10991100
'PhabricatorIRCBot' => 'PhabricatorDaemon',
11001101
'PhabricatorIRCObjectNameHandler' => 'PhabricatorIRCHandler',
11011102
'PhabricatorIRCProtocolHandler' => 'PhabricatorIRCHandler',
1103+
'PhabricatorInfrastructureTestCase' => 'PhabricatorTestCase',
11021104
'PhabricatorJavelinLinter' => 'ArcanistLinter',
11031105
'PhabricatorLintEngine' => 'PhutilLintEngine',
11041106
'PhabricatorLiskDAO' => 'LiskDAO',

‎src/applications/diffusion/controller/symbol/__init__.php

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
phutil_require_module('phabricator', 'aphront/response/redirect');
1010
phutil_require_module('phabricator', 'applications/diffusion/controller/base');
1111
phutil_require_module('phabricator', 'applications/diffusion/query/symbol');
12+
phutil_require_module('phabricator', 'applications/diffusion/request/base');
1213
phutil_require_module('phabricator', 'applications/repository/storage/arcanistproject');
1314
phutil_require_module('phabricator', 'applications/repository/storage/repository');
1415
phutil_require_module('phabricator', 'storage/queryfx');
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
/*
4+
* Copyright 2011 Facebook, Inc.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
final class PhabricatorInfrastructureTestCase
20+
extends PhabricatorTestCase {
21+
22+
/**
23+
* This is more of an acceptance test case instead of a unittest. It verifies
24+
* that all symbols can be loaded correctly. It can catch problem like missing
25+
* methods in descendants of abstract base classes.
26+
*/
27+
public function testEverythingImplemented() {
28+
// Note that we don't have a try catch block around the following because,
29+
// when it fails, it will cause a HPHP or PHP fatal which won't be caught
30+
// by try catch.
31+
$every_class = id(new PhutilSymbolLoader())->selectAndLoadSymbols();
32+
}
33+
}
34+
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
/**
3+
* This file is automatically generated. Lint this module to rebuild it.
4+
* @generated
5+
*/
6+
7+
8+
9+
phutil_require_module('phabricator', 'infrastructure/testing/testcase');
10+
11+
phutil_require_module('phutil', 'symbols');
12+
phutil_require_module('phutil', 'utils');
13+
14+
15+
phutil_require_source('PhabricatorInfrastructureTestCase.php');

0 commit comments

Comments
 (0)
Failed to load comments.