Fix test-data: load datasets via utils::data() and fix cols.csv header#12
Open
VincentGuyader wants to merge 1 commit into
Open
Fix test-data: load datasets via utils::data() and fix cols.csv header#12VincentGuyader wants to merge 1 commit into
VincentGuyader wants to merge 1 commit into
Conversation
The tests scanned tests/testthat/data/, which never existed at runtime, so the `datasets` list was always empty. Stricter recycling rules in recent vctrs/purrr made the silent empty-list case fail loudly with "Can't recycle .x (size 0) to match .y (size 2)". Also fix the cols.csv header (row -> col) so cols$col is no longer NULL.
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.
Contexte
La CI était rouge sur les 5 plateformes avec :
```
Error in `map2(names(datasets), rows, ~{ ... })`:
Can't recycle `.x` (size 0) to match `.y` (size 2).
```
Cause
Le test scannait `file.path(getwd(), "data")` — au runtime, `getwd()` est `tests/testthat/`, et il n'y a pas de dossier `data/` à cet endroit. La liste `datasets` était donc toujours vide. Les anciennes versions de `purrr`/`vctrs` toléraient silencieusement `map2(NULL, df, ...)`, mais le recycling 0→N est désormais une erreur dure.
Bonus : `tests/testthat/cols.csv` avait l'en-tête `row,colonne` au lieu de `col,colonne`, donc `cols$col` valait `NULL` — le test n'aurait jamais vraiment vérifié les colonnes même s'il s'était exécuté.
Fix
Test
```