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

Freshen up the tests around crashing #464

Merged
merged 1 commit into from
Jul 5, 2024
Merged

Freshen up the tests around crashing #464

merged 1 commit into from
Jul 5, 2024

Conversation

jennybc
Copy link
Member

@jennybc jennybc commented Jul 5, 2024

Motivated by:

Dear maintainer,

Please see the problems shown on
https://cran.r-project.org/web/checks/check_results_reprex.html.

Please correct before 2024-07-07 to safely retain your package on CRAN.

This refers to the fact that, at the time of writing, callr:::crash() does not crash on R devel, but instead throws an error. So reprex's tests around its behaviour when R crashes are failing on CRAN's checks on R-devel.

I'm updating to use a different way of crashing R (but @gaborcsardi says he'll probably update callr's R-crashing code) and also adding skip_on_cran(), as it seems a bit fraught to test crashing R there.

══ Failed tests ════════════════════════════════════════════════════════════════
    ── Failure ('test-reprex.R:67:3'): reprex() errors for an R crash, by default ──
    `reprex(input = code)` did not throw the expected error.
    ── Failure ('test-reprex.R:78:3'): reprex() copes with an R crash, when `std_out_err = TRUE` ──
    `out` does not match "segfault".
    Actual values:
    * ``` r
    * utils::getFromNamespace\("crash", "callr"\)\(\)
    * #> Error in get\("attach"\)\(structure\(list\(\), class = "UserDefinedDatabase"\)\): R_ExternalPtrAddr: argument of type VECSXP is not an external pointer
    * ```
    * 
    * <sup>Created on 2024-07-02 with \[reprex v2\.1\.0\]\(https://reprex\.tidyverse\.org\)</sup>
    * 
    * <details style="margin-bottom:10px;">
    * 
    * <summary>
    * 
    * Standard output and standard error
    * </summary>
    * 
    * 
    * ``` sh
    * -- nothing to show --
    * ```
    * 
    * </details>
    Backtrace:
        ▆
     1. └─testthat::expect_match(out, "segfault", all = FALSE) at test-reprex.R:78:3
     2.   └─testthat:::expect_match_(...)
    ── Failure ('test-reprex.R:79:3'): reprex() copes with an R crash, when `std_out_err = TRUE` ──
    `out` does not match "Traceback".
    Actual values:
    * ``` r
    * utils::getFromNamespace\("crash", "callr"\)\(\)
    * #> Error in get\("attach"\)\(structure\(list\(\), class = "UserDefinedDatabase"\)\): R_ExternalPtrAddr: argument of type VECSXP is not an external pointer
    * ```
    * 
    * <sup>Created on 2024-07-02 with \[reprex v2\.1\.0\]\(https://reprex\.tidyverse\.org\)</sup>
    * 
    * <details style="margin-bottom:10px;">
    * 
    * <summary>
    * 
    * Standard output and standard error
    * </summary>
    * 
    * 
    * ``` sh
    * -- nothing to show --
    * ```
    * 
    * </details>
    Backtrace:
        ▆
     1. └─testthat::expect_match(out, "Traceback", all = FALSE) at test-reprex.R:79:3
     2.   └─testthat:::expect_match_(...)
    
    [ FAIL 3 | WARN 0 | SKIP 65 | PASS 60 ]
    Error: Test failures
    Execution halted

@gaborcsardi
Copy link
Member

Dev callr should be ok: r-lib/callr@cc2d888

I'll submit it in the next days.

@jennybc jennybc force-pushed the update-crash-tests branch 3 times, most recently from eb2f8a6 to de07edc Compare July 5, 2024 22:38
@jennybc jennybc merged commit baf6b58 into main Jul 5, 2024
13 checks passed
@jennybc jennybc deleted the update-crash-tests branch July 5, 2024 23:12
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

Successfully merging this pull request may close these issues.

2 participants