[pass] Wanted: Test Suite
Von Welch
von at vwelch.com
Sat Apr 19 18:56:34 CEST 2014
Jason, all,
I've added a few more tests, enough to to find a few more issues. I'm going
to pause at this point and wait for feedback to see if we agree this is the
right path before doing more. The basic approach seems solid to me with a
few small issues/questions to resolve:
1) Unencrypted GPG key vs GPG-agent. Except for some weirdness with 'pass
init' with an unencrypted gpg key and a closed stdin, an unencrypted key
seems to work well. It seems simpler than getting a gpg-agent running.
Acceptable or do we really want to use an agent for testing?
2) "Building" pass. I figured out I really needed a version of the pass
script to test with that has the platform-specific stuff replaced.
Currently 'make install' is the only way to create a fully-functional pass
script, but I don't want to require installation for testing. Hence in my
branch I split the 'make install' process into 'make' which creates the
platform-specific script and 'make install' which installs it. This lets
you run 'make && make tests' without an install (actually 'make tests' will
do a 'make' if needed, but you get the idea.) Sound reasonable?
3) 'pass insert' requires interactivity. It insists on asking for the
password twice even if stdin is not a terminal (a pipe). We'll either need
to change that behavior, find some clever way of working around it for
testing, or just decide it's not part of the test suite.
4) Going further with regards to interactivity, I have no idea how to test
'pass edit' at this point. I guess one could create a vimscript or
something similar to simulate a user typing? Or just not worry about it for
the test suite.
Von
On Sat, Apr 19, 2014 at 9:04 AM, Von Welch <von at vwelch.com> wrote:
> Here's an initial start at this (mainly in the tests/ directory):
> https://github.com/von-forks/password-store/tree/testing
>
> Its mainly a smoke test at this point, but the harness is working. I'll
> keep working on it rest of the weekend but any feedback welcome.
>
> BTW, to save a bunch of work in launching a gpg-agent, I'm just using an
> unencrypted test key. That might be confusing pass (e.g. 'pass init' works
> but returns non-zero), hence the work-around in pass_init() at the moment.
> Clearly a bug in some way - if pass isn't going to allow this, it should do
> so more cleanly.
>
> Von
>
>
>
>
> On Thu, Apr 17, 2014 at 10:06 PM, Von Welch <von at vwelch.com> wrote:
>
>> I'd be willing to take a stab at this this weekend if no one else jumps
>> on it.
>>
>> I've got no experience with test frameworks for bash scripts. The cgit
>> make-based one looks simple but reasonable. Google turns up a number of
>> options. Any opinions welcome.
>>
>> Von
>>
>>
>>
>> On Thu, Apr 17, 2014 at 7:37 PM, Jason A. Donenfeld <Jason at zx2c4.com>wrote:
>>
>>> Hey guys,
>>>
>>> Pass is getting complex. There are lots of edge cases now. I think I'd
>>> like an automated testing suite, like what we have with cgit (copying Lukas
>>> on this mail).
>>>
>>> Would somebody step up and make a really nice automated test suite? I'd
>>> be happy to give you commit access to that subfolder of the repo if you'd
>>> be up for this. It shouldn't be a lot of work and would help the project
>>> tons.
>>>
>>> Thanks,
>>> Jason
>>>
>>> _______________________________________________
>>> Password-Store mailing list
>>> Password-Store at lists.zx2c4.com
>>> http://lists.zx2c4.com/mailman/listinfo/password-store
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140419/5a6ce073/attachment.html>
More information about the Password-Store
mailing list