Skip to content

Conversation

@michaldziurowski
Copy link
Contributor

Removed reference from not initialized file_id variable to value.id.
Fixes: #47

@michaldziurowski michaldziurowski marked this pull request as draft May 9, 2023 18:08
@michaldziurowski michaldziurowski marked this pull request as ready for review May 9, 2023 18:10
@zankich
Copy link

zankich commented May 9, 2023

Just tried this branch out and it fixes the issue!

@sergii4
Copy link
Collaborator

sergii4 commented May 9, 2023

Hi @michaldziurowski, it fails test lua/spec/neotest-go/init_spec.lua. Ideally, it shouldn't fix one issue and create another.

Success ||      prepare_results check that we have file level test result as well as all nested results in cases_test.go
Fail    ||      prepare_results check that we have correct file level test result status cases_test.go
            ...re/nvim/site/pack/packer/start/neotest/lua/nio/tests.lua:27: Test task failed with message:
            The coroutine failed with this message: 
            ...acker/start/neotest-go/lua/spec/neotest-go/init_spec.lua:272: Expected objects to be equal.
            Passed in:
            (string) 'passed'
            Expected:
            (string) 'failed'
            stack traceback:
                [C]: in function 'error'
                ...e/pack/packer/start/plenary.nvim/lua/luassert/assert.lua:51: in function 'equals'
                ...acker/start/neotest-go/lua/spec/neotest-go/init_spec.lua:272: in function <...acker/start/neotest-go/lua/spec/neotest-go/init_spec.l
ua:244>
            
            stack traceback:
                ...re/nvim/site/pack/packer/start/neotest/lua/nio/tests.lua:27: in function <...re/nvim/site/pack/packer/start/neotest/lua/nio/tests.lu
a:12>
            

@zankich
Copy link

zankich commented May 9, 2023

@sergii4 what are the steps for running the test suite?

@michaldziurowski
Copy link
Contributor Author

Hi @michaldziurowski, it fails test lua/spec/neotest-go/init_spec.lua. Ideally, it shouldn't fix one issue and create another.

Yep, I rushed a bit with removal of file_id, sorry. Fixed. Will provide some additional tests later.
Sidenote: it seems that there are other test which are also failing in init_spec.lua not related to this change, or is it just my env ?

what are the steps for running the test suite?

I'm new to lua so maybe there is better way but I'm using plenary test runner via :PlenaryBustedDirectory lua/spec from inside of neotest-go dir.

@zankich
Copy link

zankich commented May 10, 2023

hey @michaldziurowski I also have a PR which fixes this and related diagnostic errors while parsing test output #49

results[value.id].errors = errors
end
if test_result.status == test_statuses.fail then
if test_result.status == test_statuses.fail and file_id then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't file_id always nil here?

Copy link
Collaborator

@sergii4 sergii4 May 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should it be? We always have file level test result

@sergii4
Copy link
Collaborator

sergii4 commented May 11, 2023

Hi @michaldziurowski to run test you need:
#49 (comment)

@sergii4
Copy link
Collaborator

sergii4 commented May 11, 2023

Hi @michaldziurowski, yeah, it seems pretty logical that attempt index nil value caused by nil. I tested your change, it works for me and tests pass.

Thank you for sparing your time on it

@sergii4 sergii4 merged commit 4e7a879 into nvim-neotest:main May 11, 2023
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 this pull request may close these issues.

nil error on test single function

4 participants