bitovi / academy

Everything we know about frontend, backend, UX, and Devops consulting and management.
https://www.bitovi.com/academy/
14 stars 3 forks source link

Make the exercise test command more resilient to failures #734

Closed chasenlehara closed 2 months ago

chasenlehara commented 2 months ago

I sometimes run into issues with the test script where it is unable to delete the node_modules folder after running an exercise solution’s test.

Since this step is not critical to whether the tests have passed or not, these errors will now be caught and logged, but ignored so the script can keep running.

I’d like to look into why I’m seeing these failures, but in the meantime, I think this improves the script for anyone else who might run into a similar issue.

christopherjbaker commented 2 months ago

I ran into the same issues, but only after running it many times. I think it might be a file handle limit in the OS or something. Restarting VS Code did not fix it, but I'd be restarting the computer would.

We can make the rm -rf conditional on an env that we set in CI.

I also had a thought: Move node_modules to the next folder instead of deleting it. That might make it run much faster, since it can validate instead of downloading most of them.

chasenlehara commented 2 months ago

I ran into the same issues, but only after running it many times. I think it might be a file handle limit in the OS or something. Restarting VS Code did not fix it, but I'd be restarting the computer would.

Good to know that I’m not alone.

We can make the rm -rf conditional on an env that we set in CI.

If we make it optional, I’d still like to avoid using environment variables and have something like a --delete-modules flag instead.

I’ll add this if I get annoyed by the node_modules folders being deleted.

I also had a thought: Move node_modules to the next folder instead of deleting it. That might make it run much faster, since it can validate instead of downloading most of them.

I think we’d have to measure it. I think if we want to improve the speed, we’ll have better luck running some of it in parallel first.

You didn’t approve this PR, was that intentional?