New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow some configuration to decide what to cover #194

Open
mauricioszabo opened this Issue Sep 13, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@mauricioszabo
Copy link

mauricioszabo commented Sep 13, 2017

I'm using cloverage in a project together with prismatic-schemas. I need to ignore some specific functions in coverage support, otherwise my % Forms degrades a lot with lots of false positives. The reason lies in the way schemas work:

When I'm developing my apps, I need to be sure that I'm parsing JSON messages correctly - sanitizing functions, checking if a map is missing a required key, and so on.

So, to test my code, I'm using s/defn - it defines a function that will check if their parameters, and its return, matches the specific schema that you said. This kind of checking is done only on test-time - in production, we disable schemas. The reason is performance, and the fact that we're checking schemas as a kind of "sanity-check" to see if we're at least passing the right "types" or "maps" to functions.

Now, the problem is that cloverage things that our s/def line - which is exactly a function definition - is not fully covered. In my code, it says: 72 of 138 forms covered, which is way too much and degrades my coverage by a lot. The problem is that forms that are not covered are mostly tests that we'll never have in production, like "when schema does not match, throws exception". This will never happen - when a schema is wrong, we need sanitize it before calling the function...

So, I need a way to just say "ignore this form, move on to the next one", otherwise every function definition will mislead my function coverage...

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