Repository navigation
test(fixture): derive the ProjectFixture profile name from a uuid - #161
Merged
Merged
Conversation
ProjectFixture creates a NANSEN user profile under prefdir, a folder
shared by every MATLAB process on the machine, and named it
sprintf('test%d', randi(999)). A fresh MATLAB process always starts
from the same default RNG seed, so two test processes that start
together draw the same number and share one profile folder: the
second one fails in nansen.mock.createMockProject with "A project
with name MockProject already exists", and the first one's teardown
then removes the shared folder underneath the second, which fails
again in its own teardown.
The name is now sprintf('test_%s', nansen.util.getuuid()), unique per
process and per fixture instance. The "test" prefix stays so leftover
profiles remain recognisable. The teardown is unchanged, and nothing
else in code/ or tests/ depends on the test<number> form.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
Test Results407 tests 407 ✅ 43s ⏱️ Results for commit 7ad918d. |
Collaborator
Author
ReviewVerdict: ready to merge. No findings.
Merge note: #127, #121 and #126 also edit 🤖 Generated with Claude Code |
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.
nansen.fixture.ProjectFixturecreates a NANSEN user profile underprefdir, a folder shared by every MATLAB process on the machine, and named itsprintf('test%d', randi(999)). A fresh MATLAB process always starts from the same default RNG seed, so two test processes that start at the same time draw the same number and share one profile folder.With a shared profile, the second process fails in
nansen.mock.createMockProjectwith "A project with name MockProject already exists", and the first process's teardown then removes the profile folder underneath the second, which fails again in its own teardown with "Cannot create 'project_catalog.mat' because '.../Nansen/test814/projects' does not exist".The profile name is now
sprintf('test_%s', nansen.util.getuuid()), which is unique per process and per fixture instance. Thetestprefix stays so leftover profiles remain recognisable. The teardown is unchanged, and nothing else incode/ortests/depends on thetest<number>form.🤖 Generated with Claude Code