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

Change subject: resourceloader: Call setName() in test suite before calling 
getStyles()
......................................................................


resourceloader: Call setName() in test suite before calling getStyles()

This caused a database error due to NULL being inserted as name, which is 
illegal.

> Function: DatabaseSqlite::replace/single-row
> NOT NULL constraint failed: unittest_module_deps.md_module
> Stack trace:
> #3 includes/resourceloader/ResourceLoaderFileModule.php(420): 
> DatabaseSqlite->replace()
> #4 tests/phpunit/includes/resourceloader/ResourceLoaderTest.php(88): 
> ResourceLoaderFileModule->getStyles()
> #5 (): ResourceLoaderTest->testLessFileCompilation()

This test shouldn't be trigggering database updates, but that's for
a later change to stub out or refactor.

Bug: T91567
Change-Id: Ic451bd41e2ffc188d2efd6b7ce61b03b9de61296
(cherry picked from commit 54473cbb6deaf3c8b2089a3a9a995b067e272151)
---
M tests/phpunit/includes/resourceloader/ResourceLoaderTest.php
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php 
b/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php
index 4fc7378..5d83239 100644
--- a/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php
+++ b/tests/phpunit/includes/resourceloader/ResourceLoaderTest.php
@@ -85,6 +85,7 @@
                        'localBasePath' => $basePath,
                        'styles' => array( 'styles.less' ),
                ) );
+               $module->setName( 'test.less' );
                $styles = $module->getStyles( $context );
                $this->assertStringEqualsFile( $basePath . '/styles.css', 
$styles['all'] );
        }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic451bd41e2ffc188d2efd6b7ce61b03b9de61296
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: wmf/1.25wmf20
Gerrit-Owner: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to