Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: improve tests execution time #1041

Merged
merged 3 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/references/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,16 @@ class ActionsTest extends TestCase
}
}
```

## Improving the Speed of Running Tests

By default, Shield has set the `Config\Auth::$hashCost = 12` due to the greater security of passwords. However, to increase the test execution time, we have set the `$hashCost = 4` for the test environment.

If you use Shield in your project and your tests execution time is high, just set the `$hashCost = 4` in file **phpunit.xml.dist** of your project as follows:

```
<php>
<!-- Set hashCost for improving the speed of running tests -->
<env name="auth.hashCost" value="4"/>
</php>
```
2 changes: 2 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@

<php>
<env name="XDEBUG_MODE" value="coverage"/>
<!-- Set hashCost for improving the speed of running tests -->
<env name="auth.hashCost" value="4"/>
<server name="app.baseURL" value="https://example.com/"/>

<!-- Directory containing phpunit.xml -->
Expand Down
Loading