fix: make benchmark tests resilient to CodSpeed's repeated test body execution#210
Conversation
- Change TESTING_DIR to Path(__file__).parent.parent / "testing" so all testing/ paths are absolute and CWD-independent - Reset file to unformatted bytes at start of "reformats" test bodies and compare against MAIN_C.read_bytes() to handle pytest-codspeed calling benchmark bodies multiple times per test invocation Agent-Logs-Url: https://github.com/cpp-linter/cpp-linter-hooks/sessions/e6f1960a-f8fc-4507-8baa-2b659f052346 Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
|
@copilot Reference: //pull/210/checks?check_run_id=70156607477 and fix ci failures |
Agent-Logs-Url: https://github.com/cpp-linter/cpp-linter-hooks/sessions/34061e6b-161d-43de-b6e2-4f3a3a642f63 Co-authored-by: shenxianpeng <3353385+shenxianpeng@users.noreply.github.com>
|
Merging this PR will not alter performance
Performance Changes
Comparing Footnotes
|


TESTING_DIR = Path("testing")is relative, causingFileNotFoundErrorwhen CWD changesTESTING_DIRto use absolute pathPath(__file__).parent.parent / "testing"MAIN_C.read_bytes()(handles repeated benchmark calls)