Travis-ci. It's a cloud continuous integration service that runs all the tests in the t/directory under the Perl module directory every time you push the code to perform a functional test of the code. This test will automatically create a virtual machine and can test different versions of Perl. If you pass it will show Green, not through will show red, very convenient.
Configuration of DSL mode
To use this feature, simply add a ". Travis.yml" configuration file to the Perl module on your Github, which automatically monitors the changes in your Github code and automatically submits the test.
Like the usual Perl configuration tests like the following content
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 |
First, use the language above to specify the language of your project. Then specify the Perl version you need to test. You can write down what modules you need to install before testing.
Github and Travis CI integration
The above configuration file configuration, put into the directory of your Git project, you need to go through the GitHub account, to Https://travis-ci.org's website to open the test function of your project. After entering, point "Travis CI for Private repositories", the following surface will appear. will be able to see you on the GitHub project, and then choose to open ... Note that you must have the file mentioned above in your project.
After that, each time you submit your code to GitHub, the tool automatically creates a clean virtual machine and then automates the test with the Perl version you specify.
Test process and result queries
You can write notifications to inform you of the test results, and you can also go to https://travis-ci.com/'s website to view detailed test results, as shown below, if red indicates failure, you can see the details of the failure and the process of testing.
Coverage of test code
According to Fayland's guidance ... And found a funny thing. For example, we are in the above ". Travis.yml" configuration file, add the following content
The code is 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 part is to join the Cover-test-report coveralls. Because it requires the support of the Devel::cover::report::coveralls module, the above lets first install this.
Then go to the Https://coveralls.io and this will send the cover data to that website.
Then you can add badges to the GitHub page. To show the code coverage