leverage the power of a tool or two to get a seamless continuous integration process not much different to the one we’re used to when developing with lower-level frameworks.
integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continuous build increases the productivity.
Ant It offers a standard, declarative way(XML) of writing scripts to handle operations such as packaging, deploying and testing web application. It features a rich set of tasks for dealing with file system operations, SQL executions, code analysis and linting, documentation generation and much, much more.
for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.
and part of the larger xUnit family. Its primary goal is to take the smallest piece of testable software in the application, isolate it from the rest of the code, and determine whether it behaves exactly as you expect.
the form of a story, using a language called Gherkin, that describe the behavior of your application. By writing stories, it is possible to define acceptance criteria that can be actually executed for testing the behavior of a web application.
As an anonymous user I need to be able to see the login form Every feature comes with a name, followed by three lines describing the benefit, the role and the feature itself. This section is required but not important to Behat in terms of execution, it’s just there for reading purposes.
am on “/” Then I should not see the link “register” And I should see the link “login” And I should see the link “forgot password” Every scenario describes how a feature acts under different conditions and it’s composed by three parts: the context, the event and the outcome This is the part that will be transformed into a test.
"(?P<link>[^"]*)"$/ */ public function iShouldNotSeeTheLink($link) { $element = $this->getSession()->getPage(); $result = $element->findLink($link); if ($result) { throw new \Exception(sprintf( "The link '%s' was present on the page %s and was not supposed to be", $link, $this->getSession()->getCurrentUrl() )); } }
• Drush Phing Task, for integrating Drush commands into Phing targets • Drupal Behat extension, needed to leverage the power of Drush into our Behat features • Migrate Module, for importing fixtures and migrating data whenever needed • Features Module, for exporting configuration into code
of files we don’t need • drush make, for keeping track of the modules, themes and libraries to ues • build.xml, for describing all the actions Phing will have to take to build the website • build.ENV.properties, for storing environments variables used during the build process • behat.yml.dist, for storing Behat’s configurations
work is done. • dev, a server where the CI actually happens. It gets rebuilt from scratch and throughly tested every time(ideally after every push on the repository) • stage, a server used to deploy “stable” dev snapshots at a given point in time, usually for letting the client tests on a more stable environment
environment (as faithful as possible), used for easily reproducing bugs happening on production and also to test deploys. • prod, the environment that hosts the final product, tuned and optimized for best performances.
publishes the results Jenkins clones the repository and invokes Phing Phing performs the build of the website, upload the files and the database and finally launches the tests PHPUnit and Behat run the tests and log the results in JUnit format