Skip to content
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

status: with child tests present, markers always indicate the last result of the latest-defined child #305

Closed
OddBloke opened this issue Oct 25, 2023 · 0 comments · Fixed by #306

Comments

@OddBloke
Copy link
Contributor

I ran into this in my neotest-python PR (nvim-neotest/neotest-python#36 (comment)):

There is still something funky going on with status markers: only the latest defined of the child tests which have run updates the marker. So if you run the entire set of children, the last result will be the only one reflected: if you then run any child but the last one, the status marker does not even update to reflect that the test is running. If you run individual children (from the summary window), then the status marker is updated iff you haven't run any later-listed children.

I think I've figured out what's going on here. My change in this area in 6676edc#diff-866d3516ad8bfe1d181d7b54bddf2bb25543d9e18828cd9876bab6401707dfc4 wasn't correct: it means that we set a mark on the test's first line for the parent and every child that has a result in results, which explains the behaviour I've observed. Instead, we should simply skip setting status markers for child tests, deferring to the parent.

OddBloke added a commit to OddBloke/neotest that referenced this issue Oct 25, 2023
This fixes nvim-neotest#305, by ensuring that rangeless tests will not have markers
written at all, avoiding overwriting their parent's mark.

This does introduce another, less significant, issue: the marker for a
test will always indicate the result of the last time that the parent
test was explicitly executed, including being absent if the parent test
has never been specifically requested.  (Currently, this likely only
occurs when using the summary window, so users can reference that for
more precise result info.  This could become a more annoying issue with,
for example, a "run all failed tests" command in future which might
bypass parent test execution.)
rcarriga pushed a commit that referenced this issue Nov 12, 2023
This fixes #305, by ensuring that rangeless tests will not have markers
written at all, avoiding overwriting their parent's mark.

This does introduce another, less significant, issue: the marker for a
test will always indicate the result of the last time that the parent
test was explicitly executed, including being absent if the parent test
has never been specifically requested.  (Currently, this likely only
occurs when using the summary window, so users can reference that for
more precise result info.  This could become a more annoying issue with,
for example, a "run all failed tests" command in future which might
bypass parent test execution.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant