RichiH / vcsh

config manager based on Git
GNU General Public License v2.0
2.19k stars 123 forks source link

Introduce comprehensive test suite #218

Open RichiH opened 7 years ago

RichiH commented 7 years ago

As per https://github.com/RichiH/vcsh/issues/217, there seems to be a useful test suite growing. Thanks @djpohly :)

djpohly commented 7 years ago

Gotta pay for vcsh somehow. :)

I won't pretend the tests are full coverage - a few aspects like hooks/overlays, config variables, write-gitignore and list-untracked (which felt too complex) aren't tested at all yet. Plus a few tests are skipped due to current bugs in the code. But it's a starting point, it covers most of the core, and it made it feel a lot safer to make changes.

I had created some other "future" test files, but none of them contain anything useful yet. For the sake of giving other contributors ideas and/or not forgetting:

$ git status -u t/
t/configfiles.t
t/external-vars.t
t/hooks.t
t/list-untracked.t
t/overlays.t
t/write-gitignore.t
RichiH commented 7 years ago

https://travis-ci.org/RichiH/vcsh/builds/205618222 fails for me. Any idea what the cause might be? Might be able to poke it again tomorrow...

djpohly commented 7 years ago

Ah, djpohly/vcsh_testrepo.git has some additional branches and stuff. Ideally it wouldn't depend on an external repo (like the Git testsuite), but for now this works.

@RichiH, I made some important fixes to the tests this evening (there was a potential for false passes). They are now both pushed to bats and merged into refactor.