Lucas_Werkmeister_WMDE added a comment.

  > I think we’re now running anything that claims to be a unit test against 
the real database of the wiki
  
  Confirmed:
  
  name=tests/phpunit/unit/includes/LucasTest.php
    <?php
    
    class LucasTest extends \PHPUnit\Framework\TestCase {
    
        public function testDatabaseAccess(): void {
                var_dump( wfGetDB( DB_PRIMARY )->selectRow(
                        'recentchanges',
                        [ 'rc_title', 'rc_timestamp' ],
                        '',
                        __METHOD__,
                        [
                                'LIMIT' => 1,
                                'ORDER BY' => 'rc_timestamp DESC',
                        ]
                ) );
        }
    
    }
  
  
  
    $ vendor/bin/phpunit tests/phpunit/unit/includes/LucasTest.php
    Using PHP 8.1.2
    PHPUnit 8.5.26 #StandWithUkraine
    
    LucasTest
     ☢ testDatabaseAccess
    /var/www/html/wiki1/tests/phpunit/unit/includes/LucasTest.php:12:
    class stdClass#876 (2) {
      public $rc_title =>
      string(21) "Page_with_1000_commas"
      public $rc_timestamp =>
      string(14) "20220604150204"
    }
  
  “Page with 1000 commas” is indeed the latest recentchanges entry on my local 
wiki, from 2022-06-04. This test is accessing the real wiki database. In my 
opinion, this should never happen – integration tests should have the test DB, 
and for unit tests, database access should fail.

TASK DETAIL
  https://phabricator.wikimedia.org/T310255

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Lucas_Werkmeister_WMDE
Cc: Jakob_WMDE, Lucas_Werkmeister_WMDE, kostajh, Krinkle, Aklapper, 
Physikerwelt, Fernandobacasegua34, Astuthiodit_1, 786, Suran38, Biggs657, 
karapayneWMDE, Invadibot, Lalamarie69, Zabe, maantietaja, Juan90264, 
Alter-paule, Beast1978, ItamarWMDE, Un1tY, Akuckartz, Hook696, CptViraj, 
Majavah, Kent7301, joker88john, DannyS712, wildly_boy, CucyNoiD, Nandana, 
Gaboe420, lucamauri, Giuliamocci, Cpaulf30, Lahi, Gq86, Af420, Bsandipan, 
GoranSMilovanovic, Maosef, QZanden, LawExplorer, Lewizho99, Maathavan, 
Debenben, _jensen, rosalieper, Neuronton, Scott_WUaS, Izno, Wong128hk, 
thcipriani, Wikidata-bugs, Snowolf, aude, fredw, Pkra, scfc, Jdforrester-WMF, 
Mbch331, Jay8g, hashar
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to