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

Configurable tmp folder location #336

Closed
viamin opened this issue Jul 10, 2017 · 6 comments
Closed

Configurable tmp folder location #336

viamin opened this issue Jul 10, 2017 · 6 comments
Assignees
Labels
🚀 Feature request New feature request 👶 Good first issue Good for newcomers
Projects

Comments

@viamin
Copy link

viamin commented Jul 10, 2017

Currently Stryker creates a new dot folder in the current working directory which is not in a default temp location https://github.com/stryker-mutator/stryker/blob/8e0e6b016b513a5fbd1f24fc7a08499ef3151dba/packages/stryker/src/utils/StrykerTempFolder.ts#L9, which means every user of stryker needs to edit their .gitignore file.

It would be nice if this location could be configured in the stryker.conf.js file, and by default live in ./tmp/stryker instead of .stryker-tmp

@nicojs nicojs added the 🚀 Feature request New feature request label Jul 11, 2017
@nicojs
Copy link
Member

nicojs commented Jul 11, 2017

Thank you @viamin for reporting this issue.

The position of your .stryker-tmp folder is indeed not ideal. We actually used your system's temp folder earlier, but we ran into a problem: require searches for node_modules relative to your current file. For example: const chai = require('chai'); won't work if you copy your files to your systems temp folder. This is why we ended up with this solution.

In other words: your systems temp folder will only work for browser-based test runners like karma.

If we would add a configuration item for this it will be one more way users can make mistakes in configuring Stryker. It's already kind of hard to do. Would you still want this option?

@viamin
Copy link
Author

viamin commented Jul 11, 2017

I was not referring to system /tmp, but the project root ./tmp, which would be in the same directory as node_modules. I'm proposing a project with these files:
/path/to/project_root/tmp/stryker/ (replacing /path/to/project_root/.stryker-tmp/)
/path/to/project_root/node_modules
/path/to/project_root/package.json
etc.

@nicojs
Copy link
Member

nicojs commented Jul 11, 2017

Ah i see what you mean. That should work indeed. Do you want to take a shot at implementing this? Would you only allow relative path locations? If we allow for the systems tmp folder for example, we should warn people about the node_modules.

@avassem85 avassem85 added the 👶 Good first issue Good for newcomers label Aug 11, 2017
@sharikovvladislav
Copy link
Contributor

I think this one can be implemented after #361 or with it.

@avassem85
Copy link
Contributor

Solution created in #475

@avassem85 avassem85 self-assigned this Nov 26, 2017
@simondel simondel added this to Features in Backlog Jan 10, 2018
@simondel
Copy link
Member

We're closing this issue for now. If someone wants to fix this, let us know!

Backlog automation moved this from Features to Done Feb 13, 2019
nicojs pushed a commit that referenced this issue Sep 5, 2019
* Rename TempFolder to TemporaryDirectory
* Let typed-inject take care of the singleton implementation of the temp dir
* Set a default tempDirName
* docs(options): add temp dir to options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 Feature request New feature request 👶 Good first issue Good for newcomers
Projects
Development

No branches or pull requests

5 participants