Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New dataset tests fail on Linux #647

Closed
Yuri05 opened this issue Oct 13, 2021 · 2 comments
Closed

New dataset tests fail on Linux #647

Yuri05 opened this issue Oct 13, 2021 · 2 comments

Comments

@Yuri05
Copy link
Member

Yuri05 commented Oct 13, 2021

Some of the newly added tests fail on Linux. All from test-utilities-dataset.R

@msevestre @PavelBal
Is this functionality not supposed to be run under linux? Then we should disable those tests (e.g. with skip_on_os("linux") )
Or is anything missing in the linux installation (what?)?

  • Failing test 1:
    test_that("It can convert a data set with metaData", {
    dataSet$addMetaData("Organ", "Blood")
    expect_equal(
    dataSetToDataFrame(dataSet),
    data.frame(
    name = rep(dataSet$name, 5), xValues = dataSet$xValues,
    yValues = dataSet$yValues, yErrorValues = dataSet$yErrorValues,
    xDimension = rep(dataSet$xDimension, 5), xUnit = rep(dataSet$xUnit, 5),
    yDimension = rep(dataSet$yDimension, 5), yUnit = rep(dataSet$yUnit, 5),
    yErrorType = rep(dataSet$yErrorType, 5), yErrorUnit = rep(dataSet$yErrorUnit, 5),
    molWeight = rep(dataSet$molWeight, 5), lloq = rep(dataSet$LLOQ, 5),
    Organ = rep("Blood", 5)
    )
    )
    })
  • Failing test 2:
    test_that("It can convert a list of data sets", {
    dataSet2 <- DataSet$new()
    dataSet2$setValues(xValues = c(6, 7, 8), yValues = c(11, 21, 31))
    dataSet2$molWeight <- 456
    dataSet2$addMetaData("Compartment", "Plasma")
    expect_equal(
    dataSetToDataFrame(list(dataSet, dataSet2)),
    data.frame(
    name = c(rep(dataSet$name, 5), rep("", 3)), xValues = c(dataSet$xValues, dataSet2$xValues),
    yValues = c(dataSet$yValues, dataSet2$yValues), yErrorValues = c(dataSet$yErrorValues, rep(NA, 3)),
    xDimension = c(rep(dataSet$xDimension, 5), rep(dataSet2$xDimension, 3)),
    xUnit = c(rep(dataSet$xUnit, 5), rep(dataSet2$xUnit, 3)),
    yDimension = c(rep(dataSet$yDimension, 5), rep(dataSet2$yDimension, 3)),
    yUnit = c(rep(dataSet$yUnit, 5), rep(dataSet2$yUnit, 3)),
    yErrorType = c(rep(dataSet$yErrorType, 5), rep(NA_character_, 3)),
    yErrorUnit = c(rep(dataSet$yErrorUnit, 5), rep(NA_character_, 3)),
    molWeight = c(rep(dataSet$molWeight, 5), rep(dataSet2$molWeight, 3)),
    lloq = c(rep(dataSet$LLOQ, 5), rep(NA, 3)),
    Organ = c(rep("Blood", 5), rep(NA, 3)), Compartment = c(rep(NA, 5), rep("Plasma", 3))
    )
    )
    })
  • Failing test 3:
    test_that("it returns an empty list when loading from file with one sheet without
    sheet definition in configuration and importAllSheets == FALSE", {
    expect_named(loadDataSetsFromExcel(xlsFilePath = xlsFilePath, importerConfiguration = importerConfiguration), character())
    })
  • Failing test 4:
    test_that("it can load when loading from file with one sheet without
    sheet definition in configuration and importAllSheets == FALSE", {
    dataSets <- loadDataSetsFromExcel(xlsFilePath = xlsFilePath, importerConfiguration = importerConfiguration, importAllSheets = TRUE)
    expect_true(isOfType(dataSets, DataSet))
    expect_equal(length(dataSets), 4)
    })
  • Failing test 5:
    test_that("it can convert DataSets loaded from excel to data.frame", {
    dataSets <- loadDataSetsFromExcel(xlsFilePath = xlsFilePath, importerConfiguration = importerConfiguration, importAllSheets = TRUE)
    dataSetsFrame <- dataSetToDataFrame(dataSets)
    expect_equal(names(dataSetsFrame), c(
    "name",
    "xValues",
FAILED TESTS
#14 424.4 ══ Failed tests ════════════════════════════════════════════════════════════════
#14 424.5 ── Failure (test-utilities-data-set.R:59:3): It can convert a data set with metaData ──
#14 424.5 dataSetToDataFrame(dataSet) not equal to data.frame(...).
#14 424.5 Component “Organ”: Modes: character, numeric
#14 424.5 Component “Organ”: Attributes: < target is NULL, current is list >
#14 424.5 Component “Organ”: target is character, current is factor
#14 424.5 ── Failure (test-utilities-data-set.R:79:3): It can convert a list of data sets ──
#14 424.5 dataSetToDataFrame(list(dataSet, dataSet2)) not equal to data.frame(...).
#14 424.5 Component “Organ”: Modes: character, numeric
#14 424.5 Component “Organ”: Attributes: < target is NULL, current is list >
#14 424.5 Component “Organ”: target is character, current is factor
#14 424.5 Component “Compartment”: Modes: character, numeric
#14 424.5 Component “Compartment”: Attributes: < target is NULL, current is list >
#14 424.5 Component “Compartment”: target is character, current is factor
#14 424.5 ── Error (test-utilities-data-set.R:154:3): it returns an empty list when loading from file with one sheet without
#14 424.5           sheet definition in configuration and importAllSheets == FALSE ──
#14 424.5 Error: Type:    OSPSuite.Infrastructure.Import.Core.InvalidObservedDataFileException
#14 424.5 Message: An error occurred while reading the file. Please check the content.
#14 424.5 The exception thrown was:
#14 424.5 
#14 424.5 Error Initializing the configuration system.
#14 424.5 
#14 424.5 Method:  OSPSuite.Utility.Collections.Cache`2[System.String,OSPSuite.Infrastructure.Import.Core.DataSheet] LoadFromFile(System.String)
#14 424.5 Stack trace:
#14 424.5   at OSPSuite.Infrastructure.Import.Core.DataSourceFileReaders.ExcelDataSourceFile.LoadFromFile (System.String path) [0x0011b] in <93cbb51fbfbe432491d84975ce64ec07>:0 
#14 424.5   at OSPSuite.Infrastructure.Import.Core.DataSourceFile.set_Path (System.String value) [0x00008] in <93cbb51fbfbe432491d84975ce64ec07>:0 
#14 424.5   at OSPSuite.Infrastructure.Import.Core.DataSourceFileParser.For (System.String path) [0x00056] in <93cbb51fbfbe432491d84975ce64ec07>:0 
#14 424.5   at OSPSuite.Infrastructure.Import.Services.Importer.LoadFile (System.Collections.Generic.IReadOnlyList`1[T] columnInfos, System.String fileName, System.Collections.Generic.IRead
#14 424.5 Backtrace:
#14 424.5     █
#14 424.5  1. ├─testthat::expect_named(...) test-utilities-data-set.R:154:2
#14 424.5  2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
#14 424.5  3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
#14 424.5  4. └─ospsuite::loadDataSetsFromExcel(xlsFilePath = xlsFilePath, importerConfiguration = importerConfiguration)
#14 424.5  5.   └─rClr::clrCall(...)
#14 424.5 ── Error (test-utilities-data-set.R:159:3): it can load when loading from file with one sheet without
#14 424.5           sheet definition in configuration and importAllSheets == FALSE ──
#14 424.5 Error: Type:    OSPSuite.Infrastructure.Import.Core.InvalidObservedDataFileException
#14 424.5 Message: An error occurred while reading the file. Please check the content.
#14 424.5 The exception thrown was:
#14 424.5 
#14 424.5 Error Initializing the configuration system.
#14 424.5 
#14 424.5 Method:  OSPSuite.Utility.Collections.Cache`2[System.String,OSPSuite.Infrastructure.Import.Core.DataSheet] LoadFromFile(System.String)
#14 424.5 Stack trace:
#14 424.5   at OSPSuite.Infrastructure.Import.Core.DataSourceFileReaders.ExcelDataSourceFile.LoadFromFile (System.String path) [0x0011b] in <93cbb51fbfbe432491d84975ce64ec07>:0 
#14 424.5   at OSPSuite.Infrastructure.Import.Core.DataSourceFile.set_Path (System.String value) [0x00008] in <93cbb51fbfbe432491d84975ce64ec07>:0 
#14 424.5   at OSPSuite.Infrastructure.Import.Core.DataSourceFileParser.For (System.String path) [0x00056] in <93cbb51fbfbe432491d84975ce64ec07>:0 
#14 424.5   at OSPSuite.Infrastructure.Import.Services.Importer.LoadFile (System.Collections.Generic.IReadOnlyList`1[T] columnInfos, System.String fileName, System.Collections.Generic.IRead
#14 424.5 Backtrace:
#14 424.5     █
#14 424.5  1. └─ospsuite::loadDataSetsFromExcel(...) test-utilities-data-set.R:159:2
#14 424.5  2.   └─rClr::clrCall(...)
#14 424.5 ── Error (test-utilities-data-set.R:165:3): it can convert DataSets loaded from excel to data.frame ──
#14 424.5 Error: Type:    OSPSuite.Infrastructure.Import.Core.InvalidObservedDataFileException
#14 424.5 Message: An error occurred while reading the file. Please check the content.
#14 424.5 The exception thrown was:
#14 424.5 
#14 424.5 Error Initializing the configuration system.
#14 424.5 
#14 424.5 Method:  OSPSuite.Utility.Collections.Cache`2[System.String,OSPSuite.Infrastructure.Import.Core.DataSheet] LoadFromFile(System.String)
#14 424.5 Stack trace:
#14 424.5   at OSPSuite.Infrastructure.Import.Core.DataSourceFileReaders.ExcelDataSourceFile.LoadFromFile (System.String path) [0x0011b] in <93cbb51fbfbe432491d84975ce64ec07>:0 
#14 424.5   at OSPSuite.Infrastructure.Import.Core.DataSourceFile.set_Path (System.String value) [0x00008] in <93cbb51fbfbe432491d84975ce64ec07>:0 
#14 424.5   at OSPSuite.Infrastructure.Import.Core.DataSourceFileParser.For (System.String path) [0x00056] in <93cbb51fbfbe432491d84975ce64ec07>:0 
#14 424.5   at OSPSuite.Infrastructure.Import.Services.Importer.LoadFile (System.Collections.Generic.IReadOnlyList`1[T] columnInfos, System.String fileName, System.Collections.Generic.IRead
#14 424.5 Backtrace:
#14 424.5     █
#14 424.5  1. └─ospsuite::loadDataSetsFromExcel(...) test-utilities-data-set.R:165:2
#14 424.5  2.   └─rClr::clrCall(...)
#14 424.5 
#14 424.5 [ FAIL 5 | WARN 3 | SKIP 36 | PASS 720 ]
#14 425.0 Error: Test failures
#14 425.0 Execution halted
#14 ERROR: executor failed running [/bin/sh -c R --no-save -e "setwd(system.file('tests', package = 'ospsuite')); source('testthat.R')"]: exit code: 1
------
 > [9/9] RUN R --no-save -e "setwd(system.file('tests', package = 'ospsuite')); source('testthat.R')":
#14 424.5   at OSPSuite.Infrastructure.Import.Core.DataSourceFileParser.For (System.String path) [0x00056] in <93cbb51fbfbe432491d84975ce64ec07>:0 
#14 424.5   at OSPSuite.Infrastructure.Import.Services.Importer.LoadFile (System.Collections.Generic.IReadOnlyList`1[T] columnInfos, System.String fileName, System.Collections.Generic.IRead
#14 424.5 Backtrace:
#14 424.5     █
#14 424.5  1. └─ospsuite::loadDataSetsFromExcel(...) test-utilities-data-set.R:165:2
#14 424.5  2.   └─rClr::clrCall(...)
#14 424.5 
#14 424.5 [ FAIL 5 | WARN 3 | SKIP 36 | PASS 720 ]
@msevestre
Copy link
Member

msevestre commented Oct 13, 2021

Importer does not work under linux. NPOI (even though it should be .net standard compatible) crashes miserably under linux

@msevestre
Copy link
Member

Yuri05 added a commit to Open-Systems-Pharmacology/Docker-Images-Ospsuite-R that referenced this issue Oct 13, 2021
* ospsuite 10.0.70

* no fail fast

* temporarily remove test-utilities-data-set.R before testing (s. Open-Systems-Pharmacology/OSPSuite-R#647)

Co-authored-by: Yuri05 <Yuri05@github.com>
Yuri05 pushed a commit to Yuri05/OSPSuite-R that referenced this issue Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants