Skip to content

Fix test suite: init SDK once, search parents for sample data#3

Closed
r-heller wants to merge 2 commits into
mainfrom
fix/test-suite
Closed

Fix test suite: init SDK once, search parents for sample data#3
r-heller wants to merge 2 commits into
mainfrom
fix/test-suite

Conversation

@r-heller

Copy link
Copy Markdown
Collaborator

Summary

  • The CUVIS SDK does not support repeated init/shutdown cycles in the same process. Calling cuvis_init() in every test_that block was segfaulting on the second iteration of the test run. Moved a single init + teardown to setup.R and removed all per-test init/shutdown calls.
  • cuvis_sample_data() now walks up parent directories looking for a .cuvis/ folder, so tests that run from tests/testthat/ (where getwd() is the testthat dir) still locate sample data committed at the repo root.
  • Print methods write through cli, which goes to the message stream; capture it explicitly in the print-method tests.
  • Session export to .cu3s requires buffer layers that the bundled preview-only sample lacks; skip that test with a clear reason instead of failing.
  • Session export integration test now reprocesses the measurement before attempting export.

Result: devtools::test() goes from 17 silent skips (no data discovered) and a segfault on the second test that did try data, to 35 passing / 1 skipped / 0 failed. R CMD check is clean (1 NOTE: unrelated to these changes).

Test plan

  • devtools::test() — 35 PASS / 1 SKIP / 0 FAIL
  • devtools::check() — 0 errors / 0 warnings / 1 note (top-level file, unrelated)

- The CUVIS SDK does not support repeated init/shutdown cycles in the
  same process; calling cuvis_init() in every test_that block was
  segfaulting after the first iteration. Move the single init+teardown
  to setup.R and remove the per-test cuvis_init/cuvis_shutdown pairs.
- cuvis_sample_data() now walks up parent directories looking for a
  .cuvis/ folder, so tests that run from tests/testthat/ can still
  locate the sample data committed at the repo root.
- Print methods write through cli, which goes to the message stream;
  capture it explicitly in the print-method tests.
- session export to .cu3s requires buffer layers that the bundled
  preview-only sample lacks; skip that test with a clear reason.
- Fix the session export integration test to reprocess the measurement
  before attempting the export.
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.

1 participant