beyondcode / beyondcode/invoker-community

[Bug]: Does not like Test items in production

Open
#240 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
76
Forks
1
PR merge metrics
No merged PRs in 30d

Description

### Operating system

Linux

### Laravel Version

v8.55.0

### PHP Version

7.4.22

### Project Location

Remote (Server)

### Bug description

We have some console commands that we run during local development which create fake models for us to test with. Such as fake users. These commands use a few traits from our tests to create some of these resources.

These commands are in a folder and gated in the Kernel from being accessible in prod.

```php
protected function commands()
{
$paths = [
__DIR__.'/Commands/Production',
];

if (app()->runningUnitTests() || app()->environment('local')) {
$paths[] = __DIR__.'/Commands/Local';
}

$this->load($paths);

require base_path('routes/console.php');
}
```

If I run Invoker locally no issue. If I run over SSH on the server, I get an error saying that those test traits cannot be seen by reflection. My guess is that you have it set up to ignore the tests folder if in production.

Maybe we can find a way to not have that happen when doing live, like a config setting? Or maybe a ignore directory configuration so I can exclude those?

### Steps to reproduce

_No response_

### Relevant log output

```shell
**Error**:

In IdentifierNotFound.php line 23:

_HumbugBox3dffbad5cee1\Roave\BetterReflection\Reflection\ReflectionClass "T
ests\Support\CreatesModels" could not be found in the located source
```
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.