Comments (9)
👋
Any potential update here? Been holding off merging this plugin in. Thanks!
from craft-avatax.
@davist11 - Admittedly I haven't done a deep dive into Craft's testing, but are there any particular errors you're getting that may help track it down?
I'm hesitant to move up the console request check because I think we'd still want to install the Tax Category and override Fields if you're installing the plugin from the console. That check is just to prevent the CP redirect if running in the console.
Are you defining CRAFT_TESTS_PATH
in tests/_bootstrap.php
? One thought I had was to check for that constant to see if it's running in test mode and then just return. I'm not sure if there's a better way but that might be an easy one to try.
from craft-avatax.
There isn't really a great error to send you down a path because I just get a generic:
In Schema.php line 678:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'client_test.<nil>_n
avigation_navs' doesn't exist
The SQL being executed was: SELECT *
FROM `<nil>_navigation_navs`
WHERE `<nil>_navigation_navs`.`dateDeleted` IS NULL
ORDER BY `sortOrder`
In Command.php line 1299:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'client_test.<nil>_n
avigation_navs' doesn't exist
Something in that onAfterInstall()
method is preventing other plugins from being installed, but I'm not sure exactly which part. I can dig in and start doing more debugging if that's helpful to find out exactly where it's halting the installation of other plugins.
Are you defining CRAFT_TESTS_PATH in tests/_bootstrap.php
Yep, we have all these constants set in our bootstrap:
define('CRAFT_TESTS_PATH', __DIR__);
define('CRAFT_STORAGE_PATH', __DIR__ . '/_craft/storage');
define('CRAFT_TEMPLATES_PATH', __DIR__ . '/_craft/templates');
define('CRAFT_CONFIG_PATH', __DIR__ . '/_craft/config');
define('CRAFT_MIGRATIONS_PATH', __DIR__ . '/_craft/migrations');
define('CRAFT_TRANSLATIONS_PATH', __DIR__ . '/_craft/translations');
define('CRAFT_VENDOR_PATH', dirname(__DIR__) . '/vendor');
Maybe a FR for Craft would be to have some sort of boolean for when the test suite is running. Another option would be checking to see if the environment == test
?
from craft-avatax.
I see. So it's breaking the next plugin install and maybe causes an error because the Navigation plugin didn't run it's migrations or something.
I wasn't sure if the environment was alway set to test
when testing but if that's the case maybe we try adding something like:
if (Craft::$app->config->env === 'test') {
return;
}
... at the top of this function to just bail:
Lines 199 to 204 in 67c93a8
from craft-avatax.
I think so, you can see in the test setup that is sets a default env
value of test
https://github.com/craftcms/cms/blob/develop/src/test/TestSetup.php#L262-L281
And yeah, I think adding a check like that makes sense. Want me to manually add it and test? Would be happy to submit a PR.
from craft-avatax.
Good deal. Yeah if you can test it that would be awesome. Either a PR and I'll merge it or just let me know if the conditional works and I can get it added in and bump the version.
from craft-avatax.
Success, test suite passes! #38
from craft-avatax.
Thanks @davist11! Merged and version bumped.
from craft-avatax.
Awesome, thank you!
from craft-avatax.
Related Issues (20)
- Use Craft Autosuggest fields to support env-based config HOT 1
- 400 Error when validating address with AJAX HOT 3
- Craft Commerce 3.0 Support HOT 4
- Provide setting to select when order is committed HOT 4
- TypeError - Arg 1 passed to validateAddress() must be an instance of craft\commerce\models\Address? HOT 3
- Cannot edit plugin settings HOT 3
- Is this plugin a custom integration? HOT 2
- Invalid address error results in uncaught exception HOT 2
- License Key Value Stored in config/project/project.yaml HOT 5
- Request to avatax.com failed HOT 7
- Cart passing all items as non-taxable HOT 2
- SalesTaxService.php - Request could not be completed HOT 5
- $model is undefined - SalesTaxService.php HOT 1
- Allowing Programmatic Tax Calculation HOT 5
- Error if the order is saved through console command in 2.1.7 version HOT 1
- Guzzle Error HOT 2
- Does this plugin support international fees? (Customs / VAT / etc). HOT 1
- Craftcms 4 compatibility HOT 1
- Commerce V4, Address Validation Fails - Calling Unknown Method SalesTaxService:getState() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft-avatax.