git-test
git-test copied to clipboard
Document environment variables exported + add a couple new
Document the existing GIT_TEST_VERBOSITY
and add two new GIT_TEST_NAME
plus GIT_TEST_PREVIOUS_CHECKED_OUT_COMMIT
.
I think the last one should be able to solve issue #13. Not automatically out of the box like requested, but it provides a framework to handle it (explicitly) in a more intelligent and optimal way than the alternative of just blindly doing it every single time.
On a fundamental level git submodules is a dependency external to the main repository (only a very special kind of dependency that is tightly integrated into git), but it really is not that different from other external dependencies like npm packages, ruby gems, python packages, etc whose used values can change from commit to commit. With GIT_TEST_PREVIOUS_CHECKED_OUT_COMMIT
all such externally dependencies can be optimized to just update when needed.
And while the double if test for deciding to run npm install
might look a bit gaudy, there is no need to inline it in every test. For all my typescript tests I just add a call to a script ./test-run-npm-install.sh
and that's it.
Branch rebased.
@mhagger Are there any outstanding issues that prevents this PR from being merged?
@hlovdal: sorry for my lack of response.
It would be preferable for the environment variables to be set only in the subcommand that is being run rather than in the git-test
process itself. I think that this can be done by passing an env=
parameter to check_output
. If you'd like to make that change, I think that it would be an improvement. Let me know. Either way I'll merge this PR after I hear from you.
I created a commit on a branch env_kwargs with what I think you ask for, but I am not sure if I think that is an improvement.
Have you had any chance to look at the branch? Was it what you had in mind?
Have you had any chance to look at the branch? Was it what you had in mind?
It's pretty close, but it is not a good idea to expose the full power of **kwargs
through Test.run()
and Test.run_and_record()
. Also, passing env=dict
to subprocess.check_call()
sets the dictionary as the entire environment for the subcommand, meaning that it wouldn't include any values from the user's environment when they started git-test
. Instead, one usually wants to start with os.environ
then just tweak a couple of values.
I wrote up what I had in mind and was going to push it to my repo, but I accidentally pushed it to your branch here instead. (I'd forgotten that's even allowed!) Is that version OK with you?
That looks good, I am satisfied with this. Don't worry about pushing to my branches, in general I am super comfortable in handling git conflicts so I would not have had any problems if it had come as a surprise, and in this case I am happy with the history being cleaner with just a commit directly from you instead of either an intermediate pull request or a cherry-pick by me.
Thanks for the contribution and thanks for your patience!