https://bugzilla.wikimedia.org/show_bug.cgi?id=57976

       Web browser: ---
            Bug ID: 57976
           Summary: API unit tests assume repeatable ordering of output
           Product: MediaWiki
           Version: 1.23-git
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: Unprioritized
         Component: API
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]
            Blocks: 384, 39236
    Classification: Unclassified
   Mobile Platform: ---

When testing on PostgreSQL:

3) ApiQueryBasicTest::testGenerator
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'AQBT-All'
+'AQBT-Categories'

/usr/home/saper/test/mytest/tests/phpunit/includes/api/query/ApiQueryTestBase.php:143
/usr/home/saper/test/mytest/tests/phpunit/includes/api/query/ApiQueryTestBase.php:141
/usr/home/saper/test/mytest/tests/phpunit/includes/api/query/ApiQueryTestBase.php:141
/usr/home/saper/test/mytest/tests/phpunit/includes/api/query/ApiQueryTestBase.php:141
/usr/home/saper/test/mytest/tests/phpunit/includes/api/query/ApiQueryTestBase.php:105
/usr/home/saper/test/mytest/tests/phpunit/includes/api/query/ApiQueryTestBase.php:100
/usr/home/saper/test/mytest/tests/phpunit/includes/api/query/ApiQueryBasicTest.php:299
/usr/home/saper/test/mytest/tests/phpunit/MediaWikiTestCase.php:123
/usr/home/saper/test/mytest/tests/phpunit/MediaWikiPHPUnitCommand.php:80
/usr/home/saper/test/mytest/tests/phpunit/MediaWikiPHPUnitCommand.php:64
/usr/home/saper/test/mytest/tests/phpunit/phpunit.php:119

Looks like that list of pages returned by API is okay, only the order is
different:
Request: generator=links&titles=AQBT-Links&action=query

Expected:
Array
(
    [query] => Array
        (
            [pages] => Array
                (
                    [1] => Array
                        (
                            [pageid] => 1
                            [ns] => 0
                            [title] => AQBT-All
                        )

                    [2] => Array
                        (
                            [pageid] => 2
                            [ns] => 0
                            [title] => AQBT-Categories
                        )

                    [4] => Array
                        (
                            [pageid] => 4
                            [ns] => 0
                            [title] => AQBT-Templates
                        )

                )

        )

)

Result:
Array
(
    [query] => Array
        (
            [pages] => Array
                (
                    [109] => Array
                        (
                            [pageid] => 109
                            [ns] => 0
                            [title] => AQBT-Categories
                        )

                    [108] => Array
                        (
                            [pageid] => 108
                            [ns] => 0
                            [title] => AQBT-All
                        )

                    [111] => Array
                        (
                            [pageid] => 111
                            [ns] => 0
                            [title] => AQBT-Templates
                        )

                )

        )

)


Not sure if order of page titles returned by API should be guaranteed? Should
we test for it?

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to