gpt4 book ai didi

perl - 通过 Travis CI 使用 perl-helpers 时如何强制 Devel::Cover 忽略文件夹

转载 作者:行者123 更新时间:2023-12-01 01:51:17 27 4
gpt4 key购买 nike

MetaCPAN Travis CI 覆盖构建非常缓慢。见 https://travis-ci.org/metacpan/metacpan-web/builds/238884497这可能部分是因为我们没有成功忽略 /localCarton 创建的文件夹作为我们构建的一部分。见 https://coveralls.io/builds/11809290

我们正在使用 perl-helpers帮助我们进行 Travis 配置。我想我应该可以使用 DEVEL_COVER_OPTIONS环境变量来解决这个问题,但我想我没有正确的咒语。我在下面包含了整个配置,因为一些脱离上下文的片段似乎具有误导性。

language: perl
perl:
- "5.22"

matrix:
fast_finish: true
allow_failures:
- env: COVERAGE=1 USE_CPANFILE_SNAPSHOT=true
- env: USE_CPANFILE_SNAPSHOT=false HARNESS_VERBOSE=1
env:
global:
# Carton --deployment only works on the same version of perl
# that the snapshot was built from.
- DEPLOYMENT_PERL_VERSION=5.22
- DEVEL_COVER_OPTIONS="-ignore ^local/"
matrix:

# Get one passing run with coverage and one passing run with Test::Vars
# checks. If run together they more than double the build time.
- COVERAGE=1 USE_CPANFILE_SNAPSHOT=true
- USE_CPANFILE_SNAPSHOT=false HARNESS_VERBOSE=1
- USE_CPANFILE_SNAPSHOT=true

before_install:
- git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers
- source ~/travis-perl-helpers/init

- npm install -g less js-beautify
# Pre-install from backpan to avoid upgrade breakage.
- cpanm -n http://cpan.metacpan.org/authors/id/M/ML/MLEHMANN/common-sense-3.6.tar.gz
- cpanm -n App::cpm Carton

install:
- cpan-install --coverage # installs converage prereqs, if enabled
- 'cpm install `test "${USE_CPANFILE_SNAPSHOT}" = "false" && echo " --resolver metadb" || echo " --resolver snapshot"`'

before_script:
- coverage-setup

script:
# Devel::Cover isn't in the cpanfile
# but if it's installed into the global dirs this should work.
- carton exec prove -lr -j$(test-jobs) t

after_success:
- coverage-report

notifications:
email:
recipients:
- olaf@seekrit.com
on_success: change
on_failure: always
irc: "irc.perl.org#metacpan-travis"

# Use newer travis infrastructure.
sudo: false
cache:
directories:
- local

最佳答案

命令行上 Devel::Cover 选项的语法很奇怪。你需要把东西用逗号分隔。至少当您使用 PERL5OPT 时.

DEVEL_COVER_OPTIONS="-ignore,^local/"

参见例如 https://github.com/simbabque/AWS-S3/blob/master/.travis.yml#L26 ,这里有很多带逗号的东西。

PERL5OPT=-MDevel::Cover=-ignore,"t/",+ignore,"prove",-coverage,statement,branch,condition,path,subroutine prove -lrs t

关于perl - 通过 Travis CI 使用 perl-helpers 时如何强制 Devel::Cover 忽略文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44376501/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com