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

Discovering tests marked with attribute #20

Closed
wants to merge 3 commits into from

Conversation

HalfBottleOfMind
Copy link

Hello!
Just started working with this package and find that it does not find tests marked with attribute. I think this is important since marking with phpdoc is deprecatred by phpunit.

Here is my PR to support attribute marking.

It also contains commit, that fixes test dicovering by method name.
Phpunit documentation says that method name should start with 'test', but regex in query hits even if 'test' is in middle of method name.

Thank you!

@olimorris
Copy link
Owner

Fantastic, thanks. Could you include some example PHP tests that showcase what you've discussed? Would love to include them in the adapter.

@HalfBottleOfMind
Copy link
Author

Ok, i'll try to add tests, but i need some time because i'm not familiar with lua and testing in lua

@HalfBottleOfMind
Copy link
Author

Sorry to bother you, but i think i need some help
How do i run tests? Do i need to do something beside just run ./scripts/test? Anything preinstall?

I've got E492: Not an editor command: PlenaryBustedFile specs/utils_spec.lua error when running that file.
And E5108: Error executing lua ...ocal/share/nvim/lazy/plenary.nvim/lua/plenary/busted.lua:267: ./lua/neotest-phpunit/utils.lua:1: module 'neotest.logging' not found error when executing this command in nvim.

@olimorris
Copy link
Owner

Oh sorry I meant add some example phpunit tests to the tests/ dir

@HalfBottleOfMind
Copy link
Author

Done

Please pay attention to my first commit, which changes regex
It brings the package behavior in line with phpunit, but these may be breaking changes

@olimorris
Copy link
Owner

The test:

#[Test]
 	public function this_test_should_run()
 	{
 		$this->assertTrue(true);
 	}

Doesn't run for me. It reads like it should

@HalfBottleOfMind
Copy link
Author

I think there is a problem somewhere in phpunit output parser
I'm running attribute marked test through summary and summary says the test is failed although phpunit output says it's ok
But if i'm running all tests in file (which contains tests marked with comment) summary says this test was successful

I'm sorry, i don't think i can handle this problem right now

@olimorris olimorris closed this Apr 28, 2024
@olimorris
Copy link
Owner

Happy for this to be picked up at a later point in time.

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.

2 participants