phpunit --configuration phpunit_myapp.xml



我对Gitlab CI/CD有点陌生。。

因此,我一直在遵循这一点来创建一个可工作的cicd,我的yml文件可以很好地使用cicd。但是我想为php版本创建一些测试,但是我现在遇到了一个错误

Running with gitlab-runner 10.8.0 (079aad9e)
on test_cicd runner fe9d0c92
Using Docker executor with image php:7.1 ...
Pulling docker image php:7.1 ...
Using docker image sha256:########## for php:7.1 ...
Running on runner-fe9d0c92-project-19-concurrent-0 via j317456.servers.jiffybox.net...
Fetching changes...
HEAD is now at 9b50afd edit job name
From http://134.119.30.114:10080/Toughblue/wordpress
9b50afd..bebb7da  php_test   -> origin/php_test
Checking out bebb7da2 as php_test...
Skipping Git submodules setup
$ bash ci/docker_install.sh > /dev/null
+ apt-get update -yqq
+ apt-get install git -yqq
debconf: delaying package configuration, since apt-utils is not installed
+ curl --location --output /usr/local/bin/phpunit https://phar.phpunit.de/phpunit.phar
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
Dload  Upload   Total   Spent    Left  Speed
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100   161  100   161    0     0    475      0 --:--:-- --:--:-- --:--:--   476
100 2721k  100 2721k    0     0  4392k      0 --:--:-- --:--:-- --:--:-- 4392k
+ chmod +x /usr/local/bin/phpunit
+ docker-php-ext-install pdo_mysql
$ phpunit --configuration phpunit_myapp.xml
Could not read "phpunit_myapp.xml".
ERROR: Job failed: exit code 1

当我运行管道或更新时,我会收到错误。。我首先想到的是phpunit_myapp.xml在哪里,因为我没有创建它。。如果我必须创建一个文件,甚至如何创建,我没有找到解释该文件应该是什么以及在哪里的东西。所以我想得到一些关于如何解决这个问题的帮助。

任何能为我指明正确方向的帮助都是受欢迎的

  • 首先,当您想要使用这个配置文件时,您需要创建它
  • XML文件包含有关测试内容和可能的配置的信息,例如Bootstrap文件
  • 您可以在没有配置文件的情况下运行phpunit,但需要使用参数

有关详细信息,请访问https://phpunit.readthedocs.io/en/7.1/configuration.html.

最新更新