bids-standard / bids-validator

Validator for the Brain Imaging Data Structure
https://bids-standard.github.io/bids-validator/
MIT License
179 stars 109 forks source link

[SCHEMA] Validator Fails In Unique Ways on Mac #1645

Closed bendhouseart closed 3 weeks ago

bendhouseart commented 1 year ago

Running Deno tests on osx produces failing tests that pass elsewhere, namely:

hasMatch and missingLabel

System:

macOS Monterey Version 12.6.3

deno --version
deno 1.31.1 (release, aarch64-apple-darwin)
v8 11.0.226.13
typescript 4.9.4

To reproduce:

git checkout 059caf33c4ea0c2844269c9273d27873c51c1ca4
git submodule update --init --recursive
git submodule update --recursive --remote
cd bids-validator
deno test --allow-all src/

Expected Results (only three of these should fail):

 FAILURES 

validate bids-examples => ./src/tests/local/bids_examples.test.ts:32:6
empty_files dataset => ./src/tests/local/empty_files.test.ts:12:6
validate schema expression tests => ./src/tests/schema-expression-language.test.ts:11:6

Actual Results:

2 additional failures: hasMatch and missingLabel

 FAILURES 

validate bids-examples => ./src/tests/local/bids_examples.test.ts:32:6
empty_files dataset => ./src/tests/local/empty_files.test.ts:12:6
validate schema expression tests => ./src/tests/schema-expression-language.test.ts:11:6
test hasMatch => ./src/validators/filenameIdentify.test.ts:68:6
test missingLabel => ./src/validators/filenameValidate.test.ts:16:6

FAILED | 21 passed (225 steps) | 5 failed (127 steps) (28s)

error: Test failed
rwblair commented 1 year ago

File with underscore and no hyphens errors out. ... FAILED (6ms) error: NotFound: No such file or directory (os error 2): stat '/tmp/folders' this.#fileInfo = Deno.lstatSync(this._getPath())

No match ... FAILED (5ms) error: NotFound: No such file or directory (os error 2): stat '/tmp/folders' this.#fileInfo = Deno.lstatSync(this._getPath())

effigies commented 1 year ago

Looks like we hard-code /tmp in a couple places. Should use mkdtemp which seems to exist in both node and deno.

effigies commented 3 weeks ago

I believe this has been done. Please reopen if not.