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

Fix json output #82

Merged
merged 15 commits into from
Feb 24, 2024
Merged

Fix json output #82

merged 15 commits into from
Feb 24, 2024

Conversation

sergii4
Copy link
Collaborator

@sergii4 sergii4 commented Feb 24, 2024

Another attempt to fix #52, #80

@sergii4 sergii4 force-pushed the sergii/fix-json-output branch from ab848cf to 45cf6ca Compare February 24, 2024 13:20
@fredrikaverpil
Copy link

@sergii4 still outputs JSON here, when having the cursor on line 9 and running "run nearest test".

Screenshot

Comment on lines 5 to 20
func TestOdd(t *testing.T) {
t.Run("odd", func(t *testing.T) {
t.Run("5 is odd", func(t *testing.T) {
if 5%2 != 1 {
t.Error("5 is actually odd")
}
})
t.Run("7 is odd", func(t *testing.T) {
if 7%2 != 1 {
t.Error("7 is actually odd")
}
})

})

}
Copy link

@fredrikaverpil fredrikaverpil Feb 24, 2024

Choose a reason for hiding this comment

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

@sergii4 You did not use a three-level test, it's just two levels deep. You should try this:

Suggested change
func TestOdd(t *testing.T) {
t.Run("odd", func(t *testing.T) {
t.Run("5 is odd", func(t *testing.T) {
if 5%2 != 1 {
t.Error("5 is actually odd")
}
})
t.Run("7 is odd", func(t *testing.T) {
if 7%2 != 1 {
t.Error("7 is actually odd")
}
})
})
}
func TestOdd(t *testing.T) {
t.Run("odd", func(t *testing.T) {
t.Run("5 is odd", func(t *testing.T) {
if 5%2 != 1 {
t.Error("5 is actually odd")
}
t.Run("7 is odd", func(t *testing.T) {
if 7%2 != 1 {
t.Error("7 is actually odd")
}
})
})
})
}
Screenshot 2024-02-24 at 14 34 33

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, looking into it!

Choose a reason for hiding this comment

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

@sergii4 do you think this is related?

I'm thinking that you're getting a variable amount of temporary files written right now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#83 is related, same nested tests problem

Copy link

@fredrikaverpil fredrikaverpil Feb 24, 2024

Choose a reason for hiding this comment

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

I just checked out @encero's branch in #81 and now I only run the test I intended to run, which is great!
But I still get the JSON output on third t.Run level.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It seems as neotest/tree-sitter upstream problem to me. I keep looking

@sergii4 sergii4 force-pushed the sergii/fix-json-output branch from 7136726 to d9f9eff Compare February 24, 2024 14:48
@sergii4
Copy link
Collaborator Author

sergii4 commented Feb 24, 2024

@fredrikaverpil should work now

Copy link

@fredrikaverpil fredrikaverpil left a comment

Choose a reason for hiding this comment

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

Yes, no more JSON output!! Awesome @sergii4 🎉🎉🎉
❤️ 🚀

@fredrikaverpil
Copy link

I have a feeling this might have solved both #52 and #80. At least in my go-playground repo, I don't get the marshal_gotest_output errors anymore!

@sergii4 sergii4 merged commit 6a2f996 into main Feb 24, 2024
2 checks passed
@sergii4
Copy link
Collaborator Author

sergii4 commented Feb 24, 2024

@fredrikaverpil thanks for collaboration and examples!

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.

Test Output in JSON, making it difficult to read
2 participants