Scrutinizer: how exclude phpunit (or a not commited file containing api keys?)

156 Views Asked by At

In my phpunit test I require_once an api_key.php that of course I have in my .gitignore (it contains my own api keys).

<?php
namespace Domoticzapi;

use PHPUnit\Framework\TestCase;

require_once('api_key.php');

class ClientTest extends TestCase {
}

Scrutinizer complains with

PHP Warning:  require_once(api_key.php): failed to open stream: No such file or directory in /home/scrutinizer/build/tests/Domoticzapi/ClientTest.php on line 6

How can I exclude this check? Or is there a best approach (other than environment variables that I don't want use)?

1

There are 1 best solutions below

1
On

AFAIK, you need to set your test command on scrutinizer-ci config file to run just the suite test you need, or provide new phpunit config without the suite that contain those test that need api_key.php

refer to this: How to run a specific phpunit xml testsuite? https://scrutinizer-ci.com/docs/build/running_tests_in_parallel