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

Make temporary data directories configurable #15

Closed
fizyk opened this issue Oct 12, 2016 · 5 comments
Closed

Make temporary data directories configurable #15

fizyk opened this issue Oct 12, 2016 · 5 comments

Comments

@fizyk
Copy link
Member

fizyk commented Oct 12, 2016

From @enkore on May 4, 2016 10:20

Currently these are hardcoded to paths like /tmp/<dbname>.<port> or similar paths (e.g. /tmp/postgresqldata.5433). It would be nice if this could be influenced in some way, e.g. an environment variable.

Use case: This would allow to put these temporary paths in the working directory of CI jobs (travis, jenkins, ...), which rules out any issues that can occur with multiple jobs running in parallel. It also would make clean-up in case of crashes/errors easier (since the workdir is usually either automatically deleted after or before each build, or can be easily deleted from within the CI software).

Copied from original issue: ClearcodeHQ/pytest-dbfixtures#151

@fizyk
Copy link
Member Author

fizyk commented Oct 12, 2016

@enkore I believe this would help: http://pytest-dbfixtures.readthedocs.io/en/latest/configure.html#use-your-custom-path-for-logs

Mind, that having a port in dir name usually helps distinguish folders for different test runs, although that doesn't help with separating paths for different runs

@fizyk
Copy link
Member Author

fizyk commented Oct 12, 2016

From @enkore on May 5, 2016 8:15

Adding a plugin config option to set the data dir base path (/tmp) seems reasonable to me and would be consistent with this option for the log files.

@fizyk
Copy link
Member Author

fizyk commented Oct 12, 2016

Okay, the way I see it it would be --dbfixtures-logsdir for logs specifically or --dbfixtures-datadir for all files.

@fizyk
Copy link
Member Author

fizyk commented Oct 12, 2016

From @mmaslowskicc on May 25, 2016 8:5

Alternatively, we could support environment variables like TMPDIR, so it will be consistent with more other software using temporary files. (There is some more complex logic in https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp.)

@fizyk
Copy link
Member Author

fizyk commented Oct 12, 2016

@enkore could you check if the pytest-postgresql options will work for you? :)

@fizyk fizyk closed this as completed May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant