P
P
Pavel Gogolinsky2016-05-26 09:03:33
Yii
Pavel Gogolinsky, 2016-05-26 09:03:33

Why doesn't code coverage affect all project files?

Project on yii2. I run the tests like this
codecept run unit --coverage-html
. As a result, only those files that participated in the tests get into the code coverage. At the same time, most of the files are not covered by tests. The report shows that the coverage is almost perfect
cebd11e9697f4b028a4cd6332e0fb3b7.png
. Here are the coverage settings

coverage:
    enabled: true
    white_list:
        include:
            - ../modules/*
            - ../controllers/*
            - ../commands/*
            - ../mail/*
    blacklist:
        include:
            - ../assets/*
            - ../config/*
            - ../runtime/*
            - ../vendor/*
            - ../views/*
            - ../web/*
            - ../tests/*

Why are files not shown in the report that are not covered by tests at all?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Gogolinsky, 2016-05-28
@gogolinsky

A typo in the word white_list. Need a whitelist

D
Dmitry Entelis, 2016-05-26
@DmitriyEntelis

Optionally, all whitelisted files can be added to the code coverage report by setting addUncoveredFilesFromWhitelist="true" in your PHPUnit configuration

https://phpunit.de/manual/current/en/code-coverage...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question