yoda icon indicating copy to clipboard operation
yoda copied to clipboard

Yoda diary add notes and tasks outside virtualenv

Open vccolombo opened this issue 6 years ago • 2 comments

What are the steps to reproduce this issue?

  1. … source into venv
  2. … run coverage test in a dev build
  3. … deactivate from venv
  4. ... yoda diary notes / yoda diary tasks

What happens?

… The tests add test notes into the diary

What were you expecting to happen?

… Shouldn't the diary be environment dependable? I mean, if I'm developing a new feature and I want to test it, it adds notes to my 'personal use' yoda outside the virtualenv. And then when I want to use the diary to keep track of my tasks, there is a lot of garbage from the testing. ... Also, it seems that installing yoda again does not clean the diary notes.

Enhancement idea:

... I don't know where the diary is being stored, but is there a way to store in a place that is not the same for all virtualenvs?

vccolombo avatar Jun 14 '18 21:06 vccolombo

@vccolombo yes you're right. I didn't think of that while writing the tests. This also applies while running some other tests, like the ones for flashcards, define etc. We need to create dummy data for tests so that the original config is not disturbed.

Regarding your Enhancement idea, yes, It's possible to implement that too, but it's not there yet.

manparvesh avatar Jun 17 '18 00:06 manparvesh

I think all you need to do is to run tests within a test directory and delete the directory afterwards. Since all the data are currently stored in files and there is no option to delete them, running the tests automatically adds garbage data to the local instance.

So before starting the tests, we should create a test subdirectory and change these values accordingly: YODA_CONFIG_FILE_PATH = os.path.join(os.path.expanduser('~'), '.yodaconfig') DEFAULT_CONFIG_PATH = os.path.join(os.path.expanduser('~'), '.yoda')

After running the tests, the directories would be simply deleted.

zuziik avatar Jun 18 '18 10:06 zuziik