Skip to content

feat(discovery): support containers with autowiring#2084

Merged
brendt merged 3 commits into3.xfrom
fix/support-container-autowiring
Mar 31, 2026
Merged

feat(discovery): support containers with autowiring#2084
brendt merged 3 commits into3.xfrom
fix/support-container-autowiring

Conversation

@innocenzi
Copy link
Copy Markdown
Member

@innocenzi innocenzi commented Mar 28, 2026

This pull request updates BootDiscovery so it doesn't assume every container except Tempest's do not support autowiring.

The previous behavior was to check the container instance, verify if it was a Tempest container or if that the container knew about the discovery class. If that was the case, it would resolve the class using the container, and otherwise it would create an instance manually.

However, other containers may support autowiring as well, so instead, I updated the behavior to first try resolving the class from the container, and if it failed with a Psr\Container\NotFoundExceptionInterface, only then try to create an instance manually. If the class required arguments and could not be instantiated, a nice error is thrown.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 28, 2026

Benchmark Results

Comparison of fix/support-container-autowiring against 3.x (f1162475c1a432bec8d9c8442f46f7c895db7765).

Open to see the benchmark results
Benchmark Set Mem. Peak Time Variability
QueryExecutionBench(benchExecuteInsert) - 4.333mb 0.00% 10.949μs -5.17% ±1.24% -55.87%

Generated by phpbench against commit ea09f40

@brendt brendt merged commit 4a85663 into 3.x Mar 31, 2026
77 of 82 checks passed
@brendt brendt deleted the fix/support-container-autowiring branch March 31, 2026 11:06
regnerisch pushed a commit to regnerisch/tempest-framework that referenced this pull request Mar 31, 2026
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