<div dir="ltr"><div>Jason, all,</div><div><br></div>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:<div>
<br></div><div>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?</div>
<div><br></div><div>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?</div>
<div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>Von</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 19, 2014 at 9:04 AM, Von Welch <span dir="ltr"><<a href="mailto:von@vwelch.com" target="_blank">von@vwelch.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Here's an initial start at this (mainly in the tests/ directory): <a href="https://github.com/von-forks/password-store/tree/testing" target="_blank">https://github.com/von-forks/password-store/tree/testing</a><div>
<br></div>
<div>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.</div><div><br></div><div>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. </div>
<span class="HOEnZb"><font color="#888888">
<div><br>Von</div><div><br><div><br></div></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Apr 17, 2014 at 10:06 PM, Von Welch <span dir="ltr"><<a href="mailto:von@vwelch.com" target="_blank">von@vwelch.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I'd be willing to take a stab at this this weekend if no one else jumps on it.<div><br></div><div>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.</div>
<div><br></div><div>Von</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On Thu, Apr 17, 2014 at 7:37 PM, Jason A. Donenfeld <span dir="ltr"><<a href="mailto:Jason@zx2c4.com" target="_blank">Jason@zx2c4.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hey guys,<div><br></div><div>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).</div>
<div><br>
</div><div>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.</div>
<div><br></div><div>Thanks,</div><div>Jason</div></div>
<br></div></div>_______________________________________________<br>
Password-Store mailing list<br>
<a href="mailto:Password-Store@lists.zx2c4.com" target="_blank">Password-Store@lists.zx2c4.com</a><br>
<a href="http://lists.zx2c4.com/mailman/listinfo/password-store" target="_blank">http://lists.zx2c4.com/mailman/listinfo/password-store</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>