#Very Slow After Formatting Dev Enviroment

2 messages · Page 1 of 1 (latest)

ancient matrix
#

Just moved from ubuntu to fedora as my work operating system. On an existing project I am trying to get testing working again. I am using laravel sail as well.

Laravel Framework 10.48.14
PHPUnit 10.5.24 by Sebastian Bergmann and contributors.

Testing is working however its horribly slow, even migrating seems to be taking quite a long time. This is my docker-compose.yml

version: '3.9' # Updated to the latest supported version
services:
    laravel.test:
        build:
            context: ./vendor/laravel/sail/runtimes/8.2
            dockerfile: Dockerfile
            args:
                WWWGROUP: '${WWWGROUP}'
        image: sail-8.2/app
        extra_hosts:
            - 'host.docker.internal:host-gateway'
        ports:
            - '${APP_PORT:-80}:80'
            - '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
        environment:
            PHP_IDE_CONFIG: "serverName=Docker"
            WWWUSER: '${WWWUSER}'
            LARAVEL_SAIL: 1
            XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
            XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
        volumes:
            - '.:/var/www/html'
        networks:
            - sail
        depends_on:
            - redis
            - mailpit
            - mysql
    redis:
        image: 'redis:alpine'
        ports:
            - '${FORWARD_REDIS_PORT:-6379}:6379'
        volumes:
            - 'sail-redis:/data'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "redis-cli", "ping"]
            retries: 3
            timeout: 10s # Increased timeout to ensure compatibility
    mailpit:
        image: 'axllent/mailpit:latest'
        ports:
            - '${FORWARD_MAILPIT_PORT:-1025}:1025'
            - '${FORWARD_MAILPIT_DASHBOARD_PORT:-8025}:8025'
        networks:
            - sail
    mysql:
        image: 'mysql/mysql-server:8.0'
        platform: 'linux/x86_64'
        ports:
            - '${FORWARD_DB_PORT:-3306}:3306'
        environment:
            MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ROOT_HOST: '%'
            MYSQL_DATABASE: '${DB_DATABASE}'
            MYSQL_USER: '${DB_USERNAME}'
            MYSQL_PASSWORD: '${DB_PASSWORD}'
            MYSQL_ALLOW_EMPTY_PASSWORD: 1
        volumes:
            - 'sail-mysql:/var/lib/mysql'
            - './vendor/laravel/sail/database/mysql/create-testing-database.sh:/docker-entrypoint-initdb.d/10-create-testing-database.sh'
        networks:
            - sail
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
            retries: 3
            timeout: 10s # Increased timeout to ensure compatibility
networks:
    sail:
        driver: bridge
volumes:
    sail-mariadb:
        driver: local
    sail-redis:
        driver: local
    sail-mysql:
        driver: local

I created a test

    function it_can_query_notifications()
    {
        dump(now());
        dd(now());
     }

Any my testcase


abstract class TestCase extends BaseTestCase
{
    use CreatesApplication;
    use RefreshDatabase;
    protected function setUp(): void
    {
        parent::setUp();
    }
}

That test to run with the command takes 1 minute to run

vendor/bin/phpunit --filter it_can_query_notifications
next wigeon
#

Are you running this command inside the container? Or just on your host machine