File: no_asciicast.patch

package info (click to toggle)
r-cran-callr 3.7.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 928 kB
  • sloc: sh: 13; makefile: 2
file content (108 lines) | stat: -rw-r--r-- 3,668 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
Author: Andreas Tille <tille@debian.org>
Last-Update: Tue, 10 Jan 2023 09:21:19 +0100
Description: Patch out tests needing asciicast since it contains two really hard to remove JS files
 The package asciicast is used in test of callr since version 3.7.3.  Since
 it seems to be extremely tricky to replace the two remaining compressed JS
 files in https://salsa.debian.org/r-pkg-team/r-cran-asciicast the usage of
 asciicast inside the callr test is patched out here.

--- a/tests/testthat/helper.R
+++ b/tests/testthat/helper.R
@@ -186,15 +186,15 @@ expect_r_process_snapshot <- function(..
   code <- unlist(lapply(dots[code_pos], deparse))
   args <- dots[!code_pos]
 
-  record_output <- asciicast::record_output
-  output <- do.call(
-    "record_output",
-    c(list(code), args, interactive = interactive, echo = echo)
-  )
-
-  r_process <- function() writeLines(output)
-
-  expect_snapshot(r_process(), transform = transform, variant = variant)
+#  record_output <- asciicast::record_output
+#  output <- do.call(
+#    "record_output",
+#    c(list(code), args, interactive = interactive, echo = echo)
+#  )
+#
+#  r_process <- function() writeLines(output)
+#
+#  expect_snapshot(r_process(), transform = transform, variant = variant)
 }
 
 redact_srcref <- function(x) {
--- a/tests/testthat/test-error.R
+++ b/tests/testthat/test-error.R
@@ -1,5 +1,6 @@
 
 test_that("error is propagated, .Last.error is set", {
+  skip("no package asciicast available")
   expect_r_process_snapshot(
     callr::r(function() 1 + "A", error = "error"),
     .Last.error,
@@ -8,6 +9,7 @@ test_that("error is propagated, .Last.er
 })
 
 test_that("error is propagated, printed if non-interactive mode", {
+  skip("no package asciicast available")
   expect_r_process_snapshot(
     callr::r(function() 1 + "A", error = "error"),
     interactive = FALSE,
@@ -16,6 +18,7 @@ test_that("error is propagated, printed
 })
 
 test_that("error stack is passed, .Last.error is set", {
+  skip("no package asciicast available")
   expect_r_process_snapshot(
     callr::r(
       function() {
@@ -80,6 +83,7 @@ test_that("parent errors, another level"
 })
 
 test_that("error traces are printed recursively", {
+  skip("no package asciicast available")
   expect_r_process_snapshot(
     callr::r(function() callr::r(function() 1 + "a")),
     interactive = FALSE,
@@ -154,6 +158,7 @@ test_that("child error is not modified",
 })
 
 test_that("new_callr_error, timeout", {
+  skip("no package asciicast available")
   expect_r_process_snapshot(
     callr::r(function() Sys.sleep(3), timeout = 1/5),
     transform = redact_srcref
@@ -200,6 +205,7 @@ test_that("format.call_status_error", {
 })
 
 test_that("format.call_status_error 2", {
+  skip("no package asciicast available")
   skip_if_not_installed("withr")
   expect_r_process_snapshot(
     withr::local_options(rlib_error_always_trace = TRUE),
@@ -214,6 +220,7 @@ test_that("format.call_status_error 2",
 })
 
 test_that("stdout/stderr is printed on error", {
+  skip("no package asciicast available")
   expect_r_process_snapshot(
     callr::r(function() {
       warning("I have a bad feeling about this")
@@ -227,6 +234,7 @@ test_that("stdout/stderr is printed on e
 })
 
 test_that("stdout/stderr is printed on error 2", {
+  skip("no package asciicast available")
   expect_r_process_snapshot(
     callr::r(function() {
       writeLines("Just some output")
@@ -240,6 +248,7 @@ test_that("stdout/stderr is printed on e
 })
 
 test_that("stdout/stderr is printed on error 3", {
+  skip("no package asciicast available")
   expect_r_process_snapshot(
     callr::r(function() {
       writeLines("Just some output")