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

Unable to run because of failure to create output directory #251

Open
DonAmit opened this issue Jan 3, 2025 · 13 comments · May be fixed by #256
Open

Unable to run because of failure to create output directory #251

DonAmit opened this issue Jan 3, 2025 · 13 comments · May be fixed by #256

Comments

@DonAmit
Copy link

DonAmit commented Jan 3, 2025

I'm trying to run shortest test from my folder in D:, however if fails to start with the following error. Where do I set a custom output directory? or should I be running it from C: only?

D:\work\shortestai\app\__tests__\login.test.ts
X [ERROR] Failed to create output directory: mkdir C:\Users\amit\AppData\Local\Temp\shortest-cache\D:: The filename, directory name, or volume label syntax is incorrect.

X [ERROR] Failed to create output directory: mkdir C:\Users\amit\AppData\Local\Temp\shortest-cache\D:: The filename, directory name, or volume label syntax is incorrect.


Test Execution Error: Build failed with 2 errors:
error: Failed to create output directory: mkdir C:\Users\amit\AppData\Local\Temp\shortest-cache\D:: The filename, directory name, or volume label syntax is incorrect.
error: Failed to create output directory: mkdir C:\Users\amit\AppData\Local\Temp\shortest-cache\D:: The filename, directory name, or volume label syntax is incorrect.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 Tests    0 passed (0)
 Duration   0.29s
 Start at   7:41:15 pm

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
@gladyshcodes
Copy link
Contributor

Hi there! I will take a look today and let you know

@PedroAVJ
Copy link
Contributor

PedroAVJ commented Jan 3, 2025

Got a similar bug when developing locally

PS C:\Users\pedro\OneDrive\Escritorio\shortest> pnpm shortest:dev --headless

> @ shortest:dev C:\Users\pedro\OneDrive\Escritorio\shortest
> npx tsx packages/shortest/src/cli/bin.ts "--headless"


📄 C:\Users\pedro\OneDrive\Escritorio\shortest\google.test.ts
X [ERROR] Failed to create output directory: mkdir C:\Users\pedro\AppData\Local\Temp\shortest-cache\C:: The filename, directory name, or volume label syntax is incorrect.

X [ERROR] Failed to create output directory: mkdir C:\Users\pedro\AppData\Local\Temp\shortest-cache\C:: The filename, directory name, or volume label syntax is incorrect.


Test Execution Error: Build failed with 2 errors:
error: Failed to create output directory: mkdir C:\Users\pedro\AppData\Local\Temp\shortest-cache\C:: The filename, directory name, or volume label syntax is incorrect.
error: Failed to create output directory: mkdir C:\Users\pedro\AppData\Local\Temp\shortest-cache\C:: The filename, directory name, or volume label syntax is incorrect.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

 Tests    0 passed (0)
 Duration   0.47s
 Start at   17:01:21

⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯

@PedroAVJ
Copy link
Contributor

PedroAVJ commented Jan 4, 2025

Probably obvious but may as well leave it here. It only happens on windows, I ran the same command on a linux devcontainer and worked fine. From my debugging, it seem to be related to the TestCompiler class, so maybe worth taking a look

@gladyshcodes
Copy link
Contributor

gladyshcodes commented Jan 4, 2025

Cannot really test this one as I am not a windows user.

However, I can help you with troubleshooting:

  1. looking at temp path, I see two abnormalities: 'C::' at then end of the path and the fact that disc is always C
  2. apparently the problem is this line of code
  3. path.join is a platform independent way to concatenate paths. The drive letter on the other hand is windows only
  4. apparently, tmpdir gets tmp dir from you computer ENV, verify it's set up correctly. if the problem is here, we should open PR to stop to depend on user's computer config
  5. try to delete the folder if it's present, hard code the line with correct path and run it again

let me know if any of this helps

@DonAmit
Copy link
Author

DonAmit commented Jan 4, 2025 via email

@Nuzhacks
Copy link

Nuzhacks commented Jan 4, 2025

Im also getting the same issue running on windows. anyone been able to resolve? thanks

@PedroAVJ
Copy link
Contributor

PedroAVJ commented Jan 4, 2025

I'll work on a fix. I have a windows machine, and I think a good chunk of users would be trying this library in a windows machine, it should be bug free.

@gladyshcodes
Copy link
Contributor

gladyshcodes commented Jan 4, 2025

I'll work on a fix. I have a windows machine, and I think a good chunk of users would be trying this library in a windows machine, it should be bug free.

great! If you need any help with this, reach out. we can also have a call

@PedroAVJ
Copy link
Contributor

PedroAVJ commented Jan 4, 2025

A call would be great actually!

@PedroAVJ PedroAVJ linked a pull request Jan 4, 2025 that will close this issue
@DonAmit
Copy link
Author

DonAmit commented Jan 7, 2025

@PedroAVJ Looks like this is fixed but not merged. Is there any way I can get the fix and try it out?

@PedroAVJ
Copy link
Contributor

PedroAVJ commented Jan 7, 2025

You can run pnpm pack to build the tgz bundle and use that when running pnpm install. We can setup a quick discord call if you want

@patelmayankce
Copy link

Please merge the PR.

@rmarescu
Copy link
Member

rmarescu commented Jan 8, 2025

@patelmayankce have you had a chance to try out the changes on your end as well? It would be great to test in a another Windows environment before merging.

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 a pull request may close this issue.

6 participants