Skip to content

chore/increase offline tests coverage #33

Open
alanpeixinho wants to merge 7 commits into
kernelci:mainfrom
alanpeixinho:chore/offline-tests
Open

chore/increase offline tests coverage #33
alanpeixinho wants to merge 7 commits into
kernelci:mainfrom
alanpeixinho:chore/offline-tests

Conversation

@alanpeixinho

@alanpeixinho alanpeixinho commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Increase coverage test on offline testing.
testing_offline has gone from 61% to 69% total coverage.

We are now including:

  • mail/web exporting check.
  • deletion check.
Name Stmts Miss Cover
----------------------------------------------------------------   
regzbot/__init__.py 2022 461 77%
regzbot/_rbcmd.py 366 44 88%
regzbot/_repsources/_bugzilla.py 332 276 17%
regzbot/_repsources/_generic.py 23 0 100%
regzbot/_repsources/_github.py 303 244 19%
regzbot/_repsources/_gitlab.py 309 251 19%
regzbot/_repsources/_lore.py 409 132 68%
regzbot/_repsources/_trackers.py 77 55 29%
regzbot/commandl.py 86 11 87%
regzbot/export_csv.py 93 2 98%
regzbot/export_mail.py 345 42 88%
regzbot/export_web.py 720 40 94%
----------------------------------------------------------------   
TOTAL 5085 1558 69%

The _repsources/*.py files should be more effectively covered by testing_trackers.py.

How to run

Execute tests

PYTHONPATH=. coverage run regzbot/commandl.py test --offline

Compile report

coverage report

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
@alanpeixinho alanpeixinho changed the title chore/offline tests [WIP] chore/offline tests Jun 26, 2026
@alanpeixinho alanpeixinho force-pushed the chore/offline-tests branch 3 times, most recently from 86af228 to a7800c5 Compare June 30, 2026 21:38
@alanpeixinho alanpeixinho marked this pull request as ready for review July 1, 2026 18:28
@alanpeixinho alanpeixinho changed the title [WIP] chore/offline tests chore/increase offline tests coverage Jul 1, 2026
@alanpeixinho alanpeixinho requested a review from knurd July 6, 2026 20:08
@tales-aparecida

tales-aparecida commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

I think db_ensure_cursor needs its own commit.

Edit: _web_days_delta as well

Edit2: I think you need to break the second commit in more parts. It's very unclear what is dead code being removed and what is changing

@tales-aparecida

Copy link
Copy Markdown
Collaborator

testdata/expected/results-offline.csv was already kind of big and you've 4x it, into 12k lines (1.3MB). Any way to break it into smaller files? If not in this MR, at least a plan on how we could achieve that

@tales-aparecida tales-aparecida left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many changes in a single commit

Replace repeated dbcursor None-checks with a shared helper.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Drop dead get_by_link/dupof/update_author/parse_link paths that no
callers use anymore.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Use injectable _web_now so offline tests can freeze web page timestamps.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Extract prepare/publish helpers, injectable mail clock, and non-interactive
compile path used by offline tests.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Extract prepare/publish/build_compilation and dumpall_web so offline tests
can assert web output without writing pages alone.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Record mail and web exporter dumps in results-offline.csv and add a delete
regression exercise.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
@alanpeixinho

Copy link
Copy Markdown
Contributor Author

testdata/expected/results-offline.csv was already kind of big and you've 4x it, into 12k lines (1.3MB). Any way to break it into smaller files? If not in this MR, at least a plan on how we could achieve that

I have considered that.
The main problem here is, in the current implementation the file diff between expected and result is used as a strategy to analyze differences.
Breaking into per test files might help reducing the big file problem, but I am not sure this is a good solution here.
Do you have any suggestions?

@alanpeixinho alanpeixinho force-pushed the chore/offline-tests branch from a7800c5 to b693997 Compare July 14, 2026 14:26
@alanpeixinho

Copy link
Copy Markdown
Contributor Author

Too many changes in a single commit

Broke into separate commits for each change.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants