Author: Michael R. Crusoe <crusoe@debian.org>
Description: skip tests that use the unpackaged optional dependency 'chihaya'
Forwarded: not-needed
--- r-bioc-alabaster.matrix.orig/tests/testthat/test-stage-array.R
+++ r-bioc-alabaster.matrix/tests/testthat/test-stage-array.R
@@ -116,117 +116,6 @@
     expect_equal(as.array(arr2), as.array(y))
 })
 
-test_that("stageObject works with DelayedArrays with preserved operations", {
-    dir <- tempfile()
-    odir <- file.path(dir, experiment)
-    dir.create(odir, recursive=TRUE)
-
-    library(DelayedArray)
-    x <- DelayedArray(arr)
-    x <- log2(x / runif(nrow(x)) + 1)
-
-    old <- preserveDelayedOperations(TRUE)
-    info <- stageObject(x, dir, file.path(experiment, assay))
-    preserveDelayedOperations(old)
-    expect_match(info$`$schema`, "hdf5_delayed_array")
-    expect_error(alabaster.base::.writeMetadata(info, dir=dir), NA)
-
-    arr2 <- loadArray(info, project=dir)
-    expect_equal(unname(as.array(arr2)), unname(as.array(x)))
-})
-
-test_that("stageObject works with DelayedArrays with local references", {
-    dir <- tempfile()
-    odir <- file.path(dir, experiment)
-    dir.create(odir, recursive=TRUE)
-
-    info <- stageObject(arr, dir, paste0(experiment, "/raw"))
-    alabaster.base::.writeMetadata(info, dir=dir)
-    raw.path <- info$path
-
-    # Adding delayed operations.
-    library(DelayedArray)
-    x <- DelayedArray(arr)
-    x <- log2(x / runif(nrow(x)) + 1)
-
-    old <- preserveDelayedOperations(TRUE)
-    info <- stageObject(x, dir, file.path(experiment, assay))
-    preserveDelayedOperations(old)
-
-    expect_match(info$`$schema`, "hdf5_delayed_array")
-    expect_error(alabaster.base::.writeMetadata(info, dir=dir), NA)
-
-    # Manually replacing the seed with a local reference.
-    fpath <- file.path(dir, info$path)
-    rhdf5::h5delete(fpath, "data/seed/seed/seed")
-    rhdf5::h5createGroup(fpath, "data/seed/seed/seed")
-    rhdf5::h5write(dim(arr), fpath, "data/seed/seed/seed/dimensions")
-    rhdf5::h5write("integer", fpath, "data/seed/seed/seed/type")
-    rhdf5::h5write(raw.path, fpath, "data/seed/seed/seed/path")
-
-    {
-        fhandle = rhdf5::H5Fopen(fpath, "H5F_ACC_RDWR")
-        ghandle = rhdf5::H5Gopen(fhandle, "data/seed/seed/seed")
-        rhdf5::h5writeAttribute("array", ghandle, "delayed_type", asScalar=TRUE)
-        rhdf5::h5writeAttribute("custom alabaster local array", ghandle, "delayed_array", asScalar=TRUE)
-        rhdf5::H5Gclose(ghandle)
-        rhdf5::H5Fclose(fhandle)
-    }
-
-    # Now seeing if we can load it.
-    arr2 <- loadArray(info, project=dir)
-    expect_equal(unname(as.array(arr2)), unname(as.array(x)))
-})
-
-test_that("stageObject recycles existing HDF5Arrays", {
-    dir <- tempfile()
-    dir.create(dir, recursive=TRUE)
-
-    library(HDF5Array)
-    x <- as(matrix(runif(1000), 10, 100), "HDF5Array")
-    rhdf5::h5write("foo", path(x), "bar") # injecting a little something to distinguish it from a rewritten file.
-
-    {
-        info <- stageObject(x, dir, "dense")
-        expect_false(identical(file.size(path(x)), file.size(file.path(dir, info$path)))) # negative control that triggers the fallback.
-        arr2 <- loadArray(info, project=dir)
-        expect_equal(unname(as.array(arr2)), unname(as.array(x)))
-    }
-
-    old <- recycleHdf5Files(TRUE)
-    on.exit(recycleHdf5Files(old))
-
-    {
-        info <- stageObject(x, dir, "dense2")
-        expect_match(info$`$schema`, "hdf5_dense_array")
-        expect_error(alabaster.base::.writeMetadata(info, dir=dir), NA)
-        expect_identical(file.size(path(x)), file.size(file.path(dir, info$path))) # same file.
-
-        arr2 <- loadArray(info, project=dir)
-        expect_equal(unname(as.array(arr2)), unname(as.array(x)))
-    }
-
-    {
-        y <- Matrix::rsparsematrix(20, 50, density=0.1)
-        tmp <- tempfile(fileext=".h5")
-        rhdf5::h5createFile(tmp)
-        rhdf5::h5createGroup(tmp, "foo")
-        rhdf5::h5write(y@p, tmp, "foo/indptr")
-        rhdf5::h5write(y@i, tmp, "foo/indices")
-        rhdf5::h5write(y@x, tmp, "foo/data")
-        rhdf5::h5write(dim(y), tmp, "foo/shape")
-        x <- H5SparseMatrix(tmp, "foo")
-
-        info <- stageObject(x, dir, "sparse")
-        expect_match(info$`$schema`, "hdf5_sparse_matrix")
-        expect_error(alabaster.base::.writeMetadata(info, dir=dir), NA)
-        expect_identical(file.size(path(x)), file.size(file.path(dir, info$path)))
-
-        arr2 <- loadArray(info, project=dir)
-        expect_equal(unname(as.array(arr2)), unname(as.array(x)))
-    }
-})
-
 test_that("reading arrays work with non-default NA placeholders", {
     dir <- tempfile()
     dir.create(dir, recursive=TRUE)
--- r-bioc-alabaster.matrix.orig/tests/testthat/test-stage-matrix.R
+++ r-bioc-alabaster.matrix/tests/testthat/test-stage-matrix.R
@@ -128,33 +128,3 @@
     expect_identical(DelayedArray::type(mat2), "logical")
     expect_identical(as.matrix(mat), as.matrix(mat2))
 })
-
-test_that("stageObject works with DelayedMatrices (naive)", {
-    dir <- tempfile()
-    odir <- file.path(dir, experiment)
-    dir.create(odir, recursive=TRUE)
-
-    # Works in the pristine case, where it just extracts the seed.
-    library(DelayedArray)
-    mat <- as(matrix(rpois(10000, 1), ncol=10), "dgCMatrix")
-    x <- DelayedArray(mat)
-
-    info <- stageObject(x, dir, file.path(experiment, assay))
-    expect_match(info$`$schema`, "sparse_matrix")
-    expect_error(alabaster.base::.writeMetadata(info, dir), NA)
-
-    mat2 <- loadArray(info, project=dir)
-    expect_equal(unname(as.matrix(mat2)), unname(as.matrix(x)))
-    expect_null(rownames(mat2))
-    expect_null(colnames(mat2))
-
-    # Works with assigned dimnames.
-    y <- x
-    dimnames(y) <- list(seq_len(nrow(y)), LETTERS[1:10])
-
-    info <- stageObject(y, dir, file.path(experiment, "other"))
-    expect_error(alabaster.base::.writeMetadata(info, dir), NA)
-
-    mat2 <- loadArray(info, project=dir)
-    expect_equal(as.matrix(mat2), as.matrix(y))
-})
