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

Starting relative directory is always ~/.gauge/plugins/python/<version> and isn't being changed when specifying '--dir .' #6

Closed
galacticgumshoe opened this issue Jul 15, 2016 · 2 comments

Comments

@galacticgumshoe
Copy link

galacticgumshoe commented Jul 15, 2016

I have initialized my gauge project at ~/GitHub/sceo-test-suite on my local system. I have a docker compose file which I am running to simulate my testing environment, and I placed that in a new directory called ~/GitHub/sceo-test-suite/compose/message-pull-producer. So far I've had to "hard code" an absolute path to this file in my Python code (/Users/myuser/GitHub/sceo-test-suite/compose/message-pull-producer), which won't work if any of my other co-workers wants to clone this project and run it on their systems. I also need to promote this to a Ubuntu OpenStack server in my CICD environment to automate the system tests. So I really need relative pathing to work. For example, if I am currently in ~/GitHub/sceo-test-suite and I run 'gauge --dir . specs' I get this error when my Python code is using os.getcwd():

.IOError: [Errno 2] No such file or directory: '/Users/myuser/.gauge/plugins/python/0.1.3/compose/message-pull-producer-environment/docker-compose.yml'

You can see that my present working directory has somehow shifted from where I executed the gauge command to start in ~/.gauge/plugins/python/0.1.3. It expects then that I essentially have initialized my project in the plugin subdirectory and will always be working from there. Effectively ignoring the '--dir .' I passed in at runtime.

@kashishm
Copy link
Collaborator

@galacticgumshoe Thanks for logging the issue. I have released Gauge-Python 0.1.4 with the fix. Now the runner sets the working directory to gauge project root.

Run the following commands to update the plugin:

gauge --update python
pip install --upgrade getgauge

@galacticgumshoe
Copy link
Author

@kashishm I upgraded and tested it. Works great now, I can pass in '--dir .' and it properly finds my directories/files starting from project root. Thank you!

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

No branches or pull requests

2 participants