Testing | laravel-responsecache-rust | Spatie       

 SPATIE  

laravel-responsecache-rust
==========================

spatie.be/open-source

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

 Version   v1      

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

  Testing    
- [ Introduction ](https://spatie.be/docs/laravel-responsecache-rust/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-responsecache-rust/v1/support-us)
- [ Installation ](https://spatie.be/docs/laravel-responsecache-rust/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/laravel-responsecache-rust/v1/usage)
- [ Configuration and hooks ](https://spatie.be/docs/laravel-responsecache-rust/v1/configuration-and-hooks)
- [ Testing ](https://spatie.be/docs/laravel-responsecache-rust/v1/testing)
- [ Changelog ](https://spatie.be/docs/laravel-responsecache-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 check --locked --no-default-features
```

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'`.

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.

Database jobs also run key-length regressions against MySQL 8.4 and MariaDB 11.8 using the native database cache store and `VARCHAR(255)` primary keys. SQLite runs the same cases with an explicit length constraint because SQLite does not enforce `VARCHAR` lengths. Cases include unprefixed and 152-byte-prefixed stores, tags, long custom hashes, admission counters and stale-refresh metadata and locks.

To run the external database test locally, set `RESPONSE_CACHE_MYSQL_URL` to a disposable database, using `mysql://` for MySQL or `mariadb://` for MariaDB, then run:

```
cargo test --locked --test database_keys -- --include-ignored
```

The test creates and drops uniquely named tables. It is ignored in ordinary local test runs; the database CI jobs explicitly include it. Never point it at a production database.

Integration tests create real framework applications and disposable SQLite databases. They send requests through the actual middleware/router, not a simulated request wrapper. They cover guest caching, expiry, invalidation isolation, native per-user partitions, request key distinctions, custom response policies and binary replay. Session form tests rotate CSRF tokens, check fresh and stale hits, and submit through the native CSRF middleware with both valid and old tokens. They verify guest sessions share markup without sharing tokens and targeted invalidation preserves other users' entries. They need no production credentials or services. The hook suite adapts upstream profile, hasher, tagging, command, replacer, minimum-request, and debug-header cases. It also tests native event fakes and actual container overrides through HTTP requests. Flexible-cache tests coordinate background refreshes and check fresh, stale, expired, and ineligible responses. No model or job is owned by this package. Cargo's registry packaging cannot resolve the unpublished Git-only package-tools dependency. Use the pinned Git source or a local checkout. Publishing and deployments are not part of these checks.

 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)
