purebred-mua / hs-notmuch

Modern Haskell binding to the Notmuch mail indexer
11 stars 2 forks source link

tests: UAT brittle because terminal escape sequences can differ #16

Closed frasertweedale closed 7 years ago

frasertweedale commented 7 years ago

Not quite sure why this situation arises, but my tests are failling like so:

  user acceptance tests                                                                                  
    user can view mail:                                       OK (2.04s)                                 
      shows tag                                     
      view mail                                     
    manipulating notmuch search query results in empty index: FAIL (6.05s)                               
      focus command                                 
        Wait time exceeded. Expected: '37;40mtag' last screen shot:                                      

          <roman@url.user 17/Aug  Testmail                                          inbox                
         <rjoost@url.use 16/Aug  This is Purebred                          inbox replied                 

        Purebred: Item 0 of 2                       
        tag:inbox                                   

         raw: "\ESC[1m\ESC[37m\ESC[43m <roman@url.user 17/Aug  Testmail                                          \ESC[0m\ESC[36m\ESC[43minbox\n\ESC[94m\ESC[40m <rjoost@url.use 16/Aug  This is Purebred           
               \ESC[36minbox replied\n\ESC[94m\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ESC[30m\ESC[mPurebred: Item 0 of 2\n\ESC[37m\ESC[40mtag:inbox\n"

Above you will see that I added a raw print of the string captured from tmux, to inspect the raw escape codes.

As you can see, before the NM search widget there is

\ESC[37m\ESC[40m

instead of what the search is looking for:

\ESC[37;40m

Semantically these are the same, but as I said, for whatever reason (maybe some weird terminfo or environment settings) the codes being sent are different.

As a first step to resolving this, I'd propose exfiltrating $TERM or other terminal information from the tmux session and reporting that somehow, to see what might differ. In my environment TERM=screen-256color

frasertweedale commented 7 years ago

Totally made this issue in the wrong repo -_-