Your Continuous Testing Server

Overview

Sismo: Your Continuous Testing Server

Sismo is a Continuous Testing Server written in PHP.

Unlike more "advanced" Continuous Integration Servers (like Jenkins), Sismo does not try to do more than getting your code, running your tests, and send you notifications.

What makes Sismo special?

Sismo has been optimized to run locally on your computer for your Git projects. Even if it can test remote repositories, Sismo is better used as a local post-commit hook. Whenever you commit changes locally, Sismo runs the tests and give you immediate feedback before you actually push your modifications to the remote repository. So, Sismo is a nice complement to your Continuous Integration Server.

Sismo is language and tool agnostic. Just give it a command that knows how to run your tests and returns a non-zero exit code when tests do not pass.

Sounds good? There is more. Sismo is insanely easy to install (there is only one PHP file to download), easy to configure, and it comes with a gorgeous web interface.

http://sismo.sensiolabs.org/images/sismo-home.png

Installation

Installing Sismo is as easy as downloading the sismo.php file and put it somewhere under your web root directory. That's it, the CLI tool and the web interface is packed into a single PHP file.

Note that Sismo needs at least PHP 5.3.3 to run.

Configuration

By default, Sismo reads its configuration from ~/.sismo/config.php:

<?php

$projects = array();

// create a Growl notifier (for MacOS X)
$notifier = new Sismo\Notifier\GrowlNotifier('pa$$word');

// create a DBus notifier (for Linux)
//$notifier = new Sismo\Notifier\DBusNotifier();

// create a CrossFinger notifier (notify on failed or recovering build)
//$notifier = new Sismo\Contrib\CrossFingerNotifier($notifier);
// or if you want to chain multiple notifiers
//$notifier = new Sismo\Contrib\CrossFingerNotifier(array($mailNotifier, $myAwesomeNotifier));

// add a local repository hosted on Github
$projects[] = new Sismo\GithubProject('Twig (Local)', '/Users/fabien/Twig', $notifier);

// add a remote Github repository
$projects[] = new Sismo\GithubProject('Twig', 'twigphp/Twig', $notifier);

// add a project with custom settings
$sf2 = new Sismo\Project('Symfony');
$sf2->setRepository('https://github.com/symfony/symfony.git');
$sf2->setBranch('master');
$sf2->setCommand('./vendors.sh; phpunit');
$sf2->setSlug('symfony-local');
$sf2->setUrlPattern('https://github.com/symfony/symfony/commit/%commit%');
$sf2->addNotifier($notifier);
$projects[] = $sf2;

return $projects;

For notifications, you can also use any Cruise Control "tray" software as Sismo also exposes an XML file in the Cruise Control format:

http://path/to/sismo.php/dashboard/cctray.xml

Use CCMenu on Mac, CCTray on Windows, JCCTray on Windows or Linux, or CCMonitor for Firefox.

Using Sismo

Build all configured projects by running the build command:

$ php sismo.php build --verbose

If a build fails, Sismo will send notifications. Use the output command to see the latest build output of a project:

$ php sismo.php output twig

If you have configured Sismo to be accessible from the web interface, you can also check the build outputs there:

http://sismo.sensiolabs.org/images/sismo-project.png

If your web server runs under a different user than the one you use on the CLI, you will need to set some environment variables in your virtual host configuration:

SetEnv SISMO_DATA_PATH "/path/to/sismo/data"
SetEnv SISMO_CONFIG_PATH "/path/to/sismo/config.php"

The build command is quite powerful and has many options. Learn more by appending --help:

$ php sismo.php build --help

To make Sismo run whenever you commit some changes, save this script in your project as .git/hooks/post-commit and make sure it's executable:

#!/bin/sh

nohup php /path/to/sismo.php --quiet --force build symfony-local `git log -1 HEAD --pretty="%H"` &>/dev/null &

symfony-local is the slug of the project. You can also create a post-merge script if you want to run Sismo when you merge branches.

If you are running Sismo (with the single PHP file) with PHP 5.4.0, you can use the Sismo build-in web server:

$ php sismo.php run localhost:9000

And then open the browser and point it to http://localhost:9000/sismo.php

Limitations

Sismo is small and simple and it will stay that way. Sismo will never have the following:

  • a queue (if a project is already being built, newer commits are ignored);
  • a web interface for configuration;
  • metrics support;
  • plugin support;
  • other SCM support;
  • slaves support;
  • built-in authentication.

... and probably the feature you have in mind right now and all the ones you will think of later on ;)

Tips and Recipes

Change the default Location

Set the following environment variables to customize the default locations used by Sismo:

# in a .htaccess or httpd.conf Apache configuration file

SetEnv SISMO_DATA_PATH "/path/to/sismo/data"
SetEnv SISMO_CONFIG_PATH "/path/to/sismo/config.php"

# for the CLI tool

export SISMO_DATA_PATH=/path/to/sismo/data/
export SISMO_CONFIG_PATH=/path/to/sismo/config.php

Tracking multiple Branches

To track multiple branches of a project, just make their names unique and set the branch name:

$projects[] = new Sismo\GithubProject('Twig (master branch)', '/Users/fabien/Twig');

$projects[] = new Sismo\GithubProject('Twig (feat-awesome branch)', '/Users/fabien/Twig@feat-awesome');

Note that Sismo uses the same clone for projects sharing the same repositories URL.

Running Sismo for Remote Repositories

Using Sismo for remote repositories is as simple as adding the Sismo building tool in a crontab entry:

0 12 * * * php /path/to/sismo.php --quiet

For GitHub projects, and other systems that support post-receive URL hooks, you can set up Sismo to build automatically when a new revision is pushed. You need to set an environment variable in your Apache configuration:

# in a .htaccess or httpd.conf Apache configuration file

SetEnv SISMO_BUILD_TOKEN "YOUR_TOKEN"

You can also set an environment variable in your config file (~/.sismo/config.php):

putenv('SISMO_BUILD_TOKEN=YOUR_TOKEN');

Replace YOUR_TOKEN with something more secure, as anyone with this token could use it to trigger builds. Then set your post-receive URL appropriately. For example:

http://path/to/sismo.php/your_project/build/YOUR_TOKEN

History in the Web Interface

The build history for a project in the web interface is different from the project history. It is sorted in the order of the builds so that the latest build output is always at your fingertips.

Adding a Notifier

Sismo comes with the most common notifiers but you can create new ones very easily: extend the SismoNotifierNotifier abstract class and implement the notify() method:

public function notify(Commit $commit)
{
    // do something with the commit
}

The Commit object has many methods that gives you a lot of information about the commit and its build. You can also get general information about the project by calling getProject().

Use Sismo with composer

If a majority of your projects use composer, you can configure Sismo to install dependencies before running phpunit. Add the following code to your config file:

Sismo\Project::setDefaultCommand('if [ -f composer.json ]; then composer install; fi && phpunit');
Comments
  • add static default command to Sismo\Project

    add static default command to Sismo\Project

    This allows to alter the default command for all newly created projects with just one line.

    It's meant to be used in the config.file of Sismo to (for example) change the default options of the phpunit command to run or even change the test suite to run at all.

    Example:

    <?php
    
    $projects = array();
    $notifier = new Sismo\GrowlNotifier('pa$$word');
    
    \Sismo\Project::setDefaultCommand('phpunit --colors --strict');
    
    $projects[] = new Sismo\GithubProject('Twig (Local)', '/Users/fabien/Twig', $notifier);
    $projects[] = new Sismo\GithubProject('Twig', 'fabpot/Twig', $notifier);
    
    return $projects;
    
    opened by havvg 14
  • SSH URL Update

    SSH URL Update

    Hi guys.

    • Small tweak to allow SSH URLS to be added.
    • Accepts GH and non GH SSH URLS
    • Conforms with Sismo's formatting for @branch

    IE: $projects[] = new Sismo\GithubProject('Project Dev Branch', '[email protected]:people/project.git@dev', $notifier); or just as happily $projects[] = new Sismo\GithubProject('Project Dev Branch', '[email protected]:people/project.git', $notifier);

    First PR, please be gentle.

    opened by quantum-x 8
  • Added support for running Sismo with the PHP built-in webserver

    Added support for running Sismo with the PHP built-in webserver

    Hi Fabien,

    I've made a small addition to allow running Sismo through the PHP built-in webserver with a console command.

    Hope that could be useful! Christian.

    opened by theUniC 7
  • Support for repositories accessible via SSH.

    Support for repositories accessible via SSH.

    This commit adds the ability to use repositories accessible via SSH eg [email protected]:username/repo.git. The previous Project class incarnation would split on the '@' symbol which made these repositories inaccessible. I've added an intermediate "HTTPProject" class, which adds the previously expected behaviour when setting a repository via the Project class.

    opened by richsage 7
  • Windows compatibility and Growl notifier compatible Mac/Win

    Windows compatibility and Growl notifier compatible Mac/Win

    Hello,

    Here are my patch that solve the issues related to Windows compatibility and introduces a new Growl notifier compatible MacOS and Windows.

    All explains are available at URL http://php5.laurent-laville.org/sismo/

    I'll close the issue GH-39 related to same contents

    • Laurent
    opened by llaville 5
  • Remote build trigger handler.

    Remote build trigger handler.

    Adds a 'build' URL for each project that can be triggered, for instance, by GitHub's post-receive URL hook system (http://help.github.com/post-receive-hooks/) to build a given project.

    I realise this probably won't be pulled, given that you're keeping Sismo ultra simple, but I thought it might be useful for people using Sismo with GitHub projects, and that even a rejected pull request would help people find a nice way to implement such a system.

    I've included a relevant test, and an updated README.rst for the change also.

    opened by ezzatron 5
  • Better Git post-commit

    Better Git post-commit

    The current Git post-commit script on http://sismo.sensiolabs.org seems to have unnecessary backslashes. In addition the build command doesn't terminate the commit hook immediately and thus hangs the Git commit command. Using --force makes sure the tests are run even when git commit --amend has been used.

    opened by fabian 3
  • Fix git checkout bug :: git checkout returns STDERR instead of STDOUT

    Fix git checkout bug :: git checkout returns STDERR instead of STDOUT

    When building a project stderr is returned by git when it intends stdout. Following command prints to stderr and causes error

    $ git checkout 'origin/master'
        HEAD is now at 43329a9... update MongoRecord
    

    Dumping $process

    // Builder.php::execute() | var_dump($process);
    object(Symfony\Component\Process\Process)#159 (16) {
      ["commandline":"Symfony\Component\Process\Process":private]=>
      string(28) "git checkout 'origin/master'"
      ["cwd":"Symfony\Component\Process\Process":private]=>
      string(36) "/Users/Ryan/.sismo/data/build/ac1276"
      ["env":"Symfony\Component\Process\Process":private]=>
      NULL
      ["stdin":"Symfony\Component\Process\Process":private]=>
      NULL
      ["timeout":"Symfony\Component\Process\Process":private]=>
      int(3600)
      ["options":"Symfony\Component\Process\Process":private]=>
      array(2) {
        ["suppress_errors"]=>
        bool(true)
        ["binary_pipes"]=>
        bool(true)
      }
      ["exitcode":"Symfony\Component\Process\Process":private]=>
      int(0)
      ["processInformation":"Symfony\Component\Process\Process":private]=>
      array(8) {
        ["command"]=>
        string(28) "git checkout 'origin/master'"
        ["pid"]=>
        int(61774)
        ["running"]=>
        bool(false)
        ["signaled"]=>
        bool(false)
        ["stopped"]=>
        bool(false)
        ["exitcode"]=>
        int(0)
        ["termsig"]=>
        int(0)
        ["stopsig"]=>
        int(0)
      }
      ["stdout":"Symfony\Component\Process\Process":private]=>
      string(0) ""
      ["stderr":"Symfony\Component\Process\Process":private]=>
      string(45) "HEAD is now at 43329a9... update MongoRecord
    "
      ["enhanceWindowsCompatibility":"Symfony\Component\Process\Process":private]=>
      bool(true)
      ["pipes":"Symfony\Component\Process\Process":private]=>
      array(0) {
      }
      ["process":"Symfony\Component\Process\Process":private]=>
      resource(23) of type (Unknown)
      ["status":"Symfony\Component\Process\Process":private]=>
      string(10) "terminated"
      ["fileHandles":"Symfony\Component\Process\Process":private]=>
      NULL
      ["readBytes":"Symfony\Component\Process\Process":private]=>
      NULL
    }
    

    Surprisingly adding git checkout -q 'origin/master' will suppress that error yet still return stderr. After browsing the net there are a number of issues where git uses stderr instead of stdout.

    opened by jrschumacher 3
  • Allow project to commit the commands it will use

    Allow project to commit the commands it will use

    This commit allows the tests to be committed rather than generated each time. This is useful to me to define inside the project how the test environment works, mainly for composer and codeception

    opened by RickSeymour 2
  • Updated vendors

    Updated vendors

    I updated vendors. Before that, composer failed

    Your lock file is out of sync with your composer.json, run "composer.phar update" to update dependencies
    Your requirements could not be resolved to an installable set of packages.
    
      Problem 1
        - don't install symfony/class-loader 2.2.x-dev|install symfony/class-loader dev-master
        - Conclusion: don't install symfony/class-loader dev-master
        - Installation request for symfony/class-loader == 2.1.9999999.9999999-dev -> satisfiable by symfony/class-loader 2.1.x-dev, symfony/symfony 2.1.x-dev.
        - Conclusion: don't install symfony/class-loader 2.2.x-dev
        - Can only install one of: symfony/symfony 2.2.x-dev, symfony/symfony 2.1.x-dev.
        - don't install symfony/symfony 2.2.x-dev|don't install symfony/routing 2.1.x-dev
        - don't install symfony/routing 2.1.x-dev|don't install symfony/symfony 2.2.x-dev
        - Installation request for symfony/class-loader == 2.2.9999999.9999999-dev -> satisfiable by symfony/class-loader 2.2.x-dev, symfony/symfony 2.2.x-dev.
        - Installation request for symfony/routing == 2.1.9999999.9999999-dev -> satisfiable by symfony/routing 2.1.x-dev, symfony/symfony 2.1.x-dev.
    

    And I removed symfony/http-foundation from composer.json, already in silex

    opened by lyrixx 2
  • show popup on current logged user display (linux)

    show popup on current logged user display (linux)

    This is useful, because when the process runs as a post-commit hook or on a cron job, the user that runs the command might be not the same as the current user logged in. This allows to set the display as: DISPLAY=:0.0 (or any other display you want), so that the notify-send pop-up shows on the currently logged in user display.

    the user can now define their notifier in their config as: // create a DBus notifier (for Linux) $notifier = new Sismo\DBusNotifier('DISPLAY=:0.0');

    previous comment for reference only:

    the notify-send command did not display the notification for me, when ran by the apache user, since it wasn't being ran by the current user logged in.

    Looked online and found this issue also comes up when running it as a cron job, and it's just a matter of appending DISPLAY=:0 before running the command.

    DISPLAY=:0 just tells the script to launch the popup on the main screen of the current logged in user Here are a couple of solutions pointing to this, that I found, just for reference: http://ubuntuforums.org/showpost.php?p=9604447&postcount=3 http://ubuntuforums.org/showpost.php?p=9608842&postcount=4

    opened by ajessu 2
Owner
null
Free continuous integration platform for GitHub projects.

✋ Do not open new issues here! ✋ Travis CI Travis CI is a hosted continuous integration and deployment system. You can now test and deploy open source

Travis CI 8.3k Jan 3, 2023
PHPCI is a free and open source continuous integration tool specifically designed for PHP.

PHPCI PHPCI is a free and open source (BSD License) continuous integration tool specifically designed for PHP. We've built it with simplicity in mind,

Dan Cryer 2.4k Dec 26, 2022
PHPCI is a free and open source continuous integration tool specifically designed for PHP.

PHPCI PHPCI is a free and open source (BSD License) continuous integration tool specifically designed for PHP. We've built it with simplicity in mind,

Dan Cryer 2.4k Apr 21, 2021
A static site for the Jenkins automation server

jenkins.io This repository is what powers the Jenkins website. This uses Awestruct with Asciidoctor under the hood to provide a very useful and compel

Jenkins Infra 252 Dec 30, 2022
:white_check_mark: JoliCi - Run your TravisCi builds locally

JoliCi JoliCi is a free and open source Continuous Integration Client written in PHP (5.4 minimum) and powered by Docker (please use a recent version)

JoliCode 659 Nov 20, 2022
PHP Censor is an open source self-hosted continuous integration server for PHP projects.

