Feature #1917
closed
Added by Alexander Watzinger about 3 years ago.
Updated almost 3 years ago.
Description
This issue is for improved tests and mostly about higher code coverage and better performance.
UpdateAs expected it took a while but it was quite worth it. It turned out to be not so much about adding tests but more about refactoring code to be easier to test.
- Uncovered code reduced from 530 to 189 statements which raised "real" coverage from about 94% to 98%
- Faster test: from 250 to 205 seconds on my local machine.
Initial test duration: ~ 250 seconds (Alex local), 9,365 + 530 ignored = 9,895 statements in total
| Tests |
excl |
uncov |
total |
time |
|
| 2022-12-24 |
530 |
0 |
530 |
250 |
Initial |
| 2022-12-25 |
0 |
374 |
374 |
250 |
w/o pragma, 9,881 statements, 96.21% coverage |
| 2022-12-26 |
31 |
287 |
318 |
246 |
Mail |
| 2022-12-26 |
36 |
257 |
293 |
245 |
Import |
| 2022-12-27 |
47 |
232 |
279 |
250 |
Admin functions |
| 2022-12-28 |
79 |
200 |
279 |
250 |
Pragma for API functions |
| 2022-12-28 |
94 |
182 |
276 |
250 |
Type functions |
| 2022-12-29 |
95 |
169 |
264 |
252 |
views/index.py |
| 2022-12-30 |
117 |
128 |
245 |
254 |
|
| 2023-01-02 |
119 |
122 |
241 |
253 |
|
| 2023-01-03 |
122 |
116 |
238 |
253 |
|
| 2023-01-04 |
121 |
114 |
235 |
253 |
|
| 2023-01-05 |
144 |
91 |
235 |
253 |
(Re)adding coverage ignores |
| 2023-01-06 |
145 |
83 |
228 |
254 |
|
| 2023-01-07 |
158 |
68 |
226 |
254 |
|
| 2023-01-08 |
159 |
63 |
222 |
254 |
|
| 2023-01-09 |
147 |
64 |
211 |
254 |
API display image |
| 2023-01-11 |
138 |
64 |
202 |
254 |
API: display image, subunits |
| 2023-01-17 |
142 |
66 |
208 |
254 |
With radiocarbon dating |
| 2023-01-18 |
154 |
42 |
196 |
260 |
|
| 2023-01-19 |
158 |
22 |
180 |
260 |
|
| 2023-01-20 |
174 |
0 |
174 |
265 |
|
| 2023-01-21 |
174 |
0 |
174 |
260 |
Clean up tests |
| 2023-01-22 |
174 |
0 |
174 |
255 |
Clean up tests |
| 2023-01-23 |
174 |
0 |
174 |
250 |
Clean up tests |
| 2023-01-24 |
174 |
0 |
174 |
240 |
Clean up tests |
| 2023-01-26 |
179 |
0 |
179 |
225 |
Clean up tests |
| 2023-01-27 |
189 |
0 |
189 |
215 |
Clean up tests, after adding ARCHE import |
| 2023-01-28 |
189 |
0 |
189 |
205 |
Clean up tests |
- Estimated time set to 16.00 h
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Target version changed from 7.9.0 to 7.10.0
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
As expected it took a while but coverage is now back at 100% (in the develop branch) with 174 statements ignored with the "pragma: no cover" comment.
So "real" coverage raised from 94% to 98%. As it turned out it was not so much about adding tests but more about refactoring to make code easier to test.
Next part of this issue will be cleaning up tests and try to make them faster. Although they only take a few minutes (265 seconds on my local machine) which is not bad for the complex code and high coverage, faster is always better because it means they will be run more often and less time is wasted waiting for results.
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Description updated (diff)
- Status changed from In Progress to Closed
Also available in: Atom
PDF