Skip to content

Commit

Permalink
Save the log file for failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
puremourning committed Jul 27, 2019
1 parent 34df47f commit 0464b45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ package/
README.md.orig.*
README.md.toc.*
.DS_Store
*.vimspector.log
support/test/csharp/*.exe*
7 changes: 6 additions & 1 deletion tests/lib/run_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,11 @@ func AfterTheTest()
call add(s:errors, 'Found errors in ' . s:testid . ':')
call extend(s:errors, v:errors)
let v:errors = []

let log = readfile( expand( '~/.vimspector.log' ) )
let logfile = s:testid . '.vimspector.log'
call writefile( log, logfile, 's' )
call add( s:messages, 'Wrote log for failed test: ' . logfile )
endif
endfunc

Expand Down Expand Up @@ -314,7 +319,7 @@ for s:test in sort(s:tests)

" Repeat a flaky test. Give up when:
" - it fails again with the same message
" - it fails five times (with a different mesage)
" - it fails five times (with a different message)
if len(v:errors) > 0
\ && (index(s:flaky_tests, s:test) >= 0
\ || v:errors[0] =~ s:flaky_errors_re)
Expand Down

0 comments on commit 0464b45

Please sign in to comment.