Skip to content

php_network_getaddresses Name or service not know #21

@chinleung

Description

@chinleung

I've taken the files from the example and it keeps giving me this:

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name o  
  r service not known

Here's the .gitlab-ci

stages:
  - build
  - test

# Variables
variables:
  MYSQL_ROOT_PASSWORD: root
  MYSQL_USER: root
  MYSQL_PASSWORD: secret
  MYSQL_DATABASE: test
  DB_HOST: mysql
  DB_CONNECTION: mysql

build:
  stage: build
  services:
     - mysql:5.7

  image: chilio/laravel-dusk-ci:stable
  script:
    - composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts
    # - npm install # if you need to install additional modules from your projects package.json
    # - npm run dev # if you need to run dev scripts for example laravel mix 
  cache:
      key: ${CI_BUILD_REF_NAME}
      paths:
        # these are only examples, you should modify them according to your project, 
        # or remove cache routines entirely, if they are causing any problems on your next builds..
        # below are 2 safe ones if you use composer install and npm install in your stage script
        - vendor
        - node_modules
         # - /resources/assets/vendors  # for example if you put your vendor node-libraries there

test:
  stage: test
  cache:
    key: ${CI_BUILD_REF_NAME}
    paths:
      - vendor
      - node_modules
    policy: pull
    
  services:
    - mysql:5.7

  image: chilio/laravel-dusk-ci:stable
  script:
    - cp .env.example .env
    # - cp phpunit.xml.ci phpunit.xml # if you are using custom config for your phpunit tests in CI
    - configure-laravel
    - start-nginx-ci-project
    - ./vendor/phpunit/phpunit/phpunit -v --coverage-text --colors --stderr
    # - phpunit -v --coverage-text --colors --stderr # if you want to use preinstalled phpunit
    - php artisan dusk --colors --debug

  artifacts:
    paths:
      - ./storage/logs # for debugging
      - ./tests/Browser/screenshots
      - ./tests/Browser/console
    expire_in: 7 days
    when: always

And my .env.example:

APP_NAME="Testing"
APP_ENV=testing
APP_DEBUG=true
APP_URL=http://localhost
APP_KEY=

DB_HOST=mysql
DB_DATABASE=test
DB_USERNAME=root
DB_PASSWORD=secret

CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
MAIL_DRIVER=log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions