Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXPORTED_TESTS_DIR Error: ENOTDIR: not a directory, mkdir '~/.nvm/versions/node/v18.18.0/bin/pythagora/pythagora_tests' #60

Open
gardner opened this issue Oct 2, 2023 · 1 comment

Comments

@gardner
Copy link

gardner commented Oct 2, 2023

The test dir is trying to create a directory where file exists:

npm i pythagora
npx pythagora \
  --unit-tests \
  --path src/controllers/list.js \
  --pythagora-api-server http://localhost:3000

Starting generation of unit tests...
node:internal/fs/utils:350
    throw err;
    ^

Error: ENOTDIR: not a directory, mkdir '/Users/gardner/.nvm/versions/node/v18.18.0/bin/pythagora/pythagora_tests'
    at Object.mkdirSync (node:fs:1398:3)
    at /Users/gardner/.nvm/versions/node/v18.18.0/lib/node_modules/pythagora/src/helpers/starting.js:105:47
    at Array.forEach (<anonymous>)
    at setUpPythagoraDirs (/Users/gardner/.nvm/versions/node/v18.18.0/lib/node_modules/pythagora/src/helpers/starting.js:103:17)
    at Object.<anonymous> (/Users/gardner/.nvm/versions/node/v18.18.0/lib/node_modules/pythagora/src/scripts/unit.js:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:86:12) {
  errno: -20,
  syscall: 'mkdir',
  code: 'ENOTDIR',
  path: '/Users/gardner/.nvm/versions/node/v18.18.0/bin/pythagora/pythagora_tests'
}

Node.js v18.18.0
Bash script exited with code 0

When we inspect the path:

ls -lah /Users/gardner/.nvm/versions/node/v18.18.0/bin/pythagora
lrwxr-xr-x  1 gardner  staff    44B  3 Oct 12:13 /Users/gardner/.nvm/versions/node/v18.18.0/bin/pythagora -> ../lib/node_modules/pythagora/src/bin/run.js

These appear to be consts defined in https://github.com/Pythagora-io/js-code-processing

How can we pass a value in for test directory?

@gardner gardner changed the title Error: ENOTDIR: not a directory, mkdir '/Users/gardner/.nvm/versions/node/v18.18.0/bin/pythagora/pythagora_tests' Error: ENOTDIR: not a directory, mkdir '~/.nvm/versions/node/v18.18.0/bin/pythagora/pythagora_tests' Oct 2, 2023
@gardner gardner changed the title Error: ENOTDIR: not a directory, mkdir '~/.nvm/versions/node/v18.18.0/bin/pythagora/pythagora_tests' EXPORTED_TESTS_DIR Error: ENOTDIR: not a directory, mkdir '~/.nvm/versions/node/v18.18.0/bin/pythagora/pythagora_tests' Oct 2, 2023
@gardner
Copy link
Author

gardner commented Oct 2, 2023

To reproduce this issue check out the branch from the PR and run:

docker build -t pythagora .
docker run -v /Volumes/src/jellyfin-web:/data -it pythagora npx pythagora \
  --unit-tests \
  --path /data/src/controllers/list.js

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

No branches or pull requests

1 participant