-
-
Notifications
You must be signed in to change notification settings - Fork 625
#1867 test: add a regression suite and a CI job to run it #1871
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Submodule graceful-crafting-hanrahan
deleted from
a51460
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - dev | ||
| - rc | ||
| - master | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| test: | ||
| name: Configuration and script checks | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Install test dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y --no-install-recommends lua5.4 shellcheck | ||
| sudo ln -sf /usr/bin/lua5.4 /usr/local/bin/lua | ||
| sudo ln -sf /usr/bin/luac5.4 /usr/local/bin/luac | ||
|
|
||
| - name: Report tool versions | ||
| run: | | ||
| lua -v | ||
| shellcheck --version | ||
| python3 --version | ||
|
|
||
| - name: Run the test suite | ||
| run: sh tests/run.sh | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,3 +11,6 @@ Scripts/pkg_user.lst | |
| Configs/.config/uwsm/* | ||
| ./.* | ||
| build | ||
|
|
||
| # Local agent worktrees, never part of the tree | ||
| .claude/ | ||
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
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
Submodule ohmyzsh
deleted from
9e2392
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Tests | ||
|
|
||
| Structural checks over the shipped configuration and scripts. They read the | ||
| tree, never the machine: no Hyprland session, no installed HyDE, nothing | ||
| outside the repository is touched. | ||
|
|
||
| ## Running | ||
|
|
||
| ```sh | ||
| sh tests/run.sh # every case | ||
| sh tests/run.sh binds # only cases whose name contains "binds" | ||
| ``` | ||
|
|
||
| Each case is an executable `tests/test_*.sh` that prints its own diagnostics | ||
| and exits non-zero on failure. `tests/run.sh` discovers them, so adding a case | ||
| is adding a file. | ||
|
|
||
| ## Cases | ||
|
|
||
| | Case | Checks | | ||
| | --- | --- | | ||
| | `test_binds.sh` | Loads the Lua keybinds against a stubbed Hyprland API: no two binds share a combination once modifiers are folded to what Hyprland matches on, no keysym sits in a modifier position, no bind uses the `code:NN` form the Lua parser rejects, every bind has a description, every `hyde-shell` command it runs exists. Touchpad gestures are checked in the same pass: a valid finger count, a direction and action Hyprland accepts, and no two gestures on the same finger count and direction | | ||
| | `test_git.sh` | The tree holds no gitlink without a matching `.gitmodules` entry, which would break `git submodule` and anything walking submodules | | ||
| | `test_dots.sh` | Every installer metafile under `Scripts/dots` parses, declares the keys the installer needs, uses a known action, and points at a source directory that exists | | ||
| | `test_lua_syntax.sh` | Every shipped Lua file parses | | ||
| | `test_shell.sh` | Every shipped shell script parses, and shellcheck finds no error-severity problem | | ||
|
|
||
| ## Dependencies | ||
|
|
||
| | Tool | Used by | Missing | | ||
| | --- | --- | --- | | ||
| | `lua`, `luac` | bind and Lua syntax checks | case is skipped | | ||
| | `python3` 3.11+ | metafile check | case is skipped | | ||
| | `shellcheck` | shell check | only the parse half runs | | ||
|
|
||
| A skipped case is reported as such and does not fail the run, so the suite | ||
| stays usable on a machine without the full toolchain. CI installs everything, | ||
| so nothing is skipped there. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| #!/usr/bin/env sh | ||
| # Shared helpers for the test cases. | ||
|
|
||
| TESTS_DIR=${TESTS_DIR:-$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd)} | ||
| export TESTS_DIR | ||
|
|
||
| # The tree under test. Defaults to the checkout the suite lives in, and can | ||
| # be pointed at another one to check it with this suite. | ||
| REPO_ROOT=${REPO_ROOT:-$(CDPATH='' cd -- "$TESTS_DIR/.." && pwd)} | ||
| export REPO_ROOT | ||
|
|
||
| _failures=0 | ||
|
|
||
| fail() { | ||
| _failures=$((_failures + 1)) | ||
| printf ' fail: %s\n' "$1" | ||
| } | ||
|
|
||
| skip() { | ||
| printf ' skip: %s\n' "$1" | ||
| } | ||
|
|
||
| finish() { | ||
| if [ "$_failures" -ne 0 ]; then | ||
| printf ' %d failure(s)\n' "$_failures" | ||
| exit 1 | ||
| fi | ||
| exit 0 | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.