Skip to content

DPI-5053: Serve DownloadXLSX test files from a local server - #82

Open
instantepiphany wants to merge 1 commit into
masterfrom
DPI-5053-local-xlsx-server
Open

instantepiphany wants to merge 1 commit into
masterfrom
DPI-5053-local-xlsx-server

Conversation

@instantepiphany

@instantepiphany instantepiphany commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

DPI-5053 runs this package's tests in Nix, which doesn't allow network access. test-downloadxlsx.R downloaded its fixtures from GitHub and the Q wiki, so it failed there with Could not download file from …. The test is meant to exercise DownloadXLSX()'s download and parsing, not those particular hosts.

What changes

  • tests/testthat/test-downloadxlsx.R: a webfakes app serves tests/testthat/xlsxfiles/ on localhost, and all 11 DownloadXLSX() calls use that URL. DownloadXLSX() still downloads over HTTP, so the download path is still tested. No assertion changed.
  • tests/testthat/xlsxfiles/Cola_Discriminant_Functions.xlsx: new, an unchanged copy of the publicly available Q wiki file the test downloaded before, so it can be served locally.
  • DESCRIPTION: webfakes added to Suggests, since only the tests use it.

How it was verified

Do not merge this PR. It will be merged in order with various other PRs to ensure related fixes land at the same time.

The test downloaded its fixtures from GitHub and the Q wiki, so it failed
without network access, as in the Nix build sandbox. A webfakes server now
serves the same files from tests/testthat/xlsxfiles.
@instantepiphany
instantepiphany marked this pull request as ready for review October 28, 2026 02:53

@Braedon-Wooding-Displayr Braedon-Wooding-Displayr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants