Fix test suite: init SDK once, search parents for sample data#3
Closed
r-heller wants to merge 2 commits into
Closed
Fix test suite: init SDK once, search parents for sample data#3r-heller wants to merge 2 commits into
r-heller wants to merge 2 commits into
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cuvis_init()in everytest_thatblock was segfaulting on the second iteration of the test run. Moved a single init + teardown tosetup.Rand removed all per-test init/shutdown calls.cuvis_sample_data()now walks up parent directories looking for a.cuvis/folder, so tests that run fromtests/testthat/(wheregetwd()is the testthat dir) still locate sample data committed at the repo root..cu3srequires buffer layers that the bundled preview-only sample lacks; skip that test with a clear reason instead of failing.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 checkis clean (1 NOTE: unrelated to these changes).Test plan
devtools::test()— 35 PASS / 1 SKIP / 0 FAILdevtools::check()— 0 errors / 0 warnings / 1 note (top-level file, unrelated)