Skip to content

test: nettoyage de la suite - doublon, ecritures cwd, test mort, assertions vides#57

Merged
VincentGuyader merged 1 commit into
audit-0.4.10from
tests/issue-31-suite-cleanup
Jul 3, 2026
Merged

test: nettoyage de la suite - doublon, ecritures cwd, test mort, assertions vides#57
VincentGuyader merged 1 commit into
audit-0.4.10from
tests/issue-31-suite-cleanup

Conversation

@VincentGuyader

Copy link
Copy Markdown
Member

Closes #31

Nettoyage

  • Doublon octet pour octet supprime : le bloc « uses key parameter over YAML rules » existait deux fois dans test-key-parameter.R (diff du parent verifie par la review : aucune assertion unique perdue)
  • Plus aucune ecriture dans le repertoire courant : tempfile() + on.exit(unlink()) partout (politique CRAN, deja revendiquee par le NEWS 0.4.4 mais 8 sites y derogeaient ; 2 survivants attrapes par les reviews interne et Copilot des PRs precedentes)
  • Fixtures orphelines tests/testthat/rules.yaml et test.yaml supprimees (referencees par aucun test)
  • test-huge-parquet.R inexecutable partout (skip inconditionnel + chemins Windows en dur) deplace vers dev/manual-tests/ : la suite affiche desormais 0 SKIP
  • Assertions conditionnelles vides durcies dans test-extraction-params.R : les caps (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 cas extract_failed = FALSE gardent l'assertion inconditionnelle de total nul (0 extrait y est un resultat valide)
  • Tests unitaires directs des petits helpers jusqu'ici couverts uniquement par ricochet : format_key_examples (troncature), get_col_names, is_non_local/is_arrow, branche file = NULL du rapport

Non 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).

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in test-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; update NEWS.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.

@VincentGuyader
VincentGuyader merged commit fe063f6 into audit-0.4.10 Jul 3, 2026
7 checks passed
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.

2 participants