Open vanpipy opened 8 months ago
Sorry for the late, and I will switch the pytest
to shellspec cause do the code coverage generation hardly. I research lots of the existing unit test framework, then found the shellspec. It is suitable for our process to do unit test, but i will do more function testes and to rewrite the existing unit testes to test with it.
@vanpipy What do you think about Bats? It's much more popular and more maintained (last release was in 2024 instead of shellspec's 2021). I'm really not personally a fan of shellspec's BDD-style tests, which I find hard to read and might discourage new contributors from adding to it. For code coverage for Bats, it looks like bashcov can be helpful.
To be honest, I have kind of been avoiding the pytest stuff in this repository because I had a difficult time working with it and reading it (compared to Bats). That made me wish I pushed for using Bats for testing a little harder.
If you are okay with switching to Bats (instead of shellspec) I would be able to help set things up! I've used Bats for dozens of projects so it's kind of like second-nature to me.
cc @spacewander
I will vote for Bats too. It is used more widely.
@vanpipy What do you think about Bats? It's much more popular and more maintained (last release was in 2024 instead of shellspec's 2021). I'm really not personally a fan of shellspec's BDD-style tests, which I find hard to read and might discourage new contributors from adding to it. For code coverage for Bats, it looks like bashcov can be helpful.
Yes, it is great one, i forget the starred one. It is the one choice i try to test.
bashcov it good for git-extras, but i took an error start point.. thanks a lot.
If you are okay with switching to Bats (instead of shellspec) I would be able to help set things up! I've used Bats for dozens of projects so it's kind of like second-nature to me.
Great, many thanks for this again. I think there is still a seperated test directory for the all unit tests. I will to do the research about the Bats together!
I think there are some concerns here,
git-extras
has the unit test files onlyI have the answer for 1, but cannot answer the 2 and 3 even i review the bats document.
File
git-brv
Testcases
main
, when invoke thegit-brv
command, the format of the result is{date} {branch_name} {upstream} {branch_short_hash} {commit_title_message}
and output is just like2024-01-05 main origin/main b54d8c7 test(git-browse): add unit tests (#1127)
feature/2024-01-01
,feature/2024-01-02
,feature/2024-01-03
and suppose the branches created date are same to the branch name, when invoke thegit-brv
command, the result isgit-brv
with--reverse
argument, the result isPS: It is a curious command, but I am more curious about the command name, what is the full name of the
git-brv
? Thebrv
is not easy to explain the thing done with it.Reference