Skip to content

Commit 74eb5a4

Browse files
committed
Don't build coverage report twice
1 parent 0e2cb0e commit 74eb5a4

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.circleci/config.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,26 @@ jobs:
4646
pushd metacpan-docker
4747
./src/metacpan-api/wait-for-es.sh http://localhost:9200 elasticsearch_test --
4848
name: wait for ES
49+
# We are running coverage inside the container, but creating the report
50+
# from outside of the container, so Devel::Cover is installed twice. We
51+
# are relying on environment variables from the host to be available when
52+
# we publish the report, so we publish from the host rather than trying
53+
# to propagate env variables to the container. There is a CircleCI orb
54+
# that can publish the report for us, but it is hard to debug. I had to
55+
# set up the following config in order to debug the orb, so we may as
56+
# well keep it around for now.
4957
- run:
5058
command: |
5159
pushd metacpan-docker
52-
docker-compose exec -T api_test cpm install -g Devel::Cover Devel::Cover::Report::Codecov Devel::Cover::Report::Codecovbash
60+
docker-compose exec -T api_test cpm install -g Devel::Cover
5361
name: install Devel::Cover
5462
- run:
5563
command: |
5664
pushd metacpan-docker
5765
docker-compose exec -T api_test env HARNESS_PERL_SWITCHES="-MDevel::Cover=+ignore,^t/|^test-data/|^etc/" prove -lr --jobs 2 t
5866
name: run tests with coverage
59-
- run:
60-
command: |
61-
pushd metacpan-docker
62-
docker-compose exec -T api_test cover
63-
name: generate coverage report
67+
# The report ends up being owned by root. We need to chown it so that
68+
# the cover command can make changes to it.
6469
- run:
6570
command: |
6671
pushd metacpan-docker/src/metacpan-api

0 commit comments

Comments
 (0)