# Setting up testing and code coverage on Travis

**URL:** <https://discourse.julialang.org/t/setting-up-testing-and-code-coverage-on-travis/44241>\
**Category:** New to Julia\
**Created:** [August 4, 2020, 9:48am UTC](https://discourse.julialang.org/t/setting-up-testing-and-code-coverage-on-travis/44241 "2020-08-04T09:48:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lgo/32/48751_2.png) [@lgo](https://discourse.julialang.org/u/lgo)\
**Post date:** [August 4, 2020, 9:48am UTC](https://discourse.julialang.org/t/setting-up-testing-and-code-coverage-on-travis/44241/1 "2020-08-04T09:48:45Z")

</div>

I’ve already got my project on Travis to create the documentation and I wanted to add testing and the corresponding information on code coverage. I’ve added the corresponding testing script and was able to run it locally. I’ve also adjusted my .travis.yml and signed up on codecov. However, if I run my package on Travis now, nothing has changed and no testing appears in the log.

Here are the links to my repository and the travis log:

[https://github.com/leonardgoeke/AnyMOD.jl/tree/dev](https://github.com/leonardgoeke/AnyMOD.jl/tree/dev)  
[https://api.travis-ci.org/v3/job/714747737/log.txt](https://api.travis-ci.org/v3/job/714747737/log.txt)

---

<div class="post-metadata">

**Author:** ![wookyoung](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wookyoung/32/157_2.png) [@wookyoung](https://discourse.julialang.org/u/wookyoung)\
**Post date:** [August 4, 2020, 10:17am UTC](https://discourse.julialang.org/t/setting-up-testing-and-code-coverage-on-travis/44241/2 "2020-08-04T10:17:22Z")

</div>

try `Pkg.test()` in your `.travis.yml`

```julia
script:
    - julia --project=. -e 'using Pkg; Pkg.test(coverage=true)'

```

---

<div class="post-metadata">

**Author:** ![lgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lgo/32/48751_2.png) [@lgo](https://discourse.julialang.org/u/lgo)\
**Post date:** [August 4, 2020, 11:14am UTC](https://discourse.julialang.org/t/setting-up-testing-and-code-coverage-on-travis/44241/3 "2020-08-04T11:14:25Z")

</div>

Thanks. I tried that, but it did not have an impact. Here is a link to the corrected yaml file:

[https://github.com/leonardgoeke/AnyMOD.jl/blob/dev/.travis.yml](https://github.com/leonardgoeke/AnyMOD.jl/blob/dev/.travis.yml)

---

<div class="post-metadata">

**Author:** ![lgo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lgo/32/48751_2.png) [@lgo](https://discourse.julialang.org/u/lgo)\
**Post date:** [August 4, 2020, 6:16pm UTC](https://discourse.julialang.org/t/setting-up-testing-and-code-coverage-on-travis/44241/4 "2020-08-04T18:16:43Z")

</div>

[wookyoung](https://discourse.julialang.org/u/wookyoung) pull request [here](https://github.com/leonardgoeke/AnyMOD.jl/pull/19) fixed the problem!

---

<div class="post-metadata">

**Author:** ![anon37204545](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon37204545](https://discourse.julialang.org/u/anon37204545)\
**Post date:** [August 4, 2020, 9:41pm UTC](https://discourse.julialang.org/t/setting-up-testing-and-code-coverage-on-travis/44241/5 "2020-08-04T21:41:14Z")

</div>

You might be interested in using [GitHub - invenia/PkgTemplates.jl: Create new Julia packages, the easy way](https://github.com/invenia/PkgTemplates.jl), which sets all this up for you automatically.
