Project

General

Profile

Actions

Feature #1917

closed

Improved tests

Added by Alexander Watzinger about 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Backend
Target version:
Start date:
2022-12-24
Estimated time:
16.00 h

Description

This issue is for improved tests and mostly about higher code coverage and better performance.

Update
As 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
Actions #1

Updated by Alexander Watzinger about 2 years ago

  • Estimated time set to 16.00 h
Actions #2

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #3

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #4

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #5

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #6

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #7

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #8

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #9

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #10

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #11

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #12

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #13

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #14

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #15

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #16

Updated by Alexander Watzinger about 2 years ago

  • Description updated (diff)
Actions #17

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #18

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #19

Updated by Alexander Watzinger almost 2 years ago

  • Target version changed from 7.9.0 to 7.10.0
Actions #20

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #21

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #22

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #23

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #24

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #25

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #26

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #27

Updated by Bernhard Koschiček-Krombholz almost 2 years ago

  • Description updated (diff)
Actions #28

Updated by Bernhard Koschiček-Krombholz almost 2 years ago

  • Description updated (diff)
Actions #29

Updated by Bernhard Koschiček-Krombholz almost 2 years ago

  • Description updated (diff)
Actions #30

Updated by Bernhard Koschiček-Krombholz almost 2 years ago

  • Description updated (diff)
Actions #31

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #32

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #33

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #34

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #35

Updated by Alexander Watzinger almost 2 years ago

  • 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.

Actions #36

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #37

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #38

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #39

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #40

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #41

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #42

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #43

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #44

Updated by Alexander Watzinger almost 2 years ago

  • Description updated (diff)
Actions #45

Updated by Alexander Watzinger almost 2 years ago

  • Status changed from In Progress to Closed
Actions

Also available in: Atom PDF