FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Expand CI test coverage by jamiew · Pull Request #136 · git-friendly/git-friendly · GitHub

Expand CI test coverage - #136

Merged
jamiew merged 3 commits into
modernize-git-commandsfrom
add-test-coverage
Jun 2, 2026
Merged

Expand CI test coverage#136
jamiew merged 3 commits into
modernize-git-commandsfrom
add-test-coverage

Conversation

jamiew commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

stacked on top of #128 — most of these tests assume those fixes are in place. github will auto-retarget this to main once that merges.

7 new test cases covering bugs and edges the original 25 missed, plus a separate shellcheck job at warning level (cheap to add, catches the unquoted-var / [ -z $x ] stuff we just spent time fixing).

  • branch -d on a nonexistent branch must exit non-zero (was silently 0)
  • branch name with / in it — common feature/* flow, never tested
  • detached HEAD: pull/push/merge must fail cleanly with a friendly error
  • pull skips git stash pop when nothing was actually stashed
  • pull's stash pop runs exactly once when something was stashed
  • pull's package-manager install hooks (yarn) don't fire when their lockfile didn't change
  • push: passthrough flag (--force-with-lease) doesn't get mangled by argument quoting

to test:

new test steps:
- branch -d on a nonexistent branch must exit non-zero (was silently exit 0)
- branch name with `/` in it (common feature/* flow, never tested)
- detached HEAD: pull/push/merge must fail cleanly (was confusing fallthrough)
- pull: skips `git stash pop` when nothing was stashed
- pull: pop runs exactly once when something was stashed
- pull: package-manager install hooks (yarn) don't fire when their lockfile didn't change
- push: passthrough flag (--force-with-lease) doesn't get mangled

also a separate shellcheck job (warning-level) so we catch unquoted vars and similar before they ship.

stacked on top of modernize-git-commands — most of these tests rely on those fixes.
jamiew changed the title Expand CI coverage + add a shellcheck job Expand CI test coverage Jun 2, 2026
jamiew added 2 commits June 2, 2026 15:11
- branch: replace `remotes=($(git remote))` with a portable while-read loop (mapfile isn't in macOS /bin/bash 3.2)
- pull: quote `cd "$(dirname ...)"` and add `|| return 1` on both `cd` calls
- push: use `grep -F '*'` for the literal-asterisk match, and unquote the rhs of `=~` so github.com matches as a regex
- install.sh: iterate with `"${FILES[@]}"` instead of `${FILES[*]}`
The "stash - passthrough arguments" test runs `stash pop` which reapplies its modification to file.txt, leaving every subsequent test running on a dirty working tree. That made the "pull - skips pop when nothing was stashed" assertion fail because pull correctly stashed the lingering modification.

- restore file.txt at the end of the stash passthrough test so later steps start clean
jamiew merged commit 9937cac into modernize-git-commands Jun 2, 2026
2 checks passed
jamiew deleted the add-test-coverage branch June 2, 2026 19:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL