Kyon147 / laravel-shopify

A full-featured Laravel package for aiding in Shopify App development
MIT License
353 stars 102 forks source link

Tests failing for the package #171

Closed SachinBahukhandi closed 1 year ago

SachinBahukhandi commented 1 year ago

For bug reporting only! If you're posting a feature request or discussion, please ignore.

Expected Behavior

The tests fail with the following error:

PHPUnit 9.6.8 by Sebastian Bergmann and contributors.

...............................................................  63 / 164 ( 38%)
............................................................... 126 / 164 ( 76%)
......................................                          164 / 164 (100%)

Time: 00:10.099, Memory: 56.50 MB

OK (164 tests, 393 assertions)

Generating code coverage report in Clover XML format ... done [00:00.043]

Code Coverage Report:        
  2023-05-27 02:08:09        

 Summary:                    
  Classes: 70.97% (44/62)    
  Methods: 87.80% (223/254)  
  Lines:   91.80% (1299/1415)

Osiset\ShopifyApp\Actions\ActivatePlan
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 29/ 29)
Osiset\ShopifyApp\Actions\ActivateUsageCharge
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 18/ 18)
Osiset\ShopifyApp\Actions\AfterAuthorize
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 18/ 18)
Osiset\ShopifyApp\Actions\AuthenticateShop
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 19/ 19)
Osiset\ShopifyApp\Actions\CancelCharge
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 13/ 13)
Osiset\ShopifyApp\Actions\CancelCurrentPlan
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 12/ 12)
Osiset\ShopifyApp\Actions\CreateScripts
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 26/ 26)
Osiset\ShopifyApp\Actions\CreateWebhooks
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 26/ 26)
Osiset\ShopifyApp\Actions\DeleteWebhooks
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  9/  9)
Osiset\ShopifyApp\Actions\DispatchScripts
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 16/ 16)
Osiset\ShopifyApp\Actions\DispatchWebhooks
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 16/ 16)
Osiset\ShopifyApp\Actions\GetPlanUrl
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 16/ 16)
Osiset\ShopifyApp\Actions\InstallShop
  Methods:  50.00% ( 1/ 2)   Lines:  80.65% ( 25/ 31)
Osiset\ShopifyApp\Console\AddVariablesCommand
  Methods:  80.00% ( 4/ 5)   Lines:  93.33% ( 28/ 30)
Osiset\ShopifyApp\Console\WebhookJobMakeCommand
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 20/ 20)
Osiset\ShopifyApp\Directives\SessionToken
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
Osiset\ShopifyApp\Http\Middleware\AuthProxy
  Methods:  50.00% ( 1/ 2)   Lines:  95.45% ( 21/ 22)
Osiset\ShopifyApp\Http\Middleware\AuthWebhook
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% ( 14/ 14)
Osiset\ShopifyApp\Http\Middleware\Billable
  Methods:   0.00% ( 0/ 1)   Lines:  92.31% ( 12/ 13)
Osiset\ShopifyApp\Http\Middleware\IframeProtection
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 17/ 17)
Osiset\ShopifyApp\Http\Middleware\VerifyShopify
  Methods:  60.00% ( 9/15)   Lines:  78.06% (121/155)
Osiset\ShopifyApp\Http\Requests\StoreUsageCharge
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 27/ 27)
Osiset\ShopifyApp\Macros\TokenRedirect
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  2/  2)
Osiset\ShopifyApp\Macros\TokenRoute
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  2/  2)
Osiset\ShopifyApp\Macros\TokenUrl
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  8/  8)
Osiset\ShopifyApp\Messaging\Jobs\AppUninstalledJob
  Methods:  50.00% ( 1/ 2)   Lines:  91.67% ( 11/ 12)
Osiset\ShopifyApp\Messaging\Jobs\ScripttagInstaller
  Methods:  50.00% ( 1/ 2)   Lines:  28.57% (  2/  7)
Osiset\ShopifyApp\Messaging\Jobs\WebhookInstaller
  Methods:  50.00% ( 1/ 2)   Lines:  28.57% (  2/  7)
Osiset\ShopifyApp\Objects\Transfers\AbstractTransfer
  Methods:  60.00% ( 3/ 5)   Lines:  71.43% (  5/  7)
Osiset\ShopifyApp\Objects\Transfers\PlanDetails
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% ( 10/ 10)
Osiset\ShopifyApp\Objects\Transfers\UsageCharge
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  2/  2)
Osiset\ShopifyApp\Objects\Values\AccessToken
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
Osiset\ShopifyApp\Objects\Values\Hmac
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
Osiset\ShopifyApp\Objects\Values\NullablePlanId
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  2/  2)
Osiset\ShopifyApp\Objects\Values\NullableSessionId
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  2/  2)
Osiset\ShopifyApp\Objects\Values\NullableShopDomain
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  2/  2)
Osiset\ShopifyApp\Objects\Values\SessionContext
  Methods:  66.67% ( 4/ 6)   Lines:  71.43% ( 15/ 21)
Osiset\ShopifyApp\Objects\Values\SessionToken
  Methods: 100.00% (18/18)   Lines: 100.00% ( 59/ 59)
Osiset\ShopifyApp\Objects\Values\ShopDomain
  Methods:  33.33% ( 1/ 3)   Lines:  59.38% ( 19/ 32)
Osiset\ShopifyApp\Services\ApiHelper
  Methods:  90.00% (18/20)   Lines:  96.69% (175/181)
Osiset\ShopifyApp\Services\ChargeHelper
  Methods: 100.00% (16/16)   Lines: 100.00% ( 74/ 74)
Osiset\ShopifyApp\Services\CookieHelper
  Methods: 100.00% ( 6/ 6)   Lines: 100.00% ( 27/ 27)
Osiset\ShopifyApp\Storage\Commands\Charge
  Methods: 100.00% ( 5/ 5)   Lines: 100.00% ( 44/ 44)
Osiset\ShopifyApp\Storage\Commands\Shop
  Methods: 100.00% (12/12)   Lines: 100.00% ( 36/ 36)
Osiset\ShopifyApp\Storage\Models\Charge
  Methods: 100.00% (18/18)   Lines: 100.00% ( 29/ 29)
Osiset\ShopifyApp\Storage\Models\Plan
  Methods: 100.00% (10/10)   Lines: 100.00% ( 15/ 15)
Osiset\ShopifyApp\Storage\Observers\Shop
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% (  7/  7)
Osiset\ShopifyApp\Storage\Queries\Charge
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 16/ 16)
Osiset\ShopifyApp\Storage\Queries\Plan
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 12/ 12)
Osiset\ShopifyApp\Storage\Queries\Shop
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 15/ 15)
Osiset\ShopifyApp\Storage\Scopes\Namespacing
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)
Osiset\ShopifyApp\Traits\ApiController
  Methods:  66.67% ( 2/ 3)   Lines:  70.00% (  7/ 10)
Osiset\ShopifyApp\Traits\AuthController
  Methods:   0.00% ( 0/ 2)   Lines:  55.77% ( 29/ 52)
Osiset\ShopifyApp\Traits\BillingController
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 53/ 53)
Osiset\ShopifyApp\Traits\HomeController
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  4/  4)
Osiset\ShopifyApp\Traits\ShopAccessible
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  2/  2)
Osiset\ShopifyApp\Traits\ShopModel
  Methods: 100.00% (14/14)   Lines: 100.00% ( 26/ 26)
Osiset\ShopifyApp\Traits\WebhookController
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% ( 10/ 10)
Osiset\ShopifyApp\Util
  Methods:  90.00% ( 9/10)   Lines:  97.14% ( 68/ 70)

Current Behavior

Currently, it fails with the following error.

Failure Information

Please help provide information about the failure if this is a bug.

Failure:

  1. Osiset\ShopifyApp\Actions\InstallShop Methods: 50.00% ( 1/ 2) Lines: 80.65% ( 25/ 31)
  2. Osiset\ShopifyApp\Http\Middleware\AuthProxy Methods: 50.00% ( 1/ 2) Lines: 95.45% ( 21/ 22)
  3. Osiset\ShopifyApp\Http\Middleware\Billable Methods: 0.00% ( 0/ 1) Lines: 92.31% ( 12/ 13)
  4. Osiset\ShopifyApp\Messaging\Jobs\AppUninstalledJob Methods: 50.00% ( 1/ 2) Lines: 91.67% ( 11/ 12)
    1. Osiset\ShopifyApp\Messaging\Jobs\ScripttagInstaller Methods: 50.00% ( 1/ 2) Lines: 28.57% ( 2/ 7)
    2. Osiset\ShopifyApp\Messaging\Jobs\WebhookInstaller Methods: 50.00% ( 1/ 2) Lines: 28.57% ( 2/ 7)
    3. Osiset\ShopifyApp\Objects\Values\ShopDomain Methods: 33.33% ( 1/ 3) Lines: 59.38% ( 19/ 32)
    4. Osiset\ShopifyApp\Traits\AuthController Methods: 0.00% ( 0/ 2) Lines: 55.77% ( 29/ 52)

Steps to Reproduce

Please provide detailed steps for reproducing the issue. Follow the steps here: https://github.com/Kyon147/laravel-shopify/wiki/Testing

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

Failure Logs

Please include any relevant log snippets or files here.

Kyon147 commented 1 year ago

Tests are passing on the actions, and this just looks like code coverage coming back with some missing coverage.

Going to close this as it is not a bug that I can see, but an improvement that we should look to cover a little more of the app.