Reviewed & tested by the community
Project:
AI (Artificial Intelligence)
Version:
2.0.x-dev
Component:
AI Core module
Priority:
Minor
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Nov 2024 at 12:42 UTC
Updated:
26 Feb 2026 at 21:21 UTC
Jump to comment: Most recent
Comments
Comment #2
mjb3141 commentedComment #5
marcus_johansson commentedSeems to be failing
Comment #6
marcus_johansson commentedComment #9
harivansh commentedComment #10
harivansh commentedI was wondering if we should create an issue to update the existing test implementation to use attributes.
Comment #11
thamasThe MR has a lot of validation and test problems.
Comment #12
hrishikesh-dalal commentedHey
I would love to help here! Could I assign myself this and freshly work on the Unit Test?
Comment #14
scott falconer commented@hrishikesh-dalal that sounds great! Go ahead and assign yourself and let us know if you have any questions.
Comment #15
hrishikesh-dalal commentedSure thanks! I will get it completed by today itself
Comment #16
hrishikesh-dalal commentedComment #20
abhisekmazumdar@hrishikesh-dalal
I checked the MR you created: https://git.drupalcode.org/project/ai/-/merge_requests/1238
Firstly, thank you for the work so far, it’s really appreciated.
I haven’t done a deep code review yet, but I have some initial thoughts comparing the two merge requests:
- MR339 has broader test coverage and validates against the real YAML files shipped with the module. This is useful because it ensures the actual predefined model definitions in the module remain correct and don’t break over time.
- MR1238 takes a more isolated unit-testing approach by using a virtual filesystem. This makes the test more portable, deterministic, and aligned with unit-testing best practices, since it doesn’t depend on the module’s physical file structure.
My initial feeling is that MR 1238 follows better unit-testing practices, while MR 339 provides stronger real-world validation and broader scenario coverage. Ideally, a combination of both approaches would give the best overall test reliability and coverage.
See if it’s possible to achieve that balance.
Regarding the broken PHPStan checks, this is a known issue, and other MRs targeting the 2.x branch also have it. A good way to confirm is to look at other MRs and issues targeting the same branch.
For example, the Needs review queue for 2.x:
https://www.drupal.org/project/issues/search/ai?status%5B%5D=8&version%5...
You’ll notice that several 2.x MRs are currently affected. I haven’t investigated those errors in detail, but there are likely existing issues tracking them.
Comment #21
hrishikesh-dalal commentedAppreciate the feedback, @abhisekmazumdar. I see the point regarding the coverage in MR 339. I'll bridge the gap by bringing those scenarios into my isolated setup in MR 1238.
Thanks for clarifying the PHPStan issue as well—saved me some unnecessary debugging. I'll update the MR shortly.
Thank you!
Comment #22
hrishikesh-dalal commentedComment #27
scott falconer commentedI reviewed MR !1238 as the active candidate for this issue and did not find any blocking issues.
Summary
- Scope is tight and matches the issue (single new unit test file).
- The test coverage is solid for the targeted utility behavior.
- Latest MR pipeline is successful overall.
Blockers
- None.
Optional recommendation
- Add explicit negative-path wrapper tests for:
- getPredefinedModelsAsOptions(NULL|invalid)
- getPredefinedModel(invalid, ...)
marking as rtbc
Comment #28
scott falconer commented