-
-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Busted Output (wip) #86
Busted Output (wip) #86
Conversation
Okay thats a lot of work. Good job. I will need to take a in depth look at this, this evening. One thing you can do, is update your description with a screenshot how it currently looks :) Another thing we will probably do, after the conflicts are resolved, moves some files around:
|
I tried to respect current code and file structure. But yes... better to move them to it's own busted dir. |
Note: Passing tests are still shown. But will be removed from visual output later. You can consider them redundant as you would typically show only the failing tests. The output of: pending tests and errors, still need to be handled. |
local trace = get_trace(nil, 3, msg) | ||
return trace.message .. "\n" .. trace.traceback | ||
-- return trace.message .. "\n" .. trace.traceback | ||
return trace.message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep the traceback
That looks really nice and clean @Mathijs-Bakker . I'd suggest to take out the path in front of |
Thanks, I will get into it. |
I am sorry, i am really busy lately. I will do a productive review this evening :) |
Nothing new... I only synched with origin and solved a merge conflict. |
Ok, it's weekend, time to move on with this thing... I need some advise on this: For drawing the dots and score results, we need to count the 'fail', 'err', 'pending' and passed tests. So we need to get the tests first. The stdout of the To identify a test and it's status: E.g: if not ok then
to_insert = results.fail
test_result.msg = msg
print(FAIL, "||", table.concat(test_result.descriptions, " "))
print(indent(msg, 12))
print("{SPEC: FAIL}")
local spec = get_file_and_line_number()
print(FAIL, " → " .. color_string("cyan", spec.file) .. " @ " .. color_string("cyan", spec.linenumber) .. "\n")
print(bold_string(table.concat(test_result.descriptions)))
print(indent("\n" .. msg, 7))
print("{ENDOFSPEC}") It works, it's fast but it feels kind of hackie to me, |
I need to think about this. I will answer you this evening or tomorrow morning :) Sorry that i am not really a help right now |
print(HEADER) | ||
print(HORIZONTALRULER) | ||
|
||
os.exit(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be here
I am looking at the whole code now. Give me between 30 ~ 60 mins for an answer. I wanna play around with the code for a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay i am trying to get nvim --headless --noplugin -u scripts/minimal.vim -c "PlenaryBustedFile tests/plenary/simple_busted_spec.lua"
to work first. After that i am trying to deal with PlenaryBustedDirectory
and test harness
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh i see what you doing. I am not sure if i like it i kinda wanna keep the current way of starting a test, with just executing busted itself. We not always wanna go thought test_harness
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's exactly the reason for reaching out.
I don't like it either.
I'm afk for +/- 2 hours. So will respond later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is what i think we could do. When executing the file with PlenaryBustedFile
we have basically the same output, a little bit cleaned up and for Directory
we can then get the SUCCESS
, FAILURE
and PENDING
outputs and count them and also convert them to dots.
For stacktrace and error, the line always starts with a
and those always come after a FAILURE
so, if we read failure we go in another state that captures all further lines that start with
and memorizes them for later output. And on exit we just draw it. Colored dots, Failures and summarize. We also can have simple_busted
print the summarize and just realize that its a summarize and capture it that way.
If you wanna have a more detailed talk, you can write me on gitter in private.
local end_index = info.traceback:find(': in') | ||
info.traceback = info.traceback:sub(start_index, end_index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are subbing away here, only busted traceback?
|
||
print(FAIL, " → " .. color_string("cyan", spec.file) .. " @ " .. color_string("cyan", spec.linenumber) .. "\n") | ||
|
||
print(bold_string(table.concat(test_result.descriptions))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing " "
for concat
@Mathijs-Bakker do you still want to continue on this PR? I'm trying to help out w/ some of these :) |
@tjdevries Yes definitely! I'm feeling bad for @Conni2461 that I didn't respond earlier... |
|
I took a break too from maintaining this project 😆 If |
Ill close this PR as abandoned. Ill probably fix this issue but i start from scratch. Still thanks for looking into it and if you still work on it you can just reopen :) |
Yo! Here a draft... which is not perfect yet.
But maybe you could review it and see if I am on the right track.
Related issue: #73
Still have many things to address...
Like:
I am still a big noob at Lua, so constructive comments are welcome!
Current behavior/screens:
Headless:
Not headless: