我正在尝试使用 Scrutinizer 获取 Laravel 项目的 PHPUnit代码覆盖率。
但是当我在配置文件的这一行安排检查时,进程块。
mysql -uroot -e "CREATE DATABASE IF NOT EXISTS scrutinize"
我不断收到这个错误。
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
这是.scrutinizer.yml配置文件的内容。
filter:
excluded_paths:
- "tests/"
- "public/"
- "resources/js/vendor/"
- "database/"
dependency_paths:
- "vendor/"
checks:
php:
remove_extra_empty_lines: true
remove_php_closing_tag: true
remove_trailing_whitespace: true
fix_use_statements:
remove_unused: true
preserve_multiple: false
preserve_blanklines: true
order_alphabetically: true
#fix_php_opening_tag: true
fix_linefeed: true
fix_line_ending: true
fix_identation_4spaces: true
#fix_doc_comments: true
build:
image: default-bionic
environment:
php:
version: 8.1.2
services:
mysql: 5.7
nodes:
analysis:
tests:
override:
- php-scrutinizer-run
- js-scrutinizer-run
coverage:
tests:
before:
- command: 'cp .env.example .env'
- command: "mysql -e 'create database scrutinizer;'"
override:
- command: './vendor/bin/phpunit --coverage-clover=build/logs/clover.xml'
coverage:
file: build/logs/clover.xml # <- Set this to where we find the coverage data.
# The path is relative to the current directory.
format: clover
我检查了 Scrutinizer 文档,但找不到有用的东西来解决这个问题。
我错过了什么?