11 Apr 2015 14:42:53 UTC
- Distribution: Dist-Zilla-TravisCI
- Module version: 1.15
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (13)
- Testers (1462 / 33 / 75)
- KwaliteeBus factor: 0
- 10.88% Coverage
- License: artistic_2
- Perl: v5.10.1
- Activity24 month
- Download (48.37KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version++ed by:1 non-PAUSE userBBYRD Brendan Byrd
- Reverse dependencies
- CPAN Testers List
- Dependency graph
- COPYRIGHT AND LICENSE
Dist::Zilla::Plugin::Travis::TestRelease - makes sure repo passes Travis tests before release
;;; Test DZIL [Travis::TestRelease] ; defaults typically work fine ;;; Test DZIL+build [TravisYML] support_builddir = 1 ; (optional) only test with Travis::TestRelease dzil_branch = /^release_testing\/.*/ [Travis::TestRelease] create_builddir = 1
Tired of releasing a module only to discover that it failed Travis tests? This plugin solves that problem.
It pushes a release testing branch to Travis, monitors the testing, and aborts the release if the Travis build fails. It also supports testing the non-DZIL build directory directly.
TravisYML is not required to use this plugin, even for build testing, but is still recommended.
Starting the process requires creating and pushing a release testing branch to GitHub. This is done through a series of git commands, designed to work with the dirtiest of branch states:
If there are any "dirty files", even untracked files, put them into a git stash.
Create or hard reset the release testing branch to match the main branch.
Apply the stash (if created) and add any new files.
If a build directory is requested, extract it into .build/testing, and add it.
Commit the changes.
Force push the testing branch to the repo.
Switch back to the main branch.
If any files were stashed, apply it back to the branch. This is done by hard resetting the main branch to the stash (don't panic; it's just a copy of the branch with a few extra commits), and then walking the index back to the refhash it was at originally.
As you may notice, the testing branch is subject to harsh and overwriting changes, so don't rely on the branch for anything except release testing!
After the branch is pushed, the plugin checks Travis (via API) to make sure it starts testing. Monitoring stops when Travis says the build is finished. Use of Travis' Fast Finish option is recommended to speed up test results.
Name of the remote repo.
The default is
Name of the local release testing branch. Do not use this branch for anything except release testing!
The default is
Name of the remote branch.
The default is whatever the
branchoption is set to.
Name of the "slug", or username/repo combo, that will be used to query the test details. For example, this distro has a slug of
The default is auto-detection of the slug using the remote URL.
Boolean; determines whether to create a build directory or not. If turned on, the plugin will create a
.build/testingdirectory in the testing branch to be used for build testing. Whether this is actually used depends on the
.travis.ymlfile. For example, TravisYML's
support_builddirswitch will create a Travis matrix in the YAML file to test both DZIL and build directories on the same git branch. If you're not using that plugin, you should at least implement something similar to make use of dual DZIL+build tests.
Default is off.
Boolean; determines whether to automatically open the Travis CI build status URL to a browser, using Browser::Open.
Default is off.
Plugin order is important. Since Travis build testing takes several minutes, this should be one of the last
before_releaseplugins in your dist.ini, after plugins like TestRelease, but still just before ConfirmRelease.
The amount of git magic and little used switches required to make and push the branch to GitHub may be considered questionable by some, especially force pushes and hard resets. But it is all required to make sure testing occurs from any sort of branch state. And it works.
Furthermore, it's not the job of this plugin to make sure the branch state is clean. Use plugins like Git::Check for that.
The project homepage is https://github.com/SineSwiper/Dist-Zilla-TravisCI.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit http://www.perl.com/CPAN/ to find a CPAN site near you, or see https://metacpan.org/module/Dist::Zilla::TravisCI/.
Brendan Byrd <firstname.lastname@example.org>
This software is Copyright (c) 2015 by Brendan Byrd.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
Module Install Instructions
To install Dist::Zilla::Role::TravisYML, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Dist::Zilla::Role::TravisYML
For more information on module installation, please visit the detailed CPAN module installation guide.