Skip to content

Stage 6: Integration tests (new tests/ dir, end-to-end workflows) (tracking #391) #397

Description

@Mec-iS

Tracking issue: #391 — Improve test coverage significantly (staged plan).

Scope

Create a top-level tests/ directory for end-to-end integration tests. This is the largest structural coverage gap: the crate currently has zero integration tests (all 311 existing tests are inline unit tests). Cargo.toml already excludes tests/ from the published package, so this is safe.

Tasks

  • Create tests/ directory at repo root.
  • One integration test file per estimator family, each exercising a full workflow (load dataset → preprocess → train → predict → evaluate):
    • tests/linear_workflow.rsLinearRegression / LogisticRegression / RidgeRegression end-to-end.
    • tests/tree_workflow.rsDecisionTreeClassifier / DecisionTreeRegressor.
    • tests/ensemble_workflow.rsRandomForestClassifier / RandomForestRegressor.
    • tests/svm_workflow.rsSVC / SVR with at least two kernels.
    • tests/naive_bayes_workflow.rs — all four NB variants.
    • tests/neighbors_workflow.rsKNNClassifier / KNNRegressor.
    • tests/cluster_workflow.rsDBSCAN / KMeans.
    • tests/decomposition_workflow.rsPCA / SVD fit → transform → reconstruct.
    • tests/preprocessing_workflow.rsOneHotEncoder + StandardScaler in a pipeline.
    • tests/model_selection_workflow.rstrain_test_split → fit → cross_validate → score.
  • Each workflow test should assert non-trivial outcomes (e.g., accuracy above a sane threshold, reconstruction error near zero) rather than just "it runs".
  • Gate dataset-dependent tests behind #[cfg(feature = "datasets")]; provide tiny inline fixtures for the no-feature path where possible.

Verification

  • cargo test --all-features (integration tests run as part of the suite)
  • cargo fmt --all -- --check
  • cargo clippy --all-features -- -Drust-2018-idioms -Dwarnings

Do you want to work on this issue?

yes — PR will target development.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions