Skip to content

Create workspace fixture for behavioural testing of lint exclusion #111

@coderabbitai

Description

@coderabbitai

Context

PR #109 introduces configurable exclusions for the no_std_fs_operations lint via dylint.toml configuration. Crates listed in excluded_crates should skip diagnostics during lint execution.

Testing Gap

Unit tests comprehensively cover:

  • Configuration parsing and deserialisation
  • Exclusion matching logic (is_excluded)
  • Configuration loading with error handling

However, no behavioural/integration tests verify that excluded crates actually skip diagnostics during lint execution. The current dylint_testing UI harness determines the crate name internally and cannot be controlled, preventing end-to-end validation of exclusion behaviour.

Proposed Solution

Create workspace fixture infrastructure to enable integration testing:

  1. Fixture workspace structure: Create test fixtures under tests/fixtures/ with controlled workspace layouts, including:

    • A fixture crate that uses std::fs operations
    • A dylint.toml configuration with exclusions
    • Cargo.toml configurations for multiple test scenarios
  2. Integration test harness: Implement tests using std::process::Command to:

    • Build and run the lint against fixture projects
    • Parse compiler output to count diagnostics
    • Assert that excluded crates produce zero diagnostics
    • Assert that non-excluded crates produce expected diagnostics
  3. Test coverage: Validate both behaviours:

    • Crate in excluded_crates → no diagnostics
    • Crate not in excluded_crates → diagnostics emitted

References

Notes

This infrastructure will benefit future lint development by enabling end-to-end testing of configuration-driven behaviour across the Whitaker lint suite.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions