Testing | laravel-site-search-rust | Spatie       

 SPATIE  

laravel-site-search-rust
========================

spatie.be/open-source

  [Docs](https://spatie.be/docs)  [Laravel-site-search-rust](https://spatie.be/docs/laravel-site-search-rust/v1)  Testing

 Version   v1      

 Other versions for crawler [v1](https://spatie.be/docs/laravel-site-search-rust/v1) 

  Testing    
- [ Introduction ](https://spatie.be/docs/laravel-site-search-rust/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-site-search-rust/v1/support-us)
- [ Installation ](https://spatie.be/docs/laravel-site-search-rust/v1/installation-and-setup)
- [ Application integration ](https://spatie.be/docs/laravel-site-search-rust/v1/application-integration)
- [ Usage ](https://spatie.be/docs/laravel-site-search-rust/v1/usage)
- [ Testing ](https://spatie.be/docs/laravel-site-search-rust/v1/testing)
- [ Changelog ](https://spatie.be/docs/laravel-site-search-rust/v1/changelog)

 Testing
=======

Run these checks from the package directory:

```
cargo fmt --all -- --check
cargo clippy --locked --all-targets --all-features -- -D warnings
cargo test --locked --all-targets --all-features
cargo test --locked --doc --all-features
cargo doc --locked --no-deps --all-features
cargo package --locked --list
```

The package inventory check does not publish or normalize the Git-only package-tools dependency into a crates.io dependency. Archive verification through `cargo package` is not supported with that unpublished dependency; source compilation is checked above.

Set `RUSTDOCFLAGS` to `-D warnings` when running the documentation commands. In POSIX shells, prefix each command with `RUSTDOCFLAGS='-D warnings'`. In PowerShell, first run `$env:RUSTDOCFLAGS = '-D warnings'`.

- Clippy denies warnings in CI, including selected pedantic checks for error documentation, retained fluent builders and simpler `Option` handling.
- Ownership checks also flag redundant clones and needless collections. The full pedantic group is not enabled; it adds test-style and numeric-cast warnings that need separate judgment.
- Public errors retain typed causes and managed crawl errors remain inspectable after releasing the native cache lock.

README.md and all Markdown pages in docs/ participate in rustdoc tests. Setup lines prefixed with `# ` compile and execute but are hidden in rendered rustdoc. Assertions check the examples' results.

Check the minimum supported Rust version:

```
rustup toolchain install 1.99.0 --profile minimal
cargo +1.99.0 test --locked --all-targets --all-features
cargo +1.99.0 test --locked --doc --all-features
```

Check security advisories:

```
cargo install cargo-audit --locked
cargo audit
```

CI runs stable checks on Linux, macOS and Windows, and the MSRV and audit checks on Linux. An audit requires access to the RustSec advisory database.

The integration suite starts HTTP servers bound to ephemeral loopback ports. SQLite databases live in disposable directories. It checks actual ranked query values, selector/URL/header exclusions, archived-page removal, decoded query keys and retained query values, index isolation, incomplete-crawl safety, and persistence across separate CLI processes. It never visits a production site.

Native `#[laravel::test]` cases run provider migrations, commands, saved-model jobs, container-selected profiles/indexers and custom jobs with the framework's queue and event fakes. Extraction, anchored snippets, driver pagination and transactional rollback cases are adapted from the PHP test suite.

`tests/drivers.rs` also tests native database full-text prefixes, SQLite/PostgreSQL stemming, blank-query browsing, pagination, index isolation and rollback. Set `SITE_SEARCH_TEST_DATABASE_URL` and include `--test drivers` when running against a disposable MySQL/PostgreSQL database; CI does this for both.

To exercise remote task processing, filters, atomic swaps and failed refreshes, start disposable Meilisearch 1.59 and set `SITE_SEARCH_TEST_MEILISEARCH_URL`, then run `cargo test --locked --all-features --test meilisearch`. Without this variable that test skips remote work. CI supplies a real Meilisearch service. Never use an existing production Meilisearch instance: the test creates and deletes indexes.

To run the crawl/ranking/refresh/large-page cases against a disposable server database, set `SITE_SEARCH_TEST_DATABASE_URL` to a database owned by the test process, then run `cargo test --locked --all-features --test site_search -- --test-threads=1`. These cases create the search tables and replace named test indexes. Never supply an application or production database. Scope, redirect, and CLI-process cases still exercise their own disposable SQLite databases. CI runs the server cases against MySQL 8.4 and PostgreSQL 17.

 A good
match?
-------------

### What we do best

- All things Laravel
- Custom frontend components
- Building APIs
- AI-powered features
- Simplifying things
- Clean solutions
- Integrating services

### Not our cup of tea

- WordPress themes
- Cutting corners
- Free mockups to win a job
- "Just execute the briefing"

 In short: we'd like to be a **substantial part** of your project.

 [ Get in touch via email ](mailto:info@spatie.be?subject=A%20good%20match%21&body=Tell%20us%20as%20much%20as%20you%20can%20about%0A-%20your%20online%20project%0A-%20your%20planning%0A-%20your%20budget%0A-%20%E2%80%A6%0A%0AAnything%20that%20helps%20us%20to%20start%20straightforward%21)
