Skip to content

code coverage #108

Description

@fchastanet

add code coverage https://github.com/SimonKagstrom/kcov

  • upload code coverage to deepsource using github action

  • coverage Implement test coverage via kcov in our CI bats-core/bats-core#15

    • bats has to be in PATH
    • kcov needs sudo apt install libdw-dev
    • from src dir
      • usr/local/bin/kcov --collect-only --exclude-path=/tmp $PWD/logs/coverage
        bats -r src/Options/generateCommand.bats -j 30
      • usr/local/bin/kcov --collect-only
        --include-path=$(pwd)/src --exclude-pattern=/testsData/ --exclude-path=/tmp --exclude-path=$PWD/vendor
        $PWD/logs/coverage bats -r src -j 30
      • coverage is in logs/coverage/bats/coverage.json
    • if some test has to be excluded
      • add # bats test_tags=no-kcov before the test
    • github https://github.com/bats-core/bats-core/pull/718/files
    • integrate with https://coveralls.io/
    • to integrate coverage of all files even those not tested, I should generate
      a bats file that source all the src files of the framework.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions