Skip to content

Commit 70b2432

Browse files
authored
Merge pull request #1245 from metacpan/oalders/more-test-jobs
A large CircleCI VM can able to handle 4 test jobs
2 parents fb88dbe + fb035bb commit 70b2432

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

.circleci/config.yml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# Use the latest 2.1 version of CircleCI pipeline process engine. See:
33
# https://circleci.com/docs/2.0/configuration-reference
44
version: 2.1
5+
orbs:
6+
codecov: codecov/[email protected]
57
# Orchestrate or schedule a set of jobs
68
workflows:
79
docker-compose:
@@ -38,42 +40,34 @@ jobs:
3840
./bin/metacpan-docker init
3941
docker-compose --verbose up -d api_test
4042
name: compose up
43+
- run:
44+
command: |
45+
pushd metacpan-docker
46+
docker-compose exec -T api_test cpm install -g Devel::Cover
47+
name: install Devel::Cover
4148
# Since we're running docker-compose -d, we don't actually know if
4249
# Elasticsearch is available at the time this build step begins. We
4350
# probably need to wait for it here, so we'll add our own check.
4451
- run:
4552
command: |
4653
pushd metacpan-docker
47-
./src/metacpan-api/wait-for-es.sh http://localhost:9200 elasticsearch_test --
54+
./src/metacpan-api/wait-for-es.sh http://localhost:9200 elasticsearch_test
4855
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.
5756
- run:
5857
command: |
5958
pushd metacpan-docker
60-
docker-compose exec -T api_test cpm install -g Devel::Cover
61-
name: install Devel::Cover
62-
- run:
63-
command: |
64-
pushd metacpan-docker
65-
docker-compose exec -T api_test env HARNESS_PERL_SWITCHES="-MDevel::Cover=+ignore,^t/|^test-data/|^etc/" prove -lr --jobs 2 t
59+
docker-compose exec -T api_test env HARNESS_PERL_SWITCHES="-MDevel::Cover=+ignore,^t/|^test-data/|^etc/" prove -lr --jobs 4 t
6660
name: run tests with coverage
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.
61+
# We are relying on environment variables from the host to be available when
62+
# we publish the report, so we publish from the host rather than trying
63+
# to propagate env variables to the container.
6964
- run:
7065
command: |
71-
pushd metacpan-docker/src/metacpan-api
72-
sudo apt install cpanminus
73-
sudo cpanm --notest Devel::Cover Devel::Cover::Report::Codecov Devel::Cover::Report::Codecovbash
74-
sudo chown -R circleci.circleci cover_db
75-
cover -report codecov
76-
name: upload coverage report
66+
pushd metacpan-docker
67+
docker-compose exec -T api_test cover -report json
68+
name: create coverage report
69+
- codecov/upload:
70+
file: metacpan-docker/src/metacpan-api/cover_db/cover.json
7771
- run:
7872
command: |
7973
pushd metacpan-docker

0 commit comments

Comments
 (0)