PHP Censor is an open source, self-hosted, continuous integration server for PHP projects (PHPCI fork). Official twitter @php_censor. PHP Censor versi

PHP Censor 660 Dec 28, 2022
Free continuous integration platform for GitHub projects.

✋ Do not open new issues here! ✋ Travis CI Travis CI is a hosted continuous integration and deployment system. You can now test and deploy open source

Travis CI 8.3k Jan 3, 2023
PHPCI is a free and open source continuous integration tool specifically designed for PHP.

PHPCI PHPCI is a free and open source (BSD License) continuous integration tool specifically designed for PHP. We've built it with simplicity in mind,

Dan Cryer 2.4k Dec 26, 2022
PHPCI is a free and open source continuous integration tool specifically designed for PHP.

PHPCI PHPCI is a free and open source (BSD License) continuous integration tool specifically designed for PHP. We've built it with simplicity in mind,

Dan Cryer 2.4k Apr 21, 2021
Mark Rogoyski 2.2k Dec 29, 2022
Continuous Inspection

SonarQube Continuous Inspection SonarQube provides the capability to not only show health of an application but also to highlight issues newly introdu

SonarSource 7.4k Dec 31, 2022
MageCI - [ABADONED] Magento Continuous Integration Tools

Magento Continuous Integration Tools A set of tools to help set up a proper environment for testing magento Installation Installation is very easy tho

EcomDev B.V. 77 Dec 13, 2021
SimpleTest is a framework for unit testing, web site testing and mock objects for PHP

SimpleTest SimpleTest is a framework for unit testing, web site testing and mock objects for PHP. Installation Downloads All downloads are stored on G

SimpleTest 147 Jun 20, 2022
Very simple mock HTTP Server for testing Restful API, running via Docker.

httpdock Very simple mock HTTP Server for testing Restful API, running via Docker. Start Server Starting this server via command: docker run -ti -d -p

Vo Duy Tuan 4 Dec 24, 2021
Testing your OpenApi documentation and your code easily.

Raven - How to test your API documentation and behavior. This library was written to allow testing OpenAPI documentation easily. It also allows verify

CH Studio 30 Dec 6, 2022
Supercharge your app or SDK with a testing library specifically for Guzzle

Full Documentation at guzzler.dev Supercharge your app or SDK with a testing library specifically for Guzzle. Guzzler covers the process of setting up

null 275 Oct 30, 2022
Simple HTTP smoke testing for your Symfony application

Shopsys HTTP Smoke Testing This package enables you to do simple HTTP smoke testing of your Symfony application. Basically, it generates a HTTP reques

Shopsys 65 Feb 3, 2022
A Simplistic Plugin to Implement Server Claims to your Minecraft: Bedrock Server.

Claims This plugin allows administrators to create, edit, list, and teleport to land claims on a PocketMine server. These claims have a variety of cus

Santana 5 Jun 10, 2023
Infrastructure and testing helpers for creating CQRS and event sourced applications.

Broadway Broadway is a project providing infrastructure and testing helpers for creating CQRS and event sourced applications. Broadway tries hard to n

null 1.5k Dec 27, 2022