Add test coverage for the request/response pipeline.

Patch coming

Comments

larowlan created an issue. See original summary.

larowlan’s picture

Status: Active » Needs review
StatusFileSize
new8.01 KB

Something like this

gambry’s picture

StatusFileSize
new841 bytes
new7.98 KB

That's cool. I've just changed 2 minor things:

  1. +++ b/tests/src/Kernel/ChatbotIntentPluginTest.php
    @@ -0,0 +1,177 @@
    +    'node',
    ...
    +    'options',
    

    We don't need these two? Unless there is something I'm missing.

  2. +++ b/tests/src/Kernel/ChatbotIntentPluginTest.php
    @@ -0,0 +1,177 @@
    +    'views',
    

    We need this until is #2905388: The "view" entity type does not exist in. :(

  3. +++ b/tests/src/Kernel/ChatbotIntentPluginTest.php
    @@ -0,0 +1,177 @@
    +    $this->installConfig(['filter', 'node', 'user']);
    

    For the point above, I guess node can go.

If patch is ok for you I'll commit!

larowlan’s picture

Bot is reporting no tests found? Changes look good

gambry’s picture

Weird. I had the same issue locally, it only worked by passing to phpunit the path to the module.
I'll investigate.

gambry’s picture

This is happening:

PHP Fatal error: Class 'Drupal\chatbot_api\Plugin\IntentPluginBase' not found in /var/www/html/modules/contrib/api_ai_webhook/tests/modules/api_ai_webhook_test/src/Plugin/Chatbot/Intent/UserInfo.php on line 18

And I don't see any line about pulling test dependency chatbot_api. Wondering if new test_dependencies declaration is ignored if coming from a patch?

Shall we put this in and see if re-testing the 8.x-1.x branch runs the test?

gambry’s picture

I had a chat with @dawehner and he thinks #6 is likely to be the reason why test doesn't run.
He mentioned a release with chatbot_api as info.yml test_dependencies and composer dev-dependencies should fix the problem.

To me it looks like too much work for a test passing locally, so if you don't see any problem I suggest to commit this and see if test run against the branch.

larowlan’s picture

Yeah agree

  • gambry authored a42bf2b on 8.x-1.x
    Issue #2907189 by gambry, larowlan: Add test coverage
    
gambry’s picture

Status: Needs review » Fixed

This is in now. Let's see if next test against branch is OK.

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.