Comments (11)
Yep, that's intended bahaviour - the run
helpers runs the command in a subprocess in isolation, purely so that the $output
and $state
can be asserted against. To do something like the above, you'd be better off with one of the following options:
# Call the full path firectly
run cat foo/bar
# Or, if the cd is absolutely necessary, run it in the main
# test scope, so that it affects the test process, and is not
# run in an isolated subprocess
cd foo
run cat bar
from zunit.
In my case the second option seems necessary as cd'ing to the directory is part of the test (this is for testing https://github.com/MichaelAquilina/zsh-autoswitch-virtualenv).
However, for some reason the cd fails without any good reason. I am guessing this is more to do with what my plugin is doing than zunit so I feel like I need to dig into this more.
from zunit.
Is it the master branch which is failing? I spotted this typo in the @setup function if that helps. It's present in all three test files.
I'll download a copy of that repo when I get home and take a look
from zunit.
That should work, It's a zsh shortcut:
$ echo =virtualenvwrapper.sh
/home/michael/.virtualenvs/zsh-autoswitch-virtualenv/bin/virtualenvwrapper.sh
Its almost equivalent to which
from zunit.
Oh, nice. I hadn't heard of that before. I figured it was a variable assignment
from zunit.
I'm getting errors when I'm running the tests that the virtualenvwrapper.sh
script can't be found. Am I looking at the wrong branch? (This is on master)
TAP version 13
not ok 1 - Failure: changing to a directory without .venv defaults
---
message: __zunit_test_setup:1: virtualenvwrapper.sh not found
severity: fail
...
not ok 2 - Failure: changing to a directory with .venv autoswitches
---
message: __zunit_test_setup:1: virtualenvwrapper.sh not found
severity: fail
...
not ok 3 - Failure: chpwd functions are loaded
---
message: __zunit_test_setup:2: virtualenvwrapper.sh not found
severity: fail
...
not ok 4 - Failure: _check_venv_path with non-existent path
---
message: __zunit_test_setup:2: virtualenvwrapper.sh not found
severity: fail
...
not ok 5 - Failure: _check_venv_path with no venv
---
message: __zunit_test_setup:2: virtualenvwrapper.sh not found
severity: fail
...
not ok 6 - Failure: _check_venv_path with existing venv
---
message: __zunit_test_setup:2: virtualenvwrapper.sh not found
severity: fail
...
not ok 7 - Failure: _check_venv_path in subdirectory with parent venv
---
message: __zunit_test_setup:2: virtualenvwrapper.sh not found
severity: fail
...
not ok 8 - Failure: rmvenv with no .venv
---
message: __zunit_test_setup:2: virtualenvwrapper.sh not found
severity: fail
...
not ok 9 - Failure: rmvenv with existing .venv
---
message: __zunit_test_setup:2: virtualenvwrapper.sh not found
severity: fail
...
not ok 10 - Failure: rmvenv with existing .venv with deleted virtualenv
---
message: __zunit_test_setup:2: virtualenvwrapper.sh not found
severity: fail
...
1..10
from zunit.
Have you installed virtualenvwrapper?
pip install virtualenvwrapper
You will probably need to use sudo to install that (or use a python virtualenv)
from zunit.
Ah, that would help. Can you tell I'm not a python guy? 😂
from zunit.
haha no problem! I was away in Germany the past few days so I havent managed to give this a look since we last spoke. Any luck from your side? I will probably try find some time today to try clean this all up
from zunit.
Sorry, I haven't got anywhere with this. I've had a couple of attempts, but I've had no luck getting virtualenvwrapper
itself set up properly in order to run these tests. If you have a Vagrantfile/Dockerfile with an environment where this runs I'd be happy to take another look in that environment.
However, looking at the travis output from the master branch, ZUnit doesn't appear to be doing anything that it's not supposed to. Did the cd
failure that you reference above happen in master
, or another unpublished branch?
from zunit.
I need to give the tests for this project a proper look because i noticed quite a few are passing automatically due to the contains
bug. So better I gather some more information for you first :)
from zunit.
Related Issues (20)
- _zunit_run_testfile:21: tests: assignment to invalid subscript range HOT 4
- Feature request: option to copy stderr of run statements to another file / file descriptor HOT 6
- Completely missing steps in setup
- Other installation methods HOT 3
- 'Assertion world does not exist' is not empty HOT 5
- A general question HOT 4
- Better error handling or debug/verbose behavior, please?
- Files in tests directory should be ignored when they lack a .zunit extension
- The homebrew statement "bottle :unneeded" is deprecated and needs to be removed
- [feature] Shell completion HOT 1
- [feature] Support codecov
- Provide a way to run a specific set of test(s) HOT 2
- Add option to run tests asynchronously HOT 1
- Make init --travis idempotent HOT 1
- Better documentation HOT 2
- "Missing required dependency" - Potential Regression in zunit 0.8.2? HOT 4
- Enable config environment variables over .zunit.yml HOT 1
- Unable to get --time-limit option to work (via cli or .yml) HOT 1
- Coding style – uses forks? HOT 6
- Provide option to output JUnit XML
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zunit.