Skip to content

chore/increase offline tests coverage - #33

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

chore/increase offline tests coverage #33
alanpeixinho wants to merge 12 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

@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

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

@tales-aparecida

Copy link
Copy Markdown
Collaborator

Too many changes in a single commit

Broke into separate commits for each change.

Much better, thanks! But the two refactor commits are still a bit confusing as to what is just being extracted/moved into a helper, and what is changing more dramatically. Do you think you can split them a bit more?

@alanpeixinho

Copy link
Copy Markdown
Contributor Author

Too many changes in a single commit

Broke into separate commits for each change.

Much better, thanks! But the two refactor commits are still a bit confusing as to what is just being extracted/moved into a helper, and what is changing more dramatically. Do you think you can split them a bit more?

Just to be sure.
Are you referring to these commits?

b07cdb9 — refactor: split mail exporter for offline testing
4d1334d — refactor: split web exporter for offline testing

@tales-aparecida

Copy link
Copy Markdown
Collaborator

@alanpeixinho

Just to be sure.
Are you referring to these commits?

b07cdb9 — refactor: split mail exporter for offline testing
4d1334d — refactor: split web exporter for offline testing

yep!

@alanpeixinho
alanpeixinho force-pushed the chore/offline-tests branch from b693997 to 680379d Compare July 22, 2026 20:47
Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
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>
Route report timestamps through _mail_now/_mail_days_delta so offline tests
can freeze the mail clock.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Split RegExportMailReport.compile into listed/lastreport/prepare_reports/
prepare/publish helpers with behavior unchanged.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Thread interactive flag through prepare/publish, add fixed message-id and
offline lastreport source, and expose dumpall_mail.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Separate page-building from page-writing so offline tests can assert web
output without touching disk.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Gather regression/event data in prepare and move all page writing into
publish, keeping current output.

Signed-off-by: Alan Peixinho <alan.peixinho@profusion.mobi>
Extract _events_gmtime_offset with a now-relative offline window and expose
dumpall_web for offline dumps.

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
alanpeixinho force-pushed the chore/offline-tests branch from 680379d to 191d09e Compare July 22, 2026 21:01
@alanpeixinho

Copy link
Copy Markdown
Contributor Author

Broke it even further, as requested.

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