Skip to content

test: cover install and verify scripts#40

Merged
TimInTech merged 2 commits into
mainfrom
tests/install-verify-script-coverage
Jul 2, 2026
Merged

test: cover install and verify scripts#40
TimInTech merged 2 commits into
mainfrom
tests/install-verify-script-coverage

Conversation

@TimInTech

Copy link
Copy Markdown
Owner

Summary

Adds subprocess-level regression coverage for the Linux install and verify scripts.

Covered

  • scripts/verify.sh

    • config.json permission checks (0600 PASS, 0644 WARN with chmod 600, missing config INFO)
    • XDG_RUNTIME_DIR failure path
    • exit-code contract when checks fail
    • system binary discovery when required tools are present
  • scripts/install.sh

    • daemon-reload warning when blitztext-linux is already running
    • no daemon-reload warning when the service is not running
    • BLITZTEXT_NO_HOTKEY validation
    • end-to-end fake-repo install smoke test through "Installation abgeschlossen"
    • service file generation

Verification

  • git diff --check
  • git diff --cached --check
  • pytest tests/ -v
  • Result: 366 passed, 70 skipped

Notes

  • Tests run the bash scripts as real subprocesses in isolated fake repositories.
  • System-facing commands are stubbed (dpkg-query, systemctl, pgrep, ydotool, sudo, pip), so no real apt, sudo, or systemctl calls affect the host.
  • No workflow changes are required because CI already runs pytest tests/ -v.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a59f80de09

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if extra_env:
env.update(extra_env)
proc = subprocess.Popen(
[BASH, str(script_path)],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Run install script tests as a non-root user

When pytest is run as root, which is common in Docker-based CI/dev containers, this launches install.sh with EUID=0. The script exits at its root guard before resolving BLITZTEXT_NO_HOTKEY or reaching the systemd setup, so all four install tests fail and only exercise the root check instead of the intended paths. Please run this subprocess under an unprivileged user or skip/xfail these install-script cases in root environments.

Useful? React with 👍 / 👎.

@TimInTech TimInTech merged commit 82c8ac7 into main Jul 2, 2026
7 checks passed
@TimInTech TimInTech deleted the tests/install-verify-script-coverage branch July 2, 2026 15:25
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