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

Support test under cursor for testify suites, support . in file names #67

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

roveo
Copy link

@roveo roveo commented Dec 9, 2023

Support for executing individual methods (and subtests) inside testify suites. A bit hacky since it relies on naming conventions.

  • Suites are now detected as namespaces.
  • To construct the correct command, we need to rely on a naming convention, namely that suites contain Suite in their type name and the test running function name is suite type name prepended with Test, e.g. MyTestSuite -> TestMyTestSuite. We need it to correctly construct the argument for -run flag.

In addition to that, allowed . character in test file names. I encounter this regularly and don't see a reason why they shouldn't be allowed.

Possible improvements:

  • Hide this behind "experimental" setting, like table tests. Not sure how to do this, because we manipulate test name twice: first to construct the correct command and then we convert them back to the internal test id used by neotest. In the second case, we don't have access to settings.
  • Now each method is under its own namespace named after the suite. In theory, we could reshape the tree to have them all under the same shared namespace.

Closes #6

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.

[Feature request] Support for Testify framework
1 participant