Commit Graph

15 Commits

Author SHA1 Message Date
dundargoc
7035125b2b test: improve test conventions
Work on https://github.com/neovim/neovim/issues/27004.
2024-04-08 22:51:00 +02:00
Justin M. Keyes
c3836e40a2
build: enable lintlua for test/unit/ dir #26396
Problem:
Not all Lua code is checked by stylua. Automating code-style is an
important mechanism for reducing time spent on accidental
(non-essential) complexity.

Solution:
- Enable lintlua for `test/unit/` directory.
- TODO: only `test/functional/` remains unchecked.

previous: 45fe4d11ad
previous: 517f0cc634
2023-12-04 14:32:39 -08:00
dundargoc
4f1d75daf8
ci: enable colors by default when testing
Test colors were disabled in be7290d214
due to color codes interfering with the logs. I believe the solution to
disable colors is too aggressive. Reading raw logs isn't common compared
to reading CI results from the github UI. We should optimize the most
common use case.

It is also possible to interpret the colors codes in logs from neovim
with a plugin that interprets ansi escape sequences.
2023-05-22 09:47:40 +01:00
dundargoc
0bc3238504
test(Windows): normalize paths for test summary
It previously gave a mix of forward and backslashes which was jarring.
2023-04-06 18:13:57 +02:00
Justin M. Keyes
b6467dfc23 test(report): formatting, drop dumplog()
Don't need to dumplog() on each failed test because we now have test-ids
that associate log messages with tests.
2022-06-15 19:23:10 -07:00
Justin M. Keyes
8f06520594 feat(logging): include test-id in log messages
Problem:
1. Log messages (especially in CI) are hard to correlate with tests.
2. Since b353a5c05f #11886, dumplog() prints the logs next to test
   failures. This is noisy and gets in the way of the test results.

Solution:
1. Associate an incrementing id with each test and include it in log
   messages.
    - FUTURE: add v:name so Nvim instances can be formally "named"?
2. Mention "child" in log messages if the current Nvim is a child (based
   on the presence of $NVIM).

BEFORE:

    DBG … 12345      UI: event
    DBG … 12345      log_server_msg:722: RPC ->ch 1: …
    DBG … 12345      UI: flush
    DBG … 12345      inbuf_poll:444: blocking... events_enabled=1 events_pending=0
    DBG … 23454      UI: stop
    INF … 23454      os_exit:594: Nvim exit: 0

AFTER:

    DBG … T57        UI: event
    DBG … T57        log_server_msg:722: RPC ->ch 1: …
    DBG … T57        UI: flush
    DBG … T57        inbuf_poll:444: blocking... events_enabled=1 events_pending=0
    DBG … T57/child  UI: stop
    INF … T57/child  os_exit:594: Nvim exit: 0
2022-06-15 19:23:10 -07:00
Dundar Göc
f4693d99df test: don't print NVIMLOG on success 2022-03-29 22:50:39 +02:00
Justin M. Keyes
9d5d72c388
fix(test runner): handle nil in no-colors output handler #15679
Problem:
13748512f6 #15610 The no-colors codepath of the nvim.lua test output
handler does not handle nil, leading to weird symptoms if e.g. a test
has a syntax error:

    test/busted/outputHandlers/nvim.lua:105: attempt to concatenate a nil value

Solution:
Coerce to string in no-colors handler.
2021-09-16 11:42:00 -07:00
Justin M. Keyes
b63b4777ec
docs: third-party licenses, TEST_COLORS, system() #15665 2021-09-14 10:20:33 -07:00
Björn Linse
5087347e3b fix(build): add an env var to re-enable the colors 2021-09-11 23:20:00 +02:00
Justin M. Keyes
13748512f6
test(busted): disable colors in test-runner output #15610
Problem
-------

Because test/busted/outputHandlers/nvim.lua doesn't know if it's running
in a terminal (no "isatty" equivalent), it outputs color codes in CI
logs and local tooling that runs the tests in a pipe:

    [1m[ SKIPPED ] 

This is just noise, hard for humans to read.

Solution
--------

Disable the color codes. If we later find a clever way to detect
a terminal in nvim.lua, we might consider re-enabling colors, but that
would still affect the CI build logs...
2021-09-09 09:18:43 -07:00
Justin M. Keyes
6e13b9d261 test/LSP: assert contents of log file 2020-02-16 22:09:28 -08:00
Daniel Hahler
db6b4b677d
tests: busted: nvim handler: display durations always (#11075)
This shows them also with test failures/errors, where it is useful to
see how long the test took (for flaky failures running into timeout).
2019-09-25 02:20:32 +02:00
Daniel Hahler
00d46f6328
Fix test/busted/outputHandlers/TAP.lua (#10881)
Extending the original TAP handler was not working as expected.
This adds a new function for displaying the log.

Ref: https://github.com/neovim/neovim/pull/10876
2019-08-29 22:11:51 +02:00
Daniel Hahler
34c6e5beaf
tests: move "busted" dir to "test" (#10518)
* tests: move "busted" dir to "test"

It is used for outputHandlers only, and clearly belongs to the tests.
Use the full module name with the `-o` option to `busted` then for
clarity.

* luacheck

* test/busted/outputHandlers/TAP.lua: use/extend upstream
2019-07-16 22:02:50 +02:00