Repository navigation
v1.1.1
This version improves on the Analyze command by representing table-driven tests in more detail as part of each TestCase! This version also improves the command's output report, which includes these new analysis results! The new analysis results are also saved in the JSON file generated for each test.
For the sake of clarity, note that a “test” or “test case” refers to a single test function, as defined by Go’s testing package documentation. In the case of a table-driven test, a “scenario” is an individual entry (aka row) in the table, and represents a single set of input and output data.
What's Changed
✨ New Features
- Add CSV output report for Analyze command, which includes a condensed version of every analyzed test case
- Example output: ollama-analysis-report.csv
- Represent the structure of table-driven tests more accurately using the new
ScenarioSetstructScenarioSetalso holds analysis results related to table-driven tests, including:- The name of the field representing each scenario's name
- The names of the fields representing the expected results of each scenario
- Whether the scenario type has any fields whose type is a function
- Whether the test defines subtests using
t.Run()inside the loop body
- Individual scenarios are stored in the
ScenarioSet.Scenariosfield
- Integrate go/types into
TestCaseto better detect and analyze Scenario data using a completely overhauledAnalyze()method that can resolve identifiers
🐛 Bug Fixes
- JSON reports created by the Analyze command are now saved in the same directory as the specified output file
🛠️ Internal Improvements
- Create
ParserCommandinterface to represent bothparser.Taskandflags.Commander - Use
init()with to dynamically register parser commands - Add methods to easily export
TestCaseto CSV
📝 Maintenance
- Upgrade to Go 1.24.5
Full Changelog: v1.1.0...v1.1.1