How to TRAVIS-CI Automated test tools in GitHub
Travis-ci. It's a continuous cloud integration service that runs all of the tests in the t/directory under the Perl module directory every time you push a code submission with a functional test of the code. This test automatically creates a virtual machine and can test different versions of Perl. If the pass will show the green, the non-pass will show red, very convenient.
Configuration of DSL mode
To use this feature, simply add a ". Travis.yml" Profile to the Perl module on your github, which automatically monitors the changes to the code on your github and automatically submits the test.
Like the common Perl configuration test like the following
The code is as follows |
|
Language:perl Perl: -"5.20" -"5.18" -"5.16" -"5.14" -"5.12" -"5.10" Env: -"Harness_options=j9 test_pod=1 test_ev=1 test_ipv6=1 test_socks=1 Test_tls=1" Install -"cpanm-n test::P od test::P od::coverage EV io::socket::ip io::socket::socks Io::socket::ssl" -"Cpanm-n--installdeps." Notifications: Email:false |
Specify the language of your project first through the language above. Next, specify the Perl version you need to test. You can write what modules you need to install before testing.
Github and Travis CI integration
The above configuration file configuration, put into your git project directory, you need to go through the GitHub account, to https://travis-ci.org website to open your test function of this project. After entering, click "Travis CI for Private repositories", the following surface appears. will be able to see your project on GitHub and then select Open ... Note that you must have the above mentioned documents in your project.
Once this is done, each time you submit your code to GitHub, the tool will automatically create a clean virtual machine, and then automate the test with the Perl version you specify.
Test process and result query
You can write notifications to inform you of the test results, in addition you can go to https://travis-ci.com/'s website to see the results of detailed tests, as shown below, if the red indicates failure, you can see the details of the failure of the reason and the test process.
Test the coverage of your code
According to the guidance of Fayland ... And found a funny thing. For example, we are in the above ". Travis.yml" configuration file, add the following content
code as follows |
|
before_install: -" Cpanm mojo::useragent " -" Cpanm test::more " -" cpanm devel::cover::report::coveralls " Script: Perl makefile.pl && make test && cover-test-report coveralls |
The main is to join the Cover-test-report coveralls this part. Because it requires the support of the Devel::cover::report::coveralls module, let its first install this.
Then go to Https://coveralls.io to open, this will send cover data to that website.
You can then add badges to the GitHub page. To show the coverage of the Code
http://www.bkjia.com/PHPjc/898887.html www.bkjia.com true http://www.bkjia.com/PHPjc/898887.html techarticle the method of automatic test tool travis-ci in GitHub is travis-ci. It's a continuous cloud integration service that will function as code when you submit code for each push.