pharmaverse / pharmaverse/logrx
Fragile tests relying on exact messaging of lintr output
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 48
- Forks
- 12
- Avg merge
- 20d 8h
- Merged PRs (30d)
- 1
Description
What happened?
These two tests break under the current development version of R which is in the process of being released to CRAN:
https://github.com/pharmaverse/logrx/blob/f6c24f87829d1d78d63801ab942baf367eb27625/tests/testthat/test-get.R#L181-L189
https://github.com/pharmaverse/logrx/blob/f6c24f87829d1d78d63801ab942baf367eb27625/tests/testthat/test-writer.R#L199-L209
In general, I try and avoid relying on fragile things like "the exact wording of an error message produced by an upstream package".
For example, in {data.table}, we have this list of messages/message factories for test outputs that come directly from {base} R:
I will submit a quick-fix PR shortly, but it's worth thinking through a more robust way to structure these tests going forward.
Session Information
No response
Reproducible Example
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tests/testthat/test-get.R lines 181-189 and tests/testthat/test-writer.R lines 199-209, then inspect how the tests assert lintr output and compare the upstream-message examples linked in the issue. The work is done when both tests remain valid across the current R release without depending on exact upstream error wording.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100