Recipe "How to turn an idea into a certified SMW extension"

From SMW CindyKate - Main
Component 947747
Jump to: navigation, search



The following instructions have been tested on Ubuntu 16.04 64bit.

Instructions for other platforms are under construction.


The goal is to minimize the effort of turning your great new idea for SMW functionality into a certified extension.

STEP 1: Set up local test environment

For your understanding: local test environment ontology

graph TD rmwsd("Repository #quot;MediaWiki Core Cucumber Step Definitions#quot;<hr> <a href=''>GitHub repository</a> ") --> |"is a submodule to"|mwvf ynb --> |hosts directory|mwvf>"Directory #quot;~/mediawiki-vagrant/#quot;<hr> git clone<br> <a href=''>Vagrantfile</a><br> <a href=''>mw-profiles.yml</a> "] mwvf -->|"is shared into /vagrant<br>launches VM by #quot;vagrant up#quot;<br>ssh's into VM by #quot;vagrant ssh#quot;"|mwvvm aom("Host #quot;Any Other Host#quot;;<hr> serves MediaWiki at port X") ynb("Physical Machine #quot;Your Workstation#quot;<hr>has IP") --> |"hosts VBox VM<br> browses it at localhost:8080<br> serves it at"|mwvvm["VBox VM #quot;MediaWiki Vagrant#quot;"]

Set up VBox VM "MediaWiki Vagrant" on your Ubuntu workstation

Install Git

[email protected]:~$ sudo apt-get install git

Install Virtualbox

Install Vagrant

The following commands install Vagrant 1.8.1 on Ubuntu (note that these commands are conditionally included in below):

[email protected]:~/tmp$ wget
[email protected]:~/tmp$ sudo dpkg -i vagrant_1.8.1_x86_64.deb

Use Case "Install VBox VM "MediaWiki Vagrant""

[email protected]:~$ ./

# This the content of

# Ensure that Vagrant's apt version is installed
if [[ "$(vagrant --version)" == "Vagrant 1.8.1"* ]]; then
    echo "Vagrant 1.8.1 is installed"
    sudo dpkg -i vagrant_1.8.1_x86_64.deb

# Create the core mediawiki-vagrant VM
git clone
cd mediawiki-vagrant
git submodule update --init --recursive
vagrant hiera mediawiki::branch REL1_26
vagrant config nfs_shares off # Note: This is only necessary if you have an encrypted home directory. See
time vagrant up

# Add functionality by enabling roles
vagrant roles enable semanticmediawiki
vagrant roles enable semantictitle
vagrant provision --provision-with puppet

At the end of this process your VBox VM "MediaWiki Vagrant" is ready for the next steps. If you want to log into the VM's XFCE desktop, see below Log into the VM's XFCE desktop.


The following observations and seemingly working solutions are based on my own experiences.

  • If you get a Failed to execute command `vagrant plugin list` (pid 30351 exit 1), then try this:
    1. [email protected]:~/mediawiki-vagrant$ vagrant destroy
    2. [email protected]:~$ mv .vagrant.d .vagrant.d_BACKUP
    3. [email protected]:~/mediawiki-vagrant$ time vagrant up
  • If you get a port forwarding collision, then either:
    • reconfigure port forwarding in the Vagrantfile to some unused host port, or
    • close any other VM using forwarding to host port 8080, or
    • remove VBox VM "MediaWiki Vagrant" and close and then reopen Virtualbox.
  • If vagrant up
    • fails saying The SSH command responded with a non-zero exit status. or
    • hangs at /Stage[main]/Mediawiki/Git::Clone[mediawiki/core]/File[/vagrant/mediawiki]/ensure: created, then try this:
    1. [email protected]:~/mediawiki-vagrant/mediawiki$ git pull origin master
    2. [email protected]:~/mediawiki-vagrant$ vagrant provision

How to access VBox VM "MediaWiki Vagrant"

Log into the VM (SSH or "shell access")

[email protected]:~/mediawiki-vagrant$ vagrant ssh

Mediawiki vagrant vagrant ssh.png

Browse devwiki from your workstation (host)


Mediawiki vagrant main page.png

Log into the VM's XFCE desktop

  1. Upon a fresh set up only, run [email protected]:~/mediawiki-vagrant$ vagrant halt && vagrant up.
  2. Doubleclick the running machine in the Oracle VM VirtualBox Manager.
  3. Log in with username vagrant and password vagrant.
  4. For the time being DO NOT UPGRADE FIREFOX! due to

The desktop environment used is Xfce.

Mediawiki vagrant xfce desktop.png

STEP 2: Add your extension, e.g. SMWCindyKate


These instructions are under construction.

[email protected]:
        SomeTest.php     # How do these files have to look like?

STEP 3: Run tests

[email protected]:~$ export MEDIAWIKI_URL=

Run unit tests

[email protected]:~/mediawiki-vagrant$ vagrant ssh

Run MediaWiki core unit tests

[email protected]:~$ ./

Run Semantic MediaWiki core unit tests

[email protected]:~$ ./

Run your extension unit tests, e.g. SMWCindyKate


These instructions are under construction.

Run browser tests

[email protected]:~/mediawiki-vagrant$ vagrant ssh

Run MediaWiki core browser tests

[email protected]:~$ ./

Run extension browser tests, e.g. SMWCindyKate


These instructions are under construction.