Jeroen De Dauw has uploaded a new change for review. https://gerrit.wikimedia.org/r/68359
Change subject: Have Travis run the integration tests as well ...................................................................... Have Travis run the integration tests as well Change-Id: Ibc8e8368572b14890081e9078b9aae9c42383ee4 --- M phpunit.xml.dist M tests/bootstrap.php A tests/evilMediaWikiBootstrap.php 3 files changed, 73 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseQueryEngine refs/changes/59/68359/1 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 38769f8..d28e8c2 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -17,5 +17,8 @@ <directory>tests/phpunit</directory> <exclude>tests/integration</exclude> </testsuite> + <testsuite name="QueryEngineIntegration"> + <directory>tests/integration</directory> + </testsuite> </testsuites> </phpunit> diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 888b2a4..8a0b319 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -12,6 +12,10 @@ * @author Jeroen De Dauw < jeroended...@gmail.com > */ +if ( !in_array( '--testsuite=QueryEngine', $GLOBALS['argv'] ) ) { + require_once( __DIR__ . '/evilMediaWikiBootstrap.php' ); +} + require_once( __DIR__ . '/../../DataValues/DataValues/DataValues.php' ); require_once( __DIR__ . '/../../Ask/Ask.php' ); @@ -24,4 +28,4 @@ require_once( __DIR__ . '/testLoader.php' ); -// If something needs to change here, a reflecting change needs to be added to ../dependencies.txt. \ No newline at end of file +// If something needs to change here, a reflecting change needs to be added to INSTALL.md. \ No newline at end of file diff --git a/tests/evilMediaWikiBootstrap.php b/tests/evilMediaWikiBootstrap.php new file mode 100644 index 0000000..e262ecd --- /dev/null +++ b/tests/evilMediaWikiBootstrap.php @@ -0,0 +1,65 @@ +<?php + +define( 'MEDIAWIKI', true ); + +global $IP; +$IP = getenv( 'MW_INSTALL_PATH' ); + +if ( $IP === false ) { + $IP = dirname( __FILE__ ) . '/../../../..'; +} + +$self = 'foobar'; + +// Detect compiled mode +# Get the MWInit class +require_once "$IP/includes/Init.php"; +require_once "$IP/includes/AutoLoader.php"; +# Stub the profiler +require_once "$IP/includes/profiler/Profiler.php"; + +# Start the profiler +$wgProfiler = array(); +if ( file_exists( "$IP/StartProfiler.php" ) ) { + require "$IP/StartProfiler.php"; +} + +// Some other requires +require_once "$IP/includes/Defines.php"; + +require_once MWInit::compiledPath( 'includes/DefaultSettings.php' ); + +foreach ( get_defined_vars() as $key => $var ) { + if ( !array_key_exists( $key, $GLOBALS ) ) { + $GLOBALS[$key] = $var; + } +} + +if ( defined( 'MW_CONFIG_CALLBACK' ) ) { + # Use a callback function to configure MediaWiki + MWFunction::call( MW_CONFIG_CALLBACK ); +} else { + // Require the configuration (probably LocalSettings.php) + require loadSettings(); +} + +// Some last includes +require_once MWInit::compiledPath( 'includes/Setup.php' ); + +// Much much faster startup than creating a title object +$wgTitle = null; + + +function loadSettings() { + global $wgCommandLineMode, $IP; + + $settingsFile = "$IP/LocalSettings.php"; + + if ( !is_readable( $settingsFile ) ) { + $this->error( "A copy of your installation's LocalSettings.php\n" . + "must exist and be readable in the source directory.\n" . + "Use --conf to specify it.", true ); + } + $wgCommandLineMode = true; + return $settingsFile; +} \ No newline at end of file -- To view, visit https://gerrit.wikimedia.org/r/68359 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibc8e8368572b14890081e9078b9aae9c42383ee4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/WikibaseQueryEngine Gerrit-Branch: master Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits