Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Mounting existing files when using the shell recorder without installation #1999

Closed
e1528532 opened this issue May 15, 2018 · 5 comments
Closed
Labels

Comments

@e1528532
Copy link
Contributor

When working with the c-based test interface it is easy to mount an existing configuration file because you would just create a folder inside your plugin folder that has the same name and then the testframework takes care about it.

However, now i want to use such a file in a shell recorder test. Normally you'd find it in KDB_DB_SPEC so it can be mounted relatively using kdb mount prelude.ini spec/..... as the resolver searches for that file in the previously mentioned KDB_DB_SPEC folder.

However when you only build elektra without installing it, i have no idea how to refer to the file in the source folder instead as a fallback. Judging from the test recorder shell script i fear this is not supported is that right?

@markus2330
Copy link
Contributor

markus2330 commented May 15, 2018

Mounting into the spec namespace takes an absolute file name, so a `pwd`/src/plugin.../prelude.ini should work fine.

Btw. I am not perfectly happy about the assumption that the current working directory is elektra's source dir, see #1982.

I would prefer if we have some variables set which allows the user to refer to the source dir.

@sanssecours what do you think?

@sanssecours
Copy link
Member

Mounting into the spec namespace takes an absolute file name, so a `pwd`/src/plugin.../prelude.ini should work fine.

Please also add double quotes around the folder:

mount "`pwd`/src/plugins/haskell/…"

, otherwise the command will not work if the source directory contains space characters. You can also use the variable PWD as replacement for the command pwd:

echo "$PWD/src/plugins/haskell/…"

.

Btw. I am not perfectly happy about the assumption that the current working directory is elektra's source dir, see #1982.

The proposed changes sound good to me.

I would prefer if we have some variables set which allows the user to refer to the source dir.

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.

@e1528532
Copy link
Contributor Author

This works. Thanks a lot! Do you want to leave this issue open for your current working dir assumption discussion or can we close it?

@markus2330
Copy link
Contributor

If everything is clear you can close it. The discussion about the working dir assumption already moved on to #1982.

@e1528532
Copy link
Contributor Author

e1528532 commented Jun 8, 2018

Yes, everything is clear.

@e1528532 e1528532 closed this as completed Jun 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants