Testing | laravel-schedule-monitor-rust | Spatie       

 SPATIE  

laravel-schedule-monitor-rust
=============================

spatie.be/open-source

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

 Version   v1      

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

  Testing    
- [ Introduction ](https://spatie.be/docs/laravel-schedule-monitor-rust/v1/introduction)
- [ Support us ](https://spatie.be/docs/laravel-schedule-monitor-rust/v1/support-us)
- [ Installation ](https://spatie.be/docs/laravel-schedule-monitor-rust/v1/installation-and-setup)
- [ Usage ](https://spatie.be/docs/laravel-schedule-monitor-rust/v1/usage)
- [ Monitoring and Oh Dear ](https://spatie.be/docs/laravel-schedule-monitor-rust/v1/monitoring)
- [ Testing ](https://spatie.be/docs/laravel-schedule-monitor-rust/v1/testing)
- [ Changelog ](https://spatie.be/docs/laravel-schedule-monitor-rust/v1/changelog)
- [ Customization ](https://spatie.be/docs/laravel-schedule-monitor-rust/v1/customization)
- [ Registering application commands ](https://spatie.be/docs/laravel-schedule-monitor-rust/v1/scheduled-commands)

 Testing
=======

###  On this page 

1. [ Database isolation ](#content-database-isolation)

1. Run formatting, strict Clippy, tests and rustdoc 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
```

- Set `RUSTDOCFLAGS` to `-D warnings` for documentation checks. In POSIX shells, prefix commands with `RUSTDOCFLAGS='-D warnings'`. In PowerShell, set `$env:RUSTDOCFLAGS = '-D warnings'` first.
- Clippy includes selected pedantic checks for error documentation, ownership, numeric conversion and allocation. It does not impose a line limit on readable integration scenarios or schema declarations.
- README.md and every Markdown guide run as doctests. Rustdoc hides `# ` setup lines but compiles and executes them. Examples assert their results.

2. Verify the local archive with the same unpublished package-tools revision as the manifest:

```
cargo package --locked --allow-dirty --config 'patch.crates-io.spatie-laravel-package-tools.git="https://github.com/spatie/laravel-package-tools-rust"' --config 'patch.crates-io.spatie-laravel-package-tools.rev="f6bd3392e3376617a7835b898d9b4daeae54bf55"'
```

- This compiles the extracted archive without publishing either package. Cargo strips Git sources from registry archives, so the patch is required.
- Keep the verification revision aligned with `Cargo.toml` when updating package-tools.

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

4. Check security advisories:

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

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

Database isolation
--------------------------------------------------------------------------------------------------------------

- The ordinary suite uses file-backed SQLite, including incompatible-table sentinels and configured-table Oh Dear loopback requests.
- The MySQL CI job uses MySQL 8.4. It checks that migration, sync, successful and failing commands, health reads and pruning preserve original source tables and sentinel rows.

To run that test locally, set `SCHEDULE_MONITOR_TEST_DATABASE_URL` to a new empty disposable database, then run:

```
cargo test --locked --all-features --test scheduler isolated_mysql_storage_preserves_original_source_ddl_and_rows -- --ignored --exact
```

- Use `mysql://` for MySQL or `mariadb://` for MariaDB so the framework selects the correct grammar.
- The test refuses an existing source table and leaves fixture tables behind. Use only a new, disposable database.
- It does not drop tables or run application backups, crawls or external monitor calls.
- The ordinary suite ignores this test because it needs a database service. CI invokes it separately.

 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)
