Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement BATS workflow #70

Merged
merged 15 commits into from
Apr 22, 2024
Merged

Conversation

Stealthii
Copy link
Contributor

This PR implements the bats test runner as a workflow, providing a stub test to ensure passing until future PRs implement their own.

The purpose of bats for this repo is three-fold functionality testing:

  • multiple Bash versions (4.2, 4.4, 5.0, 5.2)
  • multiple OS flavors (macOS, Linux)
  • Alternate versions of bc, awk, git, date, etc. (where necessary)

Tests are completely optional, and realistically should only exist for core components where functionality differs between OS flavors (such as the music widget), and non-portable syntax (use of implementation specific features in bc, awk, date, etc.)

Discussion in comments.


Minor changes

  • Update known dependencies for tokyo-night-tmux
  • Provide dependency installation examples for macOS, Alpine, Arch, and Ubuntu

@Stealthii
Copy link
Contributor Author

Stealthii commented Apr 15, 2024

Main goals I'm planning to achieve:

  • Functionality for Bash 4.2+ (5.0 got stricter with variable expansion, as an example)
  • Eliminate dependency on GNU coreutils, bc, awk, sed, echo, etc. (writing portable code)
  • Highlight PRs that break functionality or add dependencies
  • Highlight performance issues

I plan on raising separate PRs to facilitate this, which is why I'm raising this as a base for those PRs for now.

@Stealthii
Copy link
Contributor Author

The rationale on targeting Bash 4.2 as a minimum:

  • It supports the \u and \U Unicode escape sequences within echo/printf (which many theme components utilise)
  • Provided in CentOS 7 (EOL 2024-06), Ubuntu 16.04 (EOL 2021-04)

The only supported OS shipping with an older Bash is macOS (3.2) which is already too old to support other features in this theme (like associative arrays) - and Homebrew has become the de-facto package manager on this platform - even Github Actions uses it in the base runner instances. With the update to the README reflecting dependency examples, this should be less of a problem moving forward.

@Stealthii Stealthii mentioned this pull request Apr 17, 2024
9 tasks
@Stealthii Stealthii force-pushed the feature/bats-initial branch from 47bd81b to e2cd214 Compare April 17, 2024 19:45
The third-party pre-commit hook for shfmt is considerably out of date,
and we need to move to a version that supports BATS formatting. Moving
to v3.8.0 and a locally managed hook definition.
Until real tests exist, this stub test will allow the workflow to pass
without failure.
Bats has been configured to run on Bash 4.2 and higher, including the
dependencies required by this theme and workflow operations.

macOS has been set up as a separate runner to confirm functionality of
OS-specific features.
Witnessing random additions of recent such as `jq` as dependencies.
Keeping track of these is problematic without complete testing, until
then the README has been updated to track all known dependencies and
instructions for common distros.
@Stealthii Stealthii force-pushed the feature/bats-initial branch from e2cd214 to 12fdb7a Compare April 17, 2024 19:47
@Stealthii Stealthii changed the base branch from next to master April 17, 2024 20:01
@janoamaral janoamaral added the enhancement New feature or request label Apr 20, 2024
@janoamaral janoamaral self-requested a review April 20, 2024 23:30
@Stealthii Stealthii changed the base branch from master to next April 22, 2024 15:47
@janoamaral janoamaral merged commit 16a4ef5 into janoamaral:next Apr 22, 2024
8 checks passed
@Stealthii Stealthii deleted the feature/bats-initial branch April 22, 2024 22:00
uNyanda pushed a commit to uNyanda/tokyo-night-tmux that referenced this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants