IRC channel logs
2023-06-06.log
back to list of logs
<flypaper-ultimat>rekado: ah, gnu:dump-file-contents already does recursively via find-files, so i could instead of '(string-append pkg-name "-tests")' just do "." <rekado>the test failure in r-biocgenerics is due to the fact that annotationdbi isn’t among the inputs; it can’t be added because that would introduce a package cycle <rekado>gotta see if we can add a more convenient way to disable individual tests <rekado>flypaper-ultimat: I think we should pass type="tests" to tools::testInstalledPackage <rekado>the examples often require too many other packages <rekado>I guess we should also try to update the importer to add packages to the inputs (not propagated-inputs) that are required by the tests <rekado>(I adjusted the patch a little after we’ve talked here) <rekado>I’m now trying to write a little test runner that lets us disable individual tests easily <rekado>we’d need to pass “--file=guix_test_runner.R --” as Ropts to testInstalledPackage <rekado>this way we can disable individual tests via the R_DISABLED_TESTS variable <rekado>bah, this won’t work because of the wildly different ways that R packages can launch their tests upon evaluation. <flypaper-ultimat>rekado: can you give me a a few packages that do wildly different things, maybe theres a way with hacking with R's `trace', which you can use kinda like emacs's "advice". <rekado>my assumption was that we can load all the test files first and then run them (after checking if they appear in a list of disabled tests) <rekado>tools::testInstalledPackage(type="tests", …) will look for tests in “tests” <rekado>BiocGenerics actually has its tests in inst/unitTests <rekado>the tests directory merely contains the custom launcher, which configures and runs RUnit <rekado>packages are free to do whatever they want inside of tests/* <rekado>testInstalledPackage will evaluate the contents of any R file in that directory <rekado>BiocGenerics uses RUnit with a regexp to select what tests to run <rekado>so I don’t see a generic way to disable individual tests <flypaper-ultimat>so what if we advice `<-` during tests to assign function(...) {true} if the first arg matches one if the disabled tests? <flypaper-ultimat>i once wrote a script that hooked to "read.csv", "load", and "save" with `trace' in order to crate a graphviz plot of when data was being loaded / written to, maybe something similar could be done here. <rekado>flypaper-ultimat: that’s a very good idea <flypaper-ultimat>i'm also mucking around with it. gotta love that R is practically a scheme. <rekado>I get “object '"<-"' not found” whenever I try to go beyond just “trace("<-")” <flypaper-ultimat>ooh just read about 'lockBinding', that might also be what we want to do. <civodul>rekado: i find (filter (lambda (x) ((negate string=?) ...)) ...) convoluted <civodul>i'd write (remove (lambda (x) (string=? ...)) ...) <civodul>(no big deal, i just saw it while browsing guix-commits) <rekado>civodul: ah, yes. I know that “remove” exists but I just failed to remember it <rekado>flypaper-ultimat: this looks more complicated than I would have guessed. Good you got that far! <rekado>I’m a little worried about missing other ways of defining tests <rekado>we could probably catch cases where a function is assigned to “test_…”, but I wonder if there are other conventions <flypaper-ultimat>(this one looks less clean, but the message itself will keep echo the function it sileneced) <rekado>what does the frame=parent.frame(n=1) do? <rekado>I get that eval needs a frame as a context, but what’s the parent.frame? <flypaper-ultimat>so that we do the primitive `<-` in the place where the user wrote `<-`, rather than in `guix_maybe_assign` <rekado>I’ll give this a spin a little while later <flypaper-ultimat>another common testing framework is r-testthat, which uses the format `test_that("Testing for foo bar", { expect_equal(foo,bar)})` so we could shadow "test_that", and discard things that match certain titles.