bisectr icon indicating copy to clipboard operation
bisectr copied to clipboard

Is this still working?

Open asadow opened this issue 1 year ago • 2 comments

When I tried to implement this package, git bisect incorrectly identified the first bad commit as the initial git bisect bad commit. You can see this in action below. Commit 483654834d5176e88db76daef5b5d7de84837af4 gave bad(1), but git bisect identifies the next commit (the initial git bisect bad) as the first bad one.

asadowsk ((15ff55e...) *|BISECTING) megamation $ git bisect run /c/Program\ Files/R/R-4.3.2/bin/Rscript ./test.R
running 'C:/Program Files/R/R-4.3.2/bin/Rscript' './test.R'

===== Running test script ======
ℹ Loading megamation
Running test...
Returning code: good (0)

Bisecting: 1 revision left to test after this (roughly 1 step)
[add0a4077317d6a10b585b9be1f596aa5fef3d4f] Remove check_creds()
running 'C:/Program Files/R/R-4.3.2/bin/Rscript' './test.R'

===== Running test script ======
ℹ Loading megamation
Running test...
Returning code: good (0)

Bisecting: 0 revisions left to test after this (roughly 0 steps)
[483654834d5176e88db76daef5b5d7de84837af4] Add .multi param to req_url_query()
running 'C:/Program Files/R/R-4.3.2/bin/Rscript' './test.R'

===== Running test script ======
ℹ Loading megamation
Running test...
Returning code: bad (1)

b60c88aa03c13d20a1632bd68df96c6cc276a707 is the first bad commit
commit b60c88aa03c13d20a1632bd68df96c6cc276a707
Author: Adam Sadowski <[email protected]>
Date:   Thu Dec 7 11:21:25 2023 -0500

    Document new mm_authorize()

 NAMESPACE                       |  1 +
 R/authorize.R                   | 32 ++++++++++++++++++++++++++++++++
 R/utils-check.R                 | 32 ++++++++++++++++++++++++++++++++
 R/utils.R                       |  9 ++-------
 R/zzz.R                         | 28 ++++++++++++++++++++++++++++
 man/mm_authorize.Rd             | 33 +++++++++++++++++++++++++++++++++
 tests/testthat/test-authorize.R | 40 ++++++++++++++++++++++++++++++++++++++++
 7 files changed, 168 insertions(+), 7 deletions(-)
 create mode 100644 R/authorize.R
 create mode 100644 R/zzz.R
 create mode 100644 man/mm_authorize.Rd
 create mode 100644 tests/testthat/test-authorize.R
bisect found first bad commit

test.r

#!/c/Program\ Files/R/R-4.3.2/bin/Rscript

# To run this script:
# git bisect reset
# git bisect start
# git bisect good 7e061fc8d128e96cb33adae0f32443b943d1953c
# git bisect run mytestscript.r
cat("\n===== Running test script ======\n")
# library(bisectr)

# Load package in current directory
#Use devtools instead of bisectr as bisect_load_all() gives error
devtools::load_all()
# bisectr::bisect_load_all(".", on_error = "skip")

# Run the test, and if error, mark skip
fun <- function() {
  date <- as.Date("2023-09-20")
  date <- c(date, date + 3)

  expected <- list(
    DATE = structure("09-20-2023", class = "AsIs"),
    DATE = structure("09-23-2023", class = "AsIs")
  )
  if(identical(format_params(date = date), expected))
    return("good")
  else
    return("bad")
}

bisect_runtest(fun, on_error = "bad")

asadow avatar Jan 29 '24 15:01 asadow

Sorry, I haven't looked at bisectr in many years, and I can't provide any help at the moment.

wch avatar Jan 29 '24 23:01 wch