Skip to content

Add PR CI: script linting/syntax checks and JS unit tests - #7

Merged
mholloway24 merged 2 commits into
masterfrom
mh/add-ci-tests
Jul 9, 2026
Merged

mholloway24 merged 2 commits into
masterfrom
mh/add-ci-tests

Conversation

@mholloway24

Copy link
Copy Markdown

Summary

This pull request introduces a comprehensive CI workflow and adds foundational project files to support testing and script validation for the repository. The main changes are the addition of a GitHub Actions workflow for CI, a package.json to enable Node.js-based testing, and an initial test suite for the add-plugin-installer-script.js script.

CI/CD and Testing Infrastructure:

  • Added a .github/workflows/ci.yml workflow that runs syntax checks for shell, JavaScript, and Python scripts, lints shell scripts with ShellCheck, analyzes PowerShell scripts with PSScriptAnalyzer, and runs JavaScript tests using Node.js 20.
  • Introduced a package.json file to define the project as a private Node.js package, describe its purpose, and add a test script using Node.js's built-in test runner.

Test Coverage:

  • Added ci/add-plugin-installer-script.test.js, providing end-to-end tests for the add-plugin-installer-script.js script. These tests verify that the script correctly adds an install script, handles scoped and unscoped package names, preserves existing fields, and creates the scripts object if missing.

Test Plan

Security Impact

For assistance, see this wiki page.

  • No security impact
  • I have linked to a document that considers security impact or described the security impact below.

PBI/Bug: AB#
Task: AB#

mholloway24 and others added 2 commits July 9, 2026 11:57
Introduces a GitHub Actions workflow (.github/workflows/ci.yml) that runs
on pull requests and pushes to master:

- syntax: bash -n / node --check / py_compile for every script, discovering
  shell scripts by shebang so extension-less bash files are covered.
- shellcheck: ShellCheck at --severity=error (conservative first gate;
  tighten over time as findings are cleaned up).
- powershell: PSScriptAnalyzer (Error severity) on publish.ps1.
- js-tests: `node --test` via `npm test`.

Adds the first unit tests: ci/add-plugin-installer-script.test.js exercises
the package.json transformer end-to-end as a subprocess (scoped-name
stripping, script creation, field preservation). Adds a root package.json
with the test script and ignores node_modules.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ShellCheck at --severity=error flags the unquoted ${@:3} expansion.
Quoting as "${@:3}" expands each remaining commitish as its own word
without re-splitting or globbing (behavior-preserving), and lets the
new shellcheck CI job pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mholloway24
mholloway24 merged commit 76bd171 into master Jul 9, 2026
4 checks passed
@mholloway24
mholloway24 deleted the mh/add-ci-tests branch July 9, 2026 19:19
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