LimeChain / matchstick

🔥 Unit testing framework for Subgraph development on The Graph protocol. ⚙️
MIT License
210 stars 18 forks source link

Display the full path + line for each failed test #266

Closed dimitrovmaksim closed 2 years ago

dimitrovmaksim commented 2 years ago

Issue: closes https://github.com/LimeChain/matchstick/issues/237

What this PR does:

  1. Adds backtrace module
  2. Adds parse_backtrace function - Using regex gets the line of the backtrace which contains the path of the test file and the id of the failing test function.
  3. Adds get_test_line function - Uses the file path and the test function id from parse_backtrace to read the file and find the the line on which the test function was declared.

Drawbacks: Currently it will iterate over the test file for each failing test

Screenshots:

Screenshot 2022-01-04 at 16 41 52