Skip to content

API for getting more debugging info #88

Open
@avh4

Description

@avh4

When tests fail, it can be useful to get more information about what led up to the failure. What should such an API look like? What information should just always be shown in all errors, and which should be opted-in to?

For opt-in debugging features, the API could maybe be something like withDebugging [ ProgramTest.Debug.MsgLog, ProgramTest.Debug.PendingHttpRequests]
(withDebugging : List DebugOption -> ProgramTest model msg effect -> ProgramTest model msg effect)

Possible information to show (please comment below about which of this actually seems useful for tests you've had to debug):

  • history of all Msgs that were processed
  • history of all effects that were simulated
  • details about the browser back and forward history
  • full rendering of the current view
  • full rendering of the view (possibly filtered by some Query.find at each step in the test)
  • pretty print of the program's Model at each step in the test
  • history of steps performed in the test (the ProgramTest API calls)
  • details about all pending HTTP requests
  • details about all past (possibly already resolved) HTTP requests
  • details about all pending scheduled Tasks
  • details about all past scheduled Tasks
  • details about all unchecked outgoing port values
  • history of all simulated incoming port values (I guess this would already be included in "history of steps performed in the test")
  • history of all previously checked outgoing port values

TODO

  • refactor internals to have a data type that represents the test log
  • record information in the log
    • identify the different pieces of information to record
    • (TBD) record each piece of information
  • display information
    • identify the different subsets of information to display
    • (TBD) implement display of each piece

Metadata

Metadata

Assignees

Labels

discussionThe solution we want to implement is not decided yet. Contributions to the discussion are welcome.minorRequires a minor version bumpprojectA description of a larger project that will have many smaller issues

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions