oracletrace icon indicating copy to clipboard operation
oracletrace copied to clipboard

[Tests]: Add unit tests for compare.py

Open KaykCaputo opened this issue 7 months ago • 4 comments

Summary

Add focused unit tests for oracletrace/compare.py to ensure regression classification and edge cases are correct.

Problem

Compare logic lacks direct unit test coverage; bugs can slip in (--only-regressions, old_time == 0, etc.).

Proposed Solution

Add tests covering:

  • regression (slower)
  • improvement (faster)
  • unchanged
  • new function
  • removed function
  • edge case: old_time == 0

Acceptance Criteria

  • Tests cover the cases above with clear fixtures
  • Tests run fast and deterministically

Affected Files

  • oracletrace/compare.py
  • tests/

KaykCaputo avatar Apr 17 '26 12:04 KaykCaputo

I'll do this

waldo121 avatar Apr 20 '26 14:04 waldo121

Thx @waldo121

KaykCaputo avatar Apr 20 '26 14:04 KaykCaputo

For clarity, when we talk about a regression do we talk about:

  • the sample script's total execution time has gone up or
  • a given function which total execution time has gone up

waldo121 avatar Apr 20 '26 16:04 waldo121

I think we are talking about a given function

KaykCaputo avatar Apr 20 '26 17:04 KaykCaputo