Skip to content

ci: add bats workflow#29

Merged
marksverdhei merged 1 commit into
mainfrom
ci/add-bats-workflow
Jun 26, 2026
Merged

ci: add bats workflow#29
marksverdhei merged 1 commit into
mainfrom
ci/add-bats-workflow

Conversation

@marksverdhei

Copy link
Copy Markdown
Owner

Why

Sorting-hat has 62 bats tests as of #25 / #27 (the rounds of test additions I just landed) but no CI runs them on PRs. Any future PR could land a regression undetected — including PRs from hai-pilgrim or other contributors, which is the most likely vector.

How

  • Installs `bats` + `bats-assert` + `bats-support` via apt (Ubuntu runner)
  • Symlinks the apt-installed paths into the Arch-convention path `/usr/lib/bats//load` that `test.sh` hard-codes
    • This keeps your local Arch test runs untouched — no cross-distro path logic needed in the test file
    • `find` is used to discover whether the lib lands under `/usr/lib` or `/usr/share` (varies across Ubuntu versions)
  • Also installs `ffmpeg` (`collect_metadata` audio-metadata tests need `ffprobe`) and `jq` (handy for any future mock-JSON inspection)
  • Triggers on `push` to main and on every PR

Verified locally

`bats test.sh` passes 62/62 on my Arch dev machine. The CI step list is short enough to inspect — if Ubuntu's bats packaging shifts paths in the future, the `find`-based discovery should adapt.

Sorting-hat has 62 bats tests as of #25/#27 but no CI to run them on
PRs — regressions can creep in undetected. Adds a bats workflow:

- Installs bats + bats-assert + bats-support via apt (Ubuntu)
- Symlinks the apt-installed paths into the Arch-convention path
  /usr/lib/bats/<lib>/load that test.sh hard-codes, so Markus's local
  Arch test runs stay untouched (no cross-distro logic in the test file)
- Also installs ffmpeg + jq (collect_metadata audio tests need ffprobe;
  jq is generally useful for any future test that inspects mock JSON)
- Runs 'bats test.sh' on push to main and on every PR

Path-discovery uses 'find /usr/lib /usr/share -path *bats-<lib>/load.bash'
to tolerate both /usr/lib/bats-assert/ and /usr/share/bats-assert/
layouts across Ubuntu versions.
@marksverdhei marksverdhei merged commit 3c8a902 into main Jun 26, 2026
1 check passed
@marksverdhei marksverdhei deleted the ci/add-bats-workflow branch June 26, 2026 21:16
marksverdhei added a commit that referenced this pull request Jun 27, 2026
Adds (newest first, matching existing style):
- #32 stem-less dotfile guard
- #30 video file support
- #28 --preview / -p flag
- #27 is_audio ftyp false-positive fix
- #20 audio file support

Skipped pure-docs (#15, #16, #17, #31), CI infra (#29), and test-only
rebases (#25) — same selection rule the prior entries used.
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