0

This is my configuration for Scrutinizer instances :

build:
dependencies:
    before:
        - psql -c 'CREATE DATABASE db_name WITH OWNER scrutinizer;'
        - psql -c "ALTER ROLE postgres WITH PASSWORD 'postgres'"
        - psql -c 'GRANT ALL PRIVILEGES ON DATABASE "db_name" to postgres'
        - cp .env.example .env
project_setup:
    override:
        - true
environment:
    php:
        version: 7.0.6
    node: 4.0
    variables:
        APP_KEY: 'app_key'
        BUGSNAG_API_KEY: 'test'
tests:
    override:
        -   
            command: vendor/bin/phpunit -v --debug --coverage-clover=my-coverage-file --configuration phpunit.xml
            coverage:
                file: my-coverage-file
                format: php-clover

checks: php: code_rating: true duplication: true

but i can not access psql with user postgres, any ideas ?

Access denied for user 'postgres'@'localhost' (using password: YES) 
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
bizzr3
  • 1,925
  • 4
  • 24
  • 37

1 Answers1

0

Resolution:

SC can not determine the .env or phpunit.xml in this case, so i have to specify it in my web Test Case setup method:

    putenv('DB_DATABASE=db_name');
    putenv('DB_USERNAME=postgres');
    putenv('DB_PASSWORD=postgres');
    putenv('DB_CONNECTION=pgsql');
    putenv('DB_PORT=5432');

the most important variable is DB_CONNECTION.

bizzr3
  • 1,925
  • 4
  • 24
  • 37