Skip to content

Commit

Permalink
Merge pull request #154 from SemanticMediaWiki/issue-152
Browse files Browse the repository at this point in the history
updated Travis, use CI scripts. Merges although tests are failing (see #153).
  • Loading branch information
gesinn-it-gea committed Feb 24, 2021
2 parents 26937b6 + 5fe2c71 commit 0b78f42
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 82 deletions.
35 changes: 23 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,52 @@
# https://docs.travis-ci.com/user/reference/overview/
language: php

os:
- linux

env:
global:
# fix "Xdebug 3 is installed by default, breaking builds"
# see https://travis-ci.community/t/xdebug-3-is-installed-by-default-breaking-builds/10748
- XDEBUG_MODE=coverage

services:
- mysql
- postgresql

jobs:
fast_finish: true
include:
- env: DB=sqlite; MW=REL1_31; PHPUNIT=5.7.*
php: 7.2
- env: DB=mysql; MW=REL1_31; PHPUNIT=5.7.*
# 1) sqlite, previous MW LTS stable, current SMW stable
- env: DB=sqlite; MW=REL1_31; SMW=3.2.2
php: 7.1
- env: DB=mysql; MW=REL1_33; SITELANG=ja; PHPUNIT=5.7.*
# 2) postgres, current MW non-LTS stable, current SMW stable
- env: DB=postgres; MW=REL1_34; SMW=3.2.2
php: 7.2
- env: DB=mysql; MW=REL1_34; PHPUNIT=6.5.*
php: 7.3
- env: DB=mysql; MW=master; PHPUNIT=6.5.*
# 3) mysql, current MW LTS stable, current SMW stable, COVERAGE
# temp run against cherry-pick SMW until SMW 3.2.3 is available
# temp stay with MW 1.34 until all SMW tests are passing for 1.35
- env: DB=mysql; MW=REL1_34; SMW='dev-master#229e166 as 3.2.2'; TYPE=coverage
php: 7.3
allow_failures:
- env: DB=mysql; MW=master; PHPUNIT=6.5.*

before_install:
# MW is not yet compatible with Composer 2.x, see https://phabricator.wikimedia.org/T266417
- composer self-update --1
- wget https://raw.githubusercontent.com/SemanticMediaWiki/CIScripts/main/travis/install-mediawiki.sh
- wget https://raw.githubusercontent.com/SemanticMediaWiki/CIScripts/main/travis/install-phpunit.sh
- wget https://raw.githubusercontent.com/SemanticMediaWiki/CIScripts/main/travis/install-semantic-mediawiki.sh
- wget https://raw.githubusercontent.com/SemanticMediaWiki/CIScripts/main/travis/upload-scrutinizer-coverage-report.sh

install:
- bash ./tests/travis/install-mediawiki.sh
- bash ./install-mediawiki.sh
- bash ./install-phpunit.sh
- bash ./install-semantic-mediawiki.sh
- bash ./tests/travis/install-semantic-extra-special-properties.sh

script:
- bash ./tests/travis/run-tests.sh

after_success:
- bash ./tests/travis/upload-coverage-report.sh
- bash ./upload-scrutinizer-coverage-report.sh

notifications:
email:
Expand Down
104 changes: 34 additions & 70 deletions tests/travis/install-semantic-extra-special-properties.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,73 +4,37 @@ set -ex
BASE_PATH=$(pwd)
MW_INSTALL_PATH=$BASE_PATH/../mw

# Run Composer installation from the MW root directory
function installToMediaWikiRoot {
echo -e "Running MW root composer install build on $TRAVIS_BRANCH \n"

cd $MW_INSTALL_PATH

if [ "$PHPUNIT" != "" ]
then
composer require 'phpunit/phpunit='$PHPUNIT --prefer-source --update-with-dependencies
else
composer require 'phpunit/phpunit=3.7.*' --prefer-source --update-with-dependencies
fi

if [ "$SESP" != "" ]
then
composer require 'mediawiki/semantic-extra-special-properties='$SESP --prefer-source --update-with-dependencies
else
composer init --stability dev
composer require mediawiki/semantic-extra-special-properties "dev-master" --prefer-source --dev --update-with-dependencies

cd extensions
cd SemanticExtraSpecialProperties

# Pull request number, "false" if it's not a pull request
# After the install via composer an additional get fetch is carried out to
# update th repository to make sure that the latests code changes are
# deployed for testing
if [ "$TRAVIS_PULL_REQUEST" != "false" ]
then
git fetch origin +refs/pull/"$TRAVIS_PULL_REQUEST"/merge:
git checkout -qf FETCH_HEAD
else
git fetch origin "$TRAVIS_BRANCH"
git checkout -qf FETCH_HEAD
fi

cd ../..
fi

# Rebuild the class map for added classes during git fetch
composer dump-autoload
}

function updateConfiguration {

cd $MW_INSTALL_PATH

# Site language
if [ "$SITELANG" != "" ]
then
echo '$wgLanguageCode = "'$SITELANG'";' >> LocalSettings.php
fi

echo 'error_reporting(E_ALL| E_STRICT);' >> LocalSettings.php
echo 'ini_set("display_errors", 1);' >> LocalSettings.php
echo '$wgShowExceptionDetails = true;' >> LocalSettings.php
echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php
echo "putenv( 'MW_INSTALL_PATH=$(pwd)' );" >> LocalSettings.php

# SMW#1732
echo 'wfLoadExtension( "SemanticMediaWiki" );' >> LocalSettings.php

# SRF#103
echo 'wfLoadExtension( "SemanticExtraSpecialProperties" );' >> LocalSettings.php

php maintenance/update.php --quick
}

installToMediaWikiRoot
updateConfiguration
## Install
echo -e "Running MW root composer install build on $TRAVIS_BRANCH \n"

cd $MW_INSTALL_PATH

if [ "$SESP" != "" ]; then
composer require 'mediawiki/semantic-extra-special-properties='$SESP --prefer-source --update-with-dependencies
else
composer init --stability dev
composer require mediawiki/semantic-extra-special-properties "dev-master" --prefer-source --dev --update-with-dependencies

cd extensions
cd SemanticExtraSpecialProperties

# Pull request number, "false" if it's not a pull request
# After the install via composer an additional get fetch is carried out to
# update th repository to make sure that the latests code changes are
# deployed for testing
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
git fetch origin +refs/pull/"$TRAVIS_PULL_REQUEST"/merge:
git checkout -qf FETCH_HEAD
else
git fetch origin "$TRAVIS_BRANCH"
git checkout -qf FETCH_HEAD
fi

cd ../..
fi

composer dump-autoload

## Configure
echo 'wfLoadExtension( "SemanticExtraSpecialProperties" );' >>LocalSettings.php
php maintenance/update.php --quick

0 comments on commit 0b78f42

Please sign in to comment.