2016-09-22 4 views
0

CRAN에 패키지를 제출했으나 CRAN R CMD 확인을 통과하지 못했습니다.테스트를 사용한 테스트로 인해 CRAN에서 패키지가 실패 함

어느

* checking tests ... ERROR 
Running the tests in ‘tests/testthat.R’ failed. 
Last 13 lines of output: 
    Type 'contributors()' for more information and 
    'citation()' on how to cite R or R packages in publications. 

    Type 'demo()' for some demos, 'help()' for on-line help, or 
    'help.start()' for an HTML browser interface to help. 
    Type 'q()' to quit R. 

    > library(testthat) 
    > library(prepdat) 
    > 
    > test_check("prepdat") 
    Error: On CRAN 
    testthat results  ================================================================ 
    OK: 0 SKIPPED: 0 FAILED: 0 
    Execution halted 

이 여기 내 테스트 파일 외모 (그리고 GitHub에 나는이 문제를 해결할 수있는 방법 https://github.com/ayalaallon/prepdat

skip_on_cran() 
library(prepdat) 
data("finalized_stroopdata") 
data("stroopdata") 

context("Finalized table") 

test_finalized_stroopdata <- prep(
    dataset = stroopdata 
    , file_name = NULL 
    , file_path = NULL 
    , id = "subject" 
    , within_vars = c("block", "target_type") 
    , between_vars = c("order") 
    , dvc = "rt" 
    , dvd = "ac" 
    , keep_trials = NULL 
    , drop_vars = c() 
    , keep_trials_dvc = "raw_data$rt > 100 & raw_data$rt < 3000 & raw_data$ac  == 1" 
    , keep_trials_dvd = "raw_data$rt > 100 & raw_data$rt < 3000" 
    , id_properties = c() 
    , sd_criterion = c(1, 1.5, 2) 
    , percentiles = c(0.05, 0.25, 0.75, 0.95) 
    , outlier_removal = 2 
    , keep_trials_outlier = "raw_data$ac == 1" 
    , decimal_places = 0 
    , notification = TRUE 
    , dm = c() 
    , save_results = FALSE 
    , results_name = "results.txt" 
    , results_path = NULL 
    , save_summary = FALSE 
) 

test_that("Finialized table is correct", { 
    expect_equal(test_finalized_stroopdata, finalized_stroopdata) 
}) 

에 대한 링크는 어떻게? 이것은 그들이 얻을 오류입니다 도움을 대단히 감사하겠습니다.

아얄라

+0

귀하의 의도는 분명하지 않습니다. 이것을 CRAN에서 건너 뛰시겠습니까? –

+0

예. 내가 skip_on_cran()을 가지고 있지만 CRAN 검사에 실패했습니다. – ayalaall

+1

'test_that' 코드 블록에'skip_on_cran()'을 포함시켜야한다고 생각합니다. 해볼 수 있니? –

답변

1

skip_on_cran을 잘못 사용하고 있습니다. test_that 블록에 포함되어야합니다 :

test_that("Finialized table is correct", { 
    skip_on_cran() 
    expect_equal(test_finalized_stroopdata, finalized_stroopdata) 
}) 
+0

고마워요. 'context()'를 제외한 모든 코드는 https://github.com/ayalaallon/prepdat/blob/master/tests/testthat/test_prep.R에서 볼 수있는 것처럼 'test_that'안에 있어야합니다. – ayalaall