libelektra icon indicating copy to clipboard operation
libelektra copied to clipboard

shell recorder: safe working directory

Open markus2330 opened this issue 7 years ago • 8 comments

It might be a good idea to create a temporary directory below TMPDIR and set HOME and PWD to this path. Potential leftovers and programming errors would only affect this directory.

This is already done for the cframework test cases and works there quite well.

EDIT:

Furthermore, we need variables, that:

  • point to the Markdown file executed
  • point to the top-level source dir

see also #1955 and #1981 for rationale

markus2330 avatar May 12 '18 15:05 markus2330

This way we would also get rid of the leftovers files "stderr" and stdout" which are left in the source repo from time to time.

markus2330 avatar May 12 '18 15:05 markus2330

@sanssecours wrote:

That is certainly a must have, if we execute tests in a random location. This behavior sounds also very similar to the way Cram handles this: Cram sets the variable TESTDIR to the location of the file under test.

Could you please elaborate? TESTDIR points to a file?

markus2330 avatar May 16 '18 06:05 markus2330

Could you please elaborate? TESTDIR points to a file?

The variable saves the directory of the file under test. For example, if your file under test is foo/bar/test.t, then the variable contains the value foo/bar.

sanssecours avatar May 16 '18 06:05 sanssecours

I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:

stale[bot] avatar Apr 15 '21 16:04 stale[bot]

I closed this issue now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:

stale[bot] avatar Apr 30 '21 06:04 stale[bot]

Tests should definitely be more isolated (e.g. like proposed here somewhere under TMPDIR) and never modify other existing (configuration) files.

mpranj avatar Apr 30 '21 13:04 mpranj

I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:

stale[bot] avatar Jul 30 '22 23:07 stale[bot]

I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:

github-actions[bot] avatar Feb 19 '24 01:02 github-actions[bot]

I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue. Thank you for your contributions :sparkling_heart:

github-actions[bot] avatar Mar 04 '24 01:03 github-actions[bot]