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

chore: add documentation for local test suite #267

Merged
merged 2 commits into from
Mar 9, 2021
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
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,17 @@ Contributions are welcome, and are accepted via pull requests. Please review the
* Please remember that we follow [SemVer](http://semver.org/).

We have [StyleCI](https://styleci.io/) setup to automatically fix any code style issues.


## Tests
The test suite calls Algolia servers to test the storage, updating, and search of records.
If you want to run your tests locally, the test suite needs the `ALGOLIA_APP_ID` and `ALGOLIA_SECRET` variables available in your environment to make these calls.

You can set these variables by, for example, passing them when running the `composer test` command:

```sh
ALGOLIA_APP_ID="yourAppID" ALGOLIA_SECRET="yourAdminAPIKey" composer test
```

Please note that the tests add records and perform operations on your application.
Therefore, it's best to create a separate application with a [free Algolia plan](https://www.algolia.com/pricing/), to ensure the test suite doesn't alter your production data if there are naming collisions, and you don't go over your own plan's limits.
3 changes: 3 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ parameters:
- '#Unsafe usage of new static#'
- '#Method Algolia\\ScoutExtended\\Console\\Commands\\OptimizeCommand::handle\(\) has no return typehint specified.#'
- '#Call to an undefined method Illuminate\\Support\\HigherOrderCollectionProxy::pushSoftDeleteMetadata\(\)#'
- '#Cannot call method withScoutMetadata\(\) on class-string\|object.#'
- '#Cannot call method getScoutKey\(\) on class-string\|object.#'
- '#Cannot call method toSearchableArray\(\) on class-string\|object.#'