Skip to content

Clean up test-generated artifacts tracked in git#741

Open
milton-minervino wants to merge 4 commits into
MAIF:masterfrom
milton-minervino:fix/tests-artifacts
Open

Clean up test-generated artifacts tracked in git#741
milton-minervino wants to merge 4 commits into
MAIF:masterfrom
milton-minervino:fix/tests-artifacts

Conversation

@milton-minervino

Copy link
Copy Markdown
Collaborator

Unit tests were leaking build/test artifacts into the repo instead of using ephemeral storage.

  • test_load_smartpredictor_1 wrote its round-trip pickle directly into the tracked tests/data/ directory, keyed by interpreter version (predictor_to_load_<pyver>.pkl) — every Python version bump left a new untracked file. Fixed to use tempfile.TemporaryDirectory(), matching the pattern already used by the neighboring TestSmartPredictorManifest test.
  • Removed three now-dead pickled predictor fixtures (predictor_to_load_{38,39,310}.pkl) that were accidental commits from past interpreter upgrades and weren't read by any test.
  • Widened the catboost_info/ gitignore pattern (was root-anchored /catboost_info/) so it also matches the catboost_info/ dumps CatBoost writes when executing tutorial notebooks (e.g. tutorial/generate_webapp/, tutorial/plots_and_charts/), not just one at the repo root.
  • Removed a stray empty test file at the repo root.

No production code changes; tests/data/metadata.yaml, clean_titanic.pkl, and clean_titanic_pandas_3.pkl were confirmed to be genuine input fixtures (read-only, loaded by multiple tests) and left untouched. XGBoost/LightGBM were checked and confirmed not to write similar disk artifacts on .fit(), so no further gitignore changes were needed there.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

pytest: all tests passed, no leaked artifacts.

Test Configuration:

  • OS: Linux
  • Python version: 3.13.13
  • Shapash version: 2.9.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant