# Tests fail on CI, pass locally

**URL:** <https://discourse.julialang.org/t/tests-fail-on-ci-pass-locally/125140>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 23, 2025, 5:52pm UTC](https://discourse.julialang.org/t/tests-fail-on-ci-pass-locally/125140 "2025-01-23T17:52:35Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [January 31, 2025, 2:44pm UTC](https://discourse.julialang.org/t/tests-fail-on-ci-pass-locally/125140/12 "2025-01-31T14:44:26Z")

</div>

> [@lmiq](#):
>
> coverage and actual unit testing should not be part of the same CI run

Copying my answer from the Github issue:

> Is there a workaround? Some way to get the coverage report but in parallel run CI tests with the same compiler options that we use for production? (and thus, the ones which we test locally)

FixedSizeArrays works around this issue by splitting CI into coverage-enabled and coverage-disabled jobs. CI informs the test suite that “the build is a production build” when coverage is disabled, thus enabling the no-allocation tests:

The test suite needs to parse the environment variable:

> <https://github.com/JuliaArrays/FixedSizeArrays.jl/blob/d17373edf4144a672cd80a062bf24d017f01e42f/test/runtests.jl#L6-L17>

The CI is configured like so:

> <https://github.com/JuliaArrays/FixedSizeArrays.jl/blob/d17373edf4144a672cd80a062bf24d017f01e42f/.github/workflows/UnitTests.yml#L16-L77>

Perhaps it’d be good if a Github Action was available to make this easier.

---

_[View the full topic](https://discourse.julialang.org/t/tests-fail-on-ci-pass-locally/125140)._
