← index #7455PR #17538
Related · high · value 3.137
QUERY · ISSUE

Set threshold for Coveralls failure

openby dlechopened 2021-06-24updated 2025-11-06
proposed-close

Since MicroPython coverage tests have non-deterministic behavior, many lines of code are executed a different number of times in each CI run. Coveralls takes this number into account when calculating the coverage, so often we get "failures" due to variance between runs even though nothing actually changed. Coveralls provides a threshold setting for what constitutes failure. This could be set (or increased if it is already set) to reduce the number of nuisance "failures".

image

CANDIDATE · PULL REQUEST

Coverage test sys.settrace & improve coverage

closedby jepleropened 2025-06-20updated 2025-07-05
port-unix

Summary

I noticed that py/profile.c was not covered at all according to codecov, due to the fact it was never enabled in the unix port.

I enabled it, and then added a new test to cover some previously un-covered lines.

Testing

I ran the tests locally and reviewed the coverage of profile.c.

Note: I suspect one or more Windows x64 builds will fail due to improved coverage in this PR, exposing a latent problem.

I wrote a rambling post in the discussions area about passing qstrs to mp_printf. The TL;DR explanation is, there appears to be undefined behavior that occurs when a "small qstr" (uint16_t) argument such as type->name is printed via the %q format specifier, which retrieves a ssize_t value. The specific behavior I saw with x64 msvc on godbolt looked like it would trigger on one specific format string in the core, the repr of frame objects. That's what spurred me to ensure that this code was covered.

If the failure does occur, I'll try to write it up properly as an issue.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied