test: nettoyage de la suite - doublon, ecritures cwd, test mort, assertions vides#57
Merged
Merged
Conversation
- doublon octet pour octet supprime (test-key-parameter 249-293) - plus aucune ecriture dans le repertoire courant : tempfile() + on.exit(unlink()) partout (politique CRAN, deja revendiquee par le NEWS 0.4.4) - fixtures orphelines rules.yaml / test.yaml supprimees (referencees par aucun test) - test-huge-parquet.R inexecutable partout (skip + chemins Windows en dur) deplace vers dev/manual-tests/ - test-extraction-params : les expect_ conditionnels silencieux assertent d'abord leur precondition (un check de cap ne peut plus passer a vide) - tests unitaires directs des petits helpers (format_key_examples, get_col_names, is_non_local/is_arrow, branche file = NULL du rapport) Non fait sciemment (documente NEWS) : la compression des redondances (-30% vise par l'issue) - refactoring a fort churn de tests verts, passe dediee.
There was a problem hiding this comment.
Pull request overview
This PR cleans up the {testthat} suite to address issue #31: removing duplicated tests/fixtures, eliminating writes to the working directory (CRAN policy), hardening previously-vacuous assertions, and adding direct unit coverage for small helper functions.
Changes:
- Replace fixed-name YAML writes in tests with
tempfile()+on.exit(unlink(...), add = TRUE)and remove the byte-for-byte duplicate block intest-key-parameter.R. - Remove orphan YAML fixtures and strengthen extraction-parameter tests so assertions can’t silently skip.
- Move the “huge parquet” test into
dev/manual-tests/and add new direct unit tests for internal helpers; updateNEWS.md.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test.yaml | Removes an orphan committed YAML fixture (no longer referenced). |
| tests/testthat/rules.yaml | Removes an orphan committed YAML fixture (no longer referenced). |
| tests/testthat/test-key-parameter.R | Uses tempfile()/on.exit(unlink()) for YAML paths and removes the duplicated test block. |
| tests/testthat/test-internal-helpers.R | Adds direct unit tests for small helper functions and file = NULL report branch. |
| tests/testthat/test-input-validation.R | Replaces fixed working-directory paths with temp paths and cleans up the one case that creates a file. |
| tests/testthat/test-extraction-params.R | Replaces conditional/vacuous assertions with unconditional checks + explicit preconditions. |
| NEWS.md | Documents the test-suite cleanup work for issue #31. |
| dev/manual-tests/huge-parquet.R | Adds a manual “huge parquet” stress test script (now outside the automated suite). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #31
Nettoyage
get_first_n,sample_n) assertent d'abord leur precondition (expect_gt(length(extracts), 0)) au lieu de passer a vide si l'extraction ne produit rien ; les casextract_failed = FALSEgardent l'assertion inconditionnelle de total nul (0 extrait y est un resultat valide)file = NULLdu rapportNon fait sciemment (documente dans NEWS)
La compression des redondances visee par l'issue (IEEE 754 en 7 exemplaires, doublons de tests de cles en 3 fichiers, ~-30%) : refactoring a fort churn de tests verts, passe dediee.
Suite complete : 1023 PASS / 0 FAIL / 0 SKIP. Check --as-cran 0 erreur / 0 warning.
Review interne
pr-reviewer : REQUEST CHANGES applique (une ecriture cwd oubliee a test-input-validation.R:107, precisement le cas qui CREE le fichier).