Skip to content

Add relative path preference settings to PhpUnit #8478

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

Merged
merged 1 commit into from
May 19, 2025

Conversation

adamturcsan
Copy link
Contributor

@adamturcsan adamturcsan commented Apr 30, 2025

This checkbox gives boolean setting switching between two behaviour of passing test file paths to the PhpUnit command:

FALSE/Unchecked = Use absolute paths [Current behaviour]
TRUE/Checked = Use relative paths

kép

tests

[Edit]
Motivation:

I develop PHP projects in a completely containerized setup. This setting would allow me to use all the functionality with a custom runner script, without dealing with path mapping, or any kind of more robust runner configuration.


^Add meaningful description above

Click to collapse/expand PR instructions

By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -

  • are all your own work, and you have the right to contribute them.
  • are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).

Please make sure (eg. git log) that all commits have a valid name and email address for you in the Author field.

If you're a first time contributor, see the Contributing guidelines for more information.

If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.

PR approval and merge checklist:

  1. Was this PR correctly labeled, did the right tests run? When did they run?
  2. Is this PR squashed?
  3. Are author name / email address correct? Are co-authors correctly listed? Do the commit messages need updates?
  4. Does the PR title and description still fit after the Nth iteration? Is the description sufficient to appear in the release notes?

If this PR targets the delivery branch: don't merge. (full wiki article)

@adamturcsan adamturcsan marked this pull request as ready for review April 30, 2025 22:36
@troizet troizet added the PHP [ci] enable extra PHP tests (php/php.editor) label May 1, 2025
@troizet troizet requested review from tmysik and junichi11 May 2, 2025 03:50
@tmysik
Copy link
Member

tmysik commented May 7, 2025

@adamturcsan, sorry for the delay! Overall, the changes look OK to me; please, look into my comments.

@junichi11, could you please verify it too?

Thank you.

@junichi11
Copy link
Member

I'm not feeling well, so please wait a bit, sorry...

@tmysik
Copy link
Member

tmysik commented May 9, 2025

@junichi11 get well soon! 🤞

@junichi11
Copy link
Member

@tmysik Thank you, Tomas!

@adamturcsan adamturcsan force-pushed the phpunit-relative-testfile-path branch from 2cfb49c to 2525d5d Compare May 15, 2025 09:37
@tmysik
Copy link
Member

tmysik commented May 15, 2025

@adamturcsan, since @junichi11 is not feeling well, please, look into my recent comments (sorry, I totally missed that!) and once resolved, I will approve and we can merge it. If Junichi finds any problem later, we can easily create a ticket and fix it.

Thank you.

@junichi11
Copy link
Member

I'm sorry I'm late...

@tmysik Thank you for the review!

@adamturcsan Could you provide an example project as a zip file to check this change?

@junichi11
Copy link
Member

@mbien Is this author name OK?

@junichi11 junichi11 added this to the NB27 milestone May 15, 2025
@mbien
Copy link
Member

mbien commented May 15, 2025

@mbien Is this author name OK?

i think so. The patch file is using mime encoding https://github.com/apache/netbeans/pull/8478.patch due to special characters which makes it look weird.

But if you look at it using git log you can see a proper name. Looks good to me. (online tool: https://ldu2.github.io/rfc2047/)

@junichi11
Copy link
Member

@mbien Thank you!

@adamturcsan
Copy link
Contributor Author

I'm sorry I'm late...

@tmysik Thank you for the review!

@adamturcsan Could you provide an example project as a zip file to check this change?

SampleProject8478.zip

I hope this project is okay like this.

@adamturcsan adamturcsan force-pushed the phpunit-relative-testfile-path branch from 2525d5d to 4a3400c Compare May 15, 2025 15:09
@junichi11
Copy link
Member

@adamturcsan Thanks. Could you write steps to run tests?

  1. Extract the zip file
  2. ...
  3. ...

@junichi11
Copy link
Member

Vertical gaps are too large. So, please adjust and check them.

nb-php-gh-8478-project-properties

@adamturcsan
Copy link
Contributor Author

@junichi11 Sure. So my use case is driven by a dockerized setup, so the project I sent need docker.

  1. Extract zip
  2. Open extracted directory
  3. make run - this fires up the project via docker-compose
  4. Open project in NetBeans
  5. Right click on project -> Test (Alt+F6)

You might want to run the tests without NB, then pls run make run-test.

I also updated the gaps around the new checkbox.

@junichi11
Copy link
Member

junichi11 commented May 19, 2025

@adamturcsan Thanks!
One question: Do you add the user to the docker group to run docker commands without sudo?

I've verified that we can run tests after I add the user to the docker group.

I also updated the gaps around the new checkbox.

Nice! Please squash commits as one commit and update the screenshot :)

Your example project will be beneficial for anyone wanting to use this option.

@junichi11
Copy link
Member

Nitpick: Maybe Signed-off-by: ....... is not necessary.

This checkbox gives boolean setting switching between two behaviour of passing
test file paths to the PhpUnit command:

 FALSE = Use absolute paths [Current behaviour]
 TRUE = Use relative paths [Based on source root]
@adamturcsan adamturcsan force-pushed the phpunit-relative-testfile-path branch from 5554004 to 7e72192 Compare May 19, 2025 06:32
@adamturcsan
Copy link
Contributor Author

@junichi11 Yes you're right, I forgot to mention the user.

I've squashed the commits, updated the screenshot and removed the signed-off part.

@tmysik
Copy link
Member

tmysik commented May 19, 2025

Just checked it once more and I don't see any problem now. @adamturcsan, great job, thank you!

Copy link
Member

@junichi11 junichi11 left a comment

Choose a reason for hiding this comment

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

Great! Thank you for your work :)

@junichi11
Copy link
Member

@tmysik Let's merge this if it's OK with you :)

@tmysik
Copy link
Member

tmysik commented May 19, 2025

Yes, @adamturcsan, please merge this PR! 👍

@junichi11
Copy link
Member

@tmysik We have to merge this PR because @adamturcsan can't do it :)
OK. Merging.

@junichi11 junichi11 merged commit b53a8a4 into apache:master May 19, 2025
32 checks passed
@tmysik
Copy link
Member

tmysik commented May 19, 2025

I see, sorry. I just wanted @adamturcsan to be more visible in the log history 🙂

@junichi11
Copy link
Member

@tmysik Need not apologize at all. I thought that you wanted to do that ;) Thanks!

@adamturcsan
Copy link
Contributor Author

Thanks @junichi11 and @tmysik for the guidance and the review, this was my first PR here, so I can only hope I wasn't too much of a burden ❤️ 😅

@junichi11
Copy link
Member

@adamturcsan No problem :) Your PR was merged. Congrats🎉

@tmysik
Copy link
Member

tmysik commented May 19, 2025

@adamturcsan any PR is welcome, thank you for your work and time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants