{"id":21716549,"url":"https://github.com/cynkra/lazytest","last_synced_at":"2025-06-20T06:35:02.658Z","repository":{"id":66206634,"uuid":"600722969","full_name":"cynkra/lazytest","owner":"cynkra","description":"Runs only failing tests","archived":false,"fork":false,"pushed_at":"2025-05-03T05:46:50.000Z","size":2482,"stargazers_count":34,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-13T17:06:07.297Z","etag":null,"topics":["r","testthat"],"latest_commit_sha":null,"homepage":"https://lazytest.cynkra.com/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cynkra.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-12T11:55:24.000Z","updated_at":"2025-05-03T05:44:01.000Z","dependencies_parsed_at":"2023-11-06T06:33:06.402Z","dependency_job_id":"bb877cb0-ea50-42de-b58f-e0aca71c5990","html_url":"https://github.com/cynkra/lazytest","commit_stats":null,"previous_names":[],"tags_count":72,"template":false,"template_full_name":null,"purl":"pkg:github/cynkra/lazytest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynkra%2Flazytest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynkra%2Flazytest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynkra%2Flazytest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynkra%2Flazytest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cynkra","download_url":"https://codeload.github.com/cynkra/lazytest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynkra%2Flazytest/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260896273,"owners_count":23078981,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","testthat"],"created_at":"2024-11-26T01:11:57.994Z","updated_at":"2025-06-20T06:34:57.645Z","avatar_url":"https://github.com/cynkra.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: downlit::readme_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n\npkgload::load_all()\n```\n\n\n# lazytest\n\n\u003c!-- badges: start --\u003e\n[![R-CMD-check](https://github.com/cynkra/lazytest/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/cynkra/lazytest/actions/workflows/R-CMD-check.yaml)\n[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)\n[![CRAN status](https://www.r-pkg.org/badges/version/lazytest)](https://CRAN.R-project.org/package=lazytest)\n\u003c!-- badges: end --\u003e\n\n```{r}\nlibrary(lazytest)\n```\n\nThe goal of lazytest is to save development time by helping you rerun only the tests that have failed during the last run.\nIt integrates tightly with the testthat package and provides the `lazytest_local()` function, a drop-in replacement for `testthat::test_local()`, that \n\n- memoizes which tests have failed;\n- runs only those tests in subsequent runs.\n\nIf all active tests have succeeded, the entire test suite is run in a second pass.\n\n## Usage\n\nCall `lazytest_local()` instead of `testthat::test_local()` or `devtools::test()`:\n\n```{r, eval = FALSE}\nlazytest::lazytest_local()\n```\n\nThe package also provides RStudio add-ins that run the tests in a new terminal.\nUnfortunately, the \"Test package\" command is hard-wired to `devtools::test()`, and there seems to be no way to customize it or hook into it.\n\n## Example\n\n```{r child=\"man/rmd/lazytest_local.Rmd\"}\n\n```\n\n## How does it work?\n\n`testthat::test_local()` returns an object from which the tests that have failed can be retrieved.\n`lazytest_local()` wraps this function.\nIf tests have failed, a file named `.lazytest` is written in the package directory.\nIn the next call, if `.lazytest` exists, it is consulted, and a suitable `filter` argument is constructed and passed to `testthat::test_local()`.\n\nWhen all tests have passed and not all tests were run, a second call to `testthat::test_local()` is initiated, to make sure that no failures have been introduced in the meantime.\n\nThe presence of a `.lazytest` file in the package source indicates that the last test run has failed somewhere.\nYou should not need to gitignore or Rbuildignore it: you should fix the reason behind the test failure, then run tests again, before committing to your repository's default branch for instance.\n\n## Installation and optional setup\n\nYou can install the development version of lazytest from [cynkra R-universe](https://cynkra.r-universe.dev/):\n\n``` r\ninstall.packages('lazytest', repos = c('https://cynkra.r-universe.dev', 'https://cloud.r-project.org'))\n```\n\nOr from GitHub:\n\n``` r\npak::pak(\"krlmlr/lazytest\")\n```\n\nIf you're using RStudio, it is a good idea to remap the shortcut for running tests (default: Ctrl + Shift + T / Cmd + Shift + T).\nThe add-in provides two commands:\n\n- Run Lazy Tests in New Terminal (recommended mapping: Ctrl + Shift + T / Cmd + Shift + T)\n\n- Reset And Run Lazy Tests in New Terminal (recommended mapping: Ctrl + T / Cmd + T)\n\nThis allows you to keep the workflows you're accustomed to and to benefit immediately.\n\n![RStudio shortcut configuration](https://github.com/cynkra/lazytest/raw/main/readme/rstudio-kb.png)\n\n---\n\n## Code of Conduct\n\nPlease note that the lazytest project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcynkra%2Flazytest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcynkra%2Flazytest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcynkra%2Flazytest/lists"}