jenkins-bot has submitted this change and it was merged.

Change subject: tests: group structures tests in their own directory
......................................................................


tests: group structures tests in their own directory

The phpunit root directory has two test file:

 AutoLoaderTest.php
 StructureTest.php

The later was registered in phpunit under the `structure` test suite
while the former was not registered and hence never run (bug 47750).

This patch moves both files under the `structure` subdirectory and
change the suite to look in that directory.  That will avoid us having
to manually maintain a list of test files.

Updated the __DIR__ in StructureTest.php.

Change-Id: I419c9157f32bdf7e1ff26a42f4bb3f3922b7be37
---
R tests/phpunit/structure/AutoLoaderTest.php
R tests/phpunit/structure/StructureTest.php
M tests/phpunit/suite.xml
3 files changed, 3 insertions(+), 3 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/tests/phpunit/AutoLoaderTest.php 
b/tests/phpunit/structure/AutoLoaderTest.php
similarity index 100%
rename from tests/phpunit/AutoLoaderTest.php
rename to tests/phpunit/structure/AutoLoaderTest.php
diff --git a/tests/phpunit/StructureTest.php 
b/tests/phpunit/structure/StructureTest.php
similarity index 92%
rename from tests/phpunit/StructureTest.php
rename to tests/phpunit/structure/StructureTest.php
index a942098..df00d4d 100644
--- a/tests/phpunit/StructureTest.php
+++ b/tests/phpunit/structure/StructureTest.php
@@ -14,7 +14,7 @@
                if ( wfIsWindows() ) {
                        $this->markTestSkipped( 'This test does not work on 
Windows' );
                }
-               $rootPath = escapeshellarg( __DIR__ );
+               $rootPath = escapeshellarg( __DIR__ . '/..' );
                $testClassRegex = implode( '|', array(
                        'ApiFormatTestBase',
                        'ApiTestCase',
@@ -58,6 +58,6 @@
         * Filter to remove testUnitTestFileNamesEndWithTest false positives.
         */
        public function filterSuites( $filename ) {
-               return strpos( $filename, __DIR__ . '/suites/' ) !== 0;
+               return strpos( $filename, __DIR__ . '/../suites/' ) !== 0;
        }
 }
diff --git a/tests/phpunit/suite.xml b/tests/phpunit/suite.xml
index 56f6447..844c853 100644
--- a/tests/phpunit/suite.xml
+++ b/tests/phpunit/suite.xml
@@ -29,7 +29,7 @@
                        <directory>maintenance</directory>
                </testsuite>
                <testsuite name="structure">
-                       <file>StructureTest.php</file>
+                       <directory>structure</directory>
                </testsuite>
                <testsuite name="uploadfromurl">
                        <file>suites/UploadFromUrlTestSuite.php</file>

-- 
To view, visit https://gerrit.wikimedia.org/r/64788
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I419c9157f32bdf7e1ff26a42f4bb3f3922b7be37
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: JanZerebecki <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to