Skip to content

[TASK] Make getInstanceIdentifier() and getInstancePath() non-static for overridability#709

Merged
lolli42 merged 1 commit intoTYPO3:mainfrom
dkd-kaehm:feature/enable-late-static-binding
Mar 24, 2026
Merged

[TASK] Make getInstanceIdentifier() and getInstancePath() non-static for overridability#709
lolli42 merged 1 commit intoTYPO3:mainfrom
dkd-kaehm:feature/enable-late-static-binding

Conversation

@dkd-kaehm
Copy link
Contributor

@dkd-kaehm dkd-kaehm commented Mar 15, 2026

Convert protected static methods to protected instance methods and mark as @internal.
This allows subclasses to override these methods for proper test isolation in parallel
execution (Paratest), without making them part of the public API.

Instead of using static:: binding, use $this-> for natural method overriding.
Solves the need for test isolation in single-test-level parallelization while
signaling that these are internal implementation details.

Fixes: #708

@bmack
Copy link
Member

bmack commented Mar 16, 2026

Hey @dkd-kaehm ,

please either add a test or a doc comment, so this change will stay around and not break when touching these lines again.

@dkd-kaehm dkd-kaehm force-pushed the feature/enable-late-static-binding branch from 9f62cb2 to 84a63d2 Compare March 16, 2026 16:55
@dkd-kaehm
Copy link
Contributor Author

Hey @dkd-kaehm ,

please either add a test or a doc comment, so this change will stay around and not break when touching these lines again.

both done, please kick the GH Actions.

@dkd-kaehm dkd-kaehm force-pushed the feature/enable-late-static-binding branch from 84a63d2 to d14fd9f Compare March 16, 2026 17:02
@lolli42
Copy link
Member

lolli42 commented Mar 16, 2026

Mhh. First thought: "Making this de-facto API will probably add headaches as soon as we pick up the 'composer based functional tests' works again." Second thought: "Why are these two methods static anyway?"

-> I understand your need to override these methods when you want to parallelize on a single-test level. I personally would try to avoid that, which is why core parallelizes functionals on a test-class level instead. To still solve your request, we could maybe: Make the methods non-static, keep protected and not private, but mark @internal. This would solve the binding issue, still allows you to override, and makes clear: "If you override, you're on your own and it may break if testing-framework decides to continue in a diverging direction". What do you think?

@dkd-kaehm
Copy link
Contributor Author

Mhh. First thought: "Making this de-facto API will probably add headaches as soon as we pick up the 'composer based functional tests' works again." Second thought: "Why are these two methods static anyway?"

-> I understand your need to override these methods when you want to parallelize on a single-test level. I personally would try to avoid that, which is why core parallelizes functionals on a test-class level instead. To still solve your request, we could maybe: Make the methods non-static, keep protected and not private, but mark @internal. This would solve the binding issue, still allows you to override, and makes clear: "If you override, you're on your own and it may break if testing-framework decides to continue in a diverging direction". What do you think?

IMHO it is better, but what is with tests then?

@dkd-kaehm dkd-kaehm force-pushed the feature/enable-late-static-binding branch from d14fd9f to be87dc5 Compare March 16, 2026 17:26
@dkd-kaehm dkd-kaehm changed the title [TASK] Enable late static binding in FunctionalTestCase for worker-specific test isolation [TASK] Make getInstanceIdentifier() and getInstancePath() non-static for overridability Mar 16, 2026
@dkd-kaehm dkd-kaehm force-pushed the feature/enable-late-static-binding branch from be87dc5 to bb92a53 Compare March 16, 2026 17:27
@dkd-kaehm
Copy link
Contributor Author

@lolli42
switched to non-static.

@lolli42 lolli42 force-pushed the feature/enable-late-static-binding branch 2 times, most recently from 587732c to 869483f Compare March 23, 2026 21:55
@lolli42
Copy link
Member

lolli42 commented Mar 23, 2026

Hey Rafael. Sorry for the delay. I had to first fix CI today, and had another look at the change now.
I rebased it and gave it some thoughts.
I'm sorry for discussing so many details on this rather tiny change, but reading it again I'm now actually a bit unsure if people may hurt us by making especially getInstancePath() non-static, this might be considered breaking in seldom cases (and core probably actually stumbles here). I'll try to pull @sbuerk into this to come up with a final conclusion to solve your initial issue, soon. Please be patient, I'm sure we'll find consensus.

@lolli42 lolli42 force-pushed the feature/enable-late-static-binding branch from 869483f to a1b915f Compare March 24, 2026 19:03
@lolli42
Copy link
Member

lolli42 commented Mar 24, 2026

Ok. Had a chat with Stefan on this. We will go with your initial approach (without the test). This is not breaking an risk less. Sorry for the confusion and thanks for your work.

…ePath()

This allows overriding the methods if needed.

Fixes: TYPO3#708
@lolli42 lolli42 force-pushed the feature/enable-late-static-binding branch from a1b915f to 7d325a9 Compare March 24, 2026 19:23
@lolli42 lolli42 merged commit 7001bf4 into TYPO3:main Mar 24, 2026
0 of 4 checks passed
@dkd-kaehm dkd-kaehm deleted the feature/enable-late-static-binding branch March 25, 2026 09:21
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.

Enable late static binding in FunctionalTestCase for worker-specific test isolation

4 participants