Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LADACACHE_ENABLED=false should block redis initialt at all. #129

Open
zgetro opened this issue Nov 9, 2024 · 2 comments
Open

LADACACHE_ENABLED=false should block redis initialt at all. #129

zgetro opened this issue Nov 9, 2024 · 2 comments

Comments

@zgetro
Copy link

zgetro commented Nov 9, 2024

while executing test case it should not initiate redis as enviromet not need redis and with ladacache it force user to add redis in testing environment (CICD)

<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
         backupStaticAttributes="false"
         bootstrap="vendor/autoload.php"
         colors="true"
         convertErrorsToExceptions="true"
         convertNoticesToExceptions="true"
         convertWarningsToExceptions="true"
         processIsolation="false"
         stopOnFailure="false">
    <testsuites>
        <testsuite name="Feature">
            <directory suffix="Test.php">./tests/Feature</directory>
        </testsuite>

        <testsuite name="Unit">
            <directory suffix="Test.php">./tests/Unit</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist processUncoveredFilesFromWhitelist="true">
            <directory suffix=".php">./app</directory>
        </whitelist>
    </filter>
    <php>
        <env name="APP_ENV" value="testing"/>
        <env name="CACHE_DRIVER" value="array"/>
        <env name="SESSION_DRIVER" value="array"/>
        <env name="QUEUE_DRIVER" value="sync"/>
        <env name="DB_CONNECTION" value="sqlite"/>
        <env name="DB_DATABASE" value=":memory:"/>
        <env name="LADACACHE_ENABLED" value="false"/>
        <env name="LOG_CHANNEL" value="single"/>
        <env name="BUGSNAG_API_KEY" value=""/>
    </php>
</phpunit>

it cost more in pipline to setup redis instance which not usefull application at all. it's tiny change but my contribute to reduce carbon emissions 🌳🌳

suggest me your opinion. @spiritix

@zgetro
Copy link
Author

zgetro commented Nov 9, 2024

Still check on LADACACHE_ENABLED is better solution but don't know conflicts it so i have checked on APP_ENV.

boot .env.testing

php artisan optimize --env=testing

to check what is currnet env

php artisan env

re compilation.

php artisan clear-compiled --env=testing

@spiritix
Copy link
Owner

Using LADA_CACHE_ACTIVE=false should work, even with Redis disabled

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

No branches or pull requests

2 participants