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

If tests are run or skipped depends on CWD #146

Open
okin opened this issue Feb 15, 2021 · 1 comment
Open

If tests are run or skipped depends on CWD #146

okin opened this issue Feb 15, 2021 · 1 comment

Comments

@okin
Copy link
Collaborator

okin commented Feb 15, 2021

Describe the bug
The load_config function uses relative paths and so running pytest from the root directory does not pick up VM configs while running it from the tests folder does.

To Reproduce

  1. git clone the repo
  2. Install dependecies with pip install -r requirements-tests.txt
  3. go to the tests directory with cd tests/
  4. link the vagrant config files (i.e. ln -s nagios_config.json.vagrant nagios_config.json)
  5. Run pytest: It will pick up tests and tries to execute them, i.e. the tests for Nagios
  6. Move to the project root - cd ..
  7. Run pytest again: it will now skip the tests it attempted to run previously.

Expected behavior
There is no difference if I run this inside the tests folder or not.

@okin
Copy link
Collaborator Author

okin commented Apr 1, 2021

Also the pytest config for being inside the folder tests/ and being in the project root are different.
This leads to not always having the same test results.

okin added a commit to okin/katprep that referenced this issue Apr 1, 2021
Should probably be a link

References stdevel#146
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant