Test evidence
Connection to R
Every requirement of this module, the tests named for it, and what each test recorded the last time the evidence was rebuilt.
Summary
- Requirements
- 80
- Tests named for them
- 86 (71 unit, 15 browser)
- Result
- pass every test passing
- Screenshots
- 1
- Recorded
- 2026-10-04 19:02 UTC
- Environment
- linux 6.17.0-1022-azure · node v22.23.3 · playwright 1.61.1 · chromium 149.0.7827.55
The requirements are the rows of the module’s requirement matrix. A test is named for a requirement by starting its name with the requirement’s ID. The results are read from the committed evidence set; continuous integration reruns every test and fails when the committed set no longer matches.
Requirements and their tests
RCON-API-001 pass
createConnection(options)returns an object whose one call isrun(name, { data, args, dataId }).RCON-API-002 pass
runalways resolves to a result object and never rejects, whatever is thrown underneath, including a bare string.RCON-API-003 pass
A call
runcannot make sense of (no function name, data that is not an array of records, arguments that are not named) resolves to anerrorresult whose message beginsbio.viz:, and does not start R.RCON-API-004 pass
A connection is refused when it is created if a browser-form setting is malformed: packages that are not a list of valid R package names, a source that is not text, both a source and a source URL, a location that is not text, or an engine without
startandcall.RCON-API-005 pass
Both committed bundles export the connection and the formatter as
r.createConnectionandr.formatStatistic:BioViz.ron a page.RCON-RES-001 pass
When R answers, the result is
{ status: 'ok', value, form }: the value R returned, and which form answered,precomputedorbrowser.RCON-RES-002 pass
With neither form configured, the result is
{ status: 'unavailable', reason: 'no-r-attached', message }, and nothing is requested.RCON-RES-003 pass
When the R function fails, the result is
{ status: 'error', message }with R's message.RCON-PRE-001 pass
With stored results, a call that has one is answered without starting R and without a network request.
RCON-PRE-002 pass
A stored result is found by its function name, its arguments and its data identity together; the order the arguments are written in does not matter.
RCON-PRE-003 pass
A call with no exact stored result is answered
unavailablewith reasonnot-precomputedand no value: another function, other arguments, other data, no data identity given, or a row count that differs from the one recorded.RCON-PRE-004 pass
Stored results that are malformed, or that hold two results under one key, are refused when the connection is created.
RCON-PRE-005 pass
With both forms configured, a call with no stored result is answered by R in the browser.
RCON-PRE-006 pass
Changing a value a call returned does not change the stored result.
RCON-LAZY-001 pass
Creating a connection starts nothing; the first run that needs R starts the engine, with the location, packages and source the connection was given.
RCON-LAZY-002 pass
Two simultaneous first calls cause one start, and later calls reuse it.
RCON-LAZY-003 pass
A start that fails answers
unavailablewith reasonload-failedand the cause, for every call waiting on it, and the next run tries again.RCON-LAZY-004 pass
In the browser form nothing is requested until the first run, and two simultaneous first runs load webR once.
RCON-ISO-001 pass
Two connections share no state: each has its own stored results and starts its own engine.
RCON-WEBR-001 pass
webR is pinned to version 0.6.0 and loaded from its public CDN unless another location is given; a location relative to the page is resolved against the page.
RCON-WEBR-002 pass
webR is started on the PostMessage channel on every host.
RCON-WEBR-003 pass
The R packages the connection was told to are installed and attached, and the R source it was given is evaluated once.
RCON-WEBR-004 pass
An R source given by URL is fetched on the first run, not before, and once.
RCON-WEBR-005 pass
A start that fails part-way closes the R session it opened and reports the cause.
RCON-CALL-001 pass
The array of records goes to R as one column per variable, with the function name and the arguments, each as an R named list.
RCON-CALL-002 pass
Every column has a value for every row; a value that is absent or not a number goes to R as missing.
RCON-CALL-003 pass
The list R returns comes back as plain JavaScript objects, arrays, numbers, text and booleans.
RCON-CALL-004 pass
Each kind of R value other than a data frame has one JavaScript shape: a named list or named vector is an object, an unnamed list is an array, an unnamed vector is a single value when its length is one and an array otherwise, and NULL or NA is null. A value with no plain form is an error.
RCON-CALL-005 pass
An R error is reported with R's own message and nothing added, and the R objects made for a call are released whether it succeeds or fails.
RCON-CALL-006 pass
Nested arguments go to R as nested lists, and a call with no data or no arguments sends none.
RCON-CALL-007 pass
The R code that passes a table in and a result out uses base R only, and computes no statistic.
RCON-CALL-008 pass
A data frame R returns, at any depth, comes back as an array of row objects, one per row, with every column in every row and NA as null: an empty array for no rows and an array of one object for one row, the same shape
datahas going in.RCON-BUILD-001 pass
The build bundles only files under
src/and does not resolve the webR import.RCON-BUILD-002 pass
The committed bundles keep the import of webR as a run-time import of a URL and contain none of webR: every file a bundle names as one it was made from is a file under
src/, and the bundles hold no known marker of webR's code.RCON-BUILD-003 pass
The
rmodule imports nothing from outsidesrc/r/, so the connection can be handed to a chart in another library.RCON-CHECK-001 pass
On the R check page two numbers count as the same answer when they differ by no more than 1 part in 10^8 of the larger; zero equals only zero, and something that is not a number equals nothing.
RCON-CHECK-002 pass
Every member of an answer is compared with the expected one: numbers by the tolerance; text, counts, warnings and the shape of the answer exactly. A member missing or added fails.
RCON-CHECK-003 pass
A number is shown in full, as the shortest text that reads back as exactly that number, so a difference in the last digit is visible.
RCON-CHECK-004 pass
The page's tables are read from CSV with their numeric columns as numbers and blanks as missing.
RCON-CHECK-005 pass
The committed expected results name the script, the R version and the survival version that made them.
RCON-CHECK-006 pass
Each expected result is a stored result on its committed table: given to the precomputed form with that table, it is answered.
RCON-PAGE-001 pass
The R check page has a button that starts R and does not start it otherwise; it states the tolerance and the R and survival versions that made the desktop answers.
RCON-PAGE-002 pass
The page shows the recorded megabytes, requests, requests answered from the network and seconds for three states named separately, cold, reload and warm, with the browser, machine, date and method of the measurement.
RCON-PAGE-003 pass
With no measurement recorded the page says so and prints no number in its place.
RCON-LIVE-001 pass
On the R check page, with no R attached, the call answers that statistics are unavailable.
RCON-LIVE-002 pass
On the R check page the precomputed form gives the desktop-R answers for both tests with no R loaded and no request to R's hosts.
RCON-LIVE-003 pass
R started in the browser gives the Wilcoxon rank-sum result desktop R gives, within the stated tolerance.
RCON-LIVE-004 pass
The survival package installs and loads in the browser, and the log-rank result is the one desktop R gives, within the stated tolerance.
RCON-LIVE-005 pass
Cold, a first visit with nothing cached: megabytes over the network, requests and seconds to the first result are measured, and webR is loaded once from the pinned version on its public CDN.
RCON-LIVE-006 pass
Reload, the page loaded again with the files in the browser's cache: R starts again, gives the same answers, and less comes over the network than on the first visit; megabytes, requests and seconds are measured.
RCON-LIVE-007 pass
Warm, R already running in the page: a repeated call makes no request and takes less time than the first result; its seconds are measured.
RCON-LIVE-008 pass
The R check page holds at a 390-pixel-wide viewport with no horizontal scroll, with its results shown.
RCON-LIVE-009 pass
The three measurements are printed in the run's log, attached to the test and written to a file, with the browser, the machine and how sizes were counted.
PVAL-FMT-001 pass
An ordinary p-value is printed to three decimals, after the method's name and before the counts used.
PVAL-FMT-002 pass
A p-value below 0.001 is printed as
p < 0.001, never as zero or in exponent form.PVAL-FMT-003 pass
A p-value that would round to 1.000 is printed as
p > 0.999.PVAL-FMT-004 pass
Counts are printed for each group by name, or as one total.
PVAL-RULE-001 pass
A p-value whose result names no method is refused: the text says so and prints no number.
PVAL-RULE-002 pass
A p-value whose result gives no counts is refused: the text says so and prints no number.
PVAL-RULE-003 pass
A result is labelled exploratory, and unadjusted unless the result names an adjustment, which is then named.
PVAL-RULE-004 pass
The text never contains a star or the word significant, however small the p-value.
PVAL-RULE-005 pass
Where R gave a reason in place of a number, such as a group too small to test, the reason is printed and no number is.
PVAL-RULE-006 pass
A p-value that is not a number from 0 to 1 is refused, not repaired.
PVAL-RULE-007 pass
The formatter computes nothing: the same result always gives the same text, and the result is left unchanged.
PVAL-RULE-008 pass
A reason that already says the result was not computed is printed as it is, with the counts after it, so that "not computed" is said once.
PVAL-RULE-009 pass
A result R marked as an error is printed as R's message, said to be an error, with the counts where R knew them and no number.
PVAL-RULE-010 pass
An adjustment R names by its
p.adjustmethod is printed by its usual name,holmas Holm andBHas Benjamini-Hochberg; any other name is printed as given.PVAL-EST-001 pass
An estimate is printed with its name, what it is an estimate of, and its interval with the level R gave, each number to four significant figures; an estimate with no interval is printed without one.
PVAL-EST-002 pass
An estimate with no name or no finite number, or with an interval that has a part missing, is refused, and no number is printed in its place.
PVAL-MED-001 pass
A median survival time is printed with what it is a median of and its interval with the level R gave, to four significant figures; a median or a bound R did not reach reads not reached.
PVAL-MED-002 pass
A median with no name, a part that is neither a number nor missing, or no level for its interval, is refused, and no number is printed in its place.
PVAL-ROW-001 pass
One comparison of two groups from a result's rows is formatted by the rules a whole result is held to: its p-value, the adjusted one, comes with its method, the two groups' counts and its label, and is handed over in parts for a table only with them.
PVAL-ROW-002 pass
A comparison with no method, no counts or no two groups is refused, and one R could not compute shows R's words and no number.
PVAL-GRP-001 pass
One group's result from a result's rows is formatted by the rules a whole result is held to: its estimate comes with its interval at the level R gave, or with none where R gave none, and its p-value with its method, the group's count and its label; all are handed over in parts for a table only together.
PVAL-GRP-002 pass
A group's result with no group name, no method, no count, no estimate or half an interval is refused, and one R could not compute shows R's words and no number.
PVAL-PAIR-001 pass
One pair's result from a correlation matrix's rows is formatted without a p-value: its estimate to four significant figures, its interval at the level R gave, or none where R gave none, and the number of complete pairs; all are handed over in parts for a cell and a table. A p-value on the row is neither read nor printed.
PVAL-PAIR-002 pass
A pair's result that does not name its two variables, or has no count, no estimate or half an interval, is refused, and one R could not compute shows R's words with its count and no number.
PVAL-SCREEN-001 pass
One row of a biomarker screen is formatted by the rules a whole result is held to: its estimate with its interval at the level R gave, or none where R gave none, its unadjusted p-value with its method and counts, each group's for a difference, and its adjusted p-value with the adjustment by name and how many rows it was adjusted across; all are handed over in parts for a table.
PVAL-SCREEN-002 pass
A row with no biomarker, no method, no counts, no estimate, half an interval, no adjustment or no number of rows adjusted across is refused, and one R could not compute shows R's words with its counts and no number.
PVAL-FMT-005 pass
The README's example prints what
formatStatisticprints for desktop R's own Wilcoxon answer, R's method name as R wrote it.
Checking this page
npm ci
npm run evidence:check # rerun every test and compare with the committed evidence set
npm run evidence # rebuild docs/evidence/r-connection/evidence.json
