Skip to content

[Workflows/Agents] Validate imports/includes; add bats/jest smoke tests #63

Description

@ashleyshaw

Automation Summary

Validate all imports and includes in Bash and JS scripts used in workflows/agents. Ensure test coverage for critical entry points using Bats for Bash and Jest for JavaScript. This is to increase reliability, ensure error handling, and reduce regression risk for core operational scripts.

Steps / Checklist

  • All Bash files use set -Eeuo pipefail
  • Tests exist for Bash: tests/bash/*.bats
  • Tests exist for JS: tests/js/*.test.js
  • Task is clearly defined and actionable
  • Automation goal and scope described
  • Documentation/changelog updated
  • PR uses correct branch prefix (automation/)
  • Approved by at least one maintainer

Acceptance Criteria

  • Bash scripts checked for set -Eeuo pipefail
  • Tests for Bash and JS exist as above and run successfully
  • Automation implemented and tested
  • No performance or accessibility regressions
  • Documentation updated
  • No regressions or negative impact

Additional Context

Owner: Workflows
Related to: core agent/workflow scripts in repository


Definition of Ready (DoR)

  • Automation goal/scope defined
  • Checklist prepared
  • Estimate added

Definition of Done (DoD)

  • All checklist and acceptance criteria completed
  • Documentation/changelog updated
  • Approved by maintainer

Activity

  1. added this to the milestone on May 27, 2026
  2. self-assigned this
    on May 27, 2026
  3. added a commit that references this issue on May 27, 2026
  4. ashleyshaw commented on May 27, 2026

    @ashleyshaw
    MemberAuthor

    Implemented and merged via PR #454 into .\n\nCompleted:\n- Added JS smoke validation for critical workflow/agent imports/includes: \n- Added Bash strict-mode enforcement test: \n- Added npm scripts: and \n- CI checks passed (including rerun after transient network failure in )\n\nValidation run locally:\n-

    @lightspeedwp/github-community-health@0.2.0 test:imports
    jest --config .jest.config.cjs tests/js/import-includes-smoke.test.js --runInBand

    ------------------------------------------|---------|----------|---------|---------|-------------------

    File % Stmts % Branch % Funcs % Lines Uncovered Line #s
    All files 0 0 0 0
    scripts 0 0 0 0
    audit-frontmatter.js 0 0 0 0 19-228
    canonical-to-json.js 0 100 100 0 2-28
    compute-eslint-delta-wave-1.js 0 0 0 0 13-115
    consolidate-issue-types.js 0 100 100 0 11-222
    gather-metrics.js 0 100 100 0 10-32
    npm-package-json-lint-helpers.js 0 0 0 0 13-132
    verify-docs-commands.js 0 0 0 0 8-50
    scripts/agents 0 0 0 0
    adr.agent.js 0 100 100 0 8
    issue-type.agent.js 0 0 0 0 21-59
    issues.agent.js 0 0 0 0 15-122
    labeling.agent.js 0 0 0 0 39-596
    linting.agent.js 0 0 0 0 11-12
    meta.agent.js 0 0 0 0 20-590
    metrics.agent.js 0 100 100 0 9
    mode-demonstrate-understanding.agent.js 0 100 100 0 9
    mode-document-reviewer.agent.js 0 100 100 0 9
    mode-prd.agent.js 0 100 100 0 9
    mode-thinking.agent.js 0 100 100 0 9
    planner.agent.js 0 0 0 0 11-44
    project-meta-sync.agent.js 0 0 0 0 13-280
    prompt-engineer.agent.js 0 100 100 0 9
    release.agent.js 0 0 0 0 27-747
    reporting.agent.js 0 0 0 0 19-458
    reviewer.agent.js 0 0 0 0 33-100
    task-planner.agent.js 0 100 100 0 9
    task-researcher.agent.js 0 100 100 0 9
    template.agent.js 0 0 0 0 13-30
    testing.agent.js 0 100 100 0 9
    scripts/agents/includes 0 0 0 0
    badgeUtils.js 0 0 0 0 8-58
    badges.js 0 0 0 0 17-217
    build-label-alias-map.js 0 0 0 0 8-30
    build-labeling-report.js 0 0 0 0 8-32
    check-template-labels.js 0 0 0 0 13-104
    en-gb-normalise.js 0 0 0 0 18-154
    fetch-canonical-labels.js 0 0 0 0 21-35
    footerUtils.js 0 0 0 0 8-51
    header-footer.js 0 0 0 0 17-213
    label-heuristics.js 0 0 0 0 21-58
    label-lookup.js 0 0 0 0 17-50
    label-reporting.js 0 0 0 0 26-230
    label-sync.js 0 0 0 0 32-559
    label-utils.js 0 0 0 0 14-34
    labeler-utils.js 0 0 0 0 21-327
    readmeUtils.js 0 0 0 0 9-75
    report-writer.js 0 0 0 0 23-288
    retry-helper.js 0 0 0 0 14-213
    status-enforcer.js 0 0 0 0 17-313
    sync-version.js 0 0 0 0 8-37
    type-lookup.js 0 0 0 0 8-38
    update-readme.js 0 100 100 0 8-9
    yaml-parser.js 0 100 100 0 10
    yaml-validator.js 0 0 0 0 14-362
    scripts/validation 0 0 0 0
    run-agent-handoff-audit.js 0 0 0 0 8-140
    sync-frontmatter-dates.js 0 0 0 0 9-83
    validate-agent-frontmatter.js 0 0 0 0 8-136
    validate-agents.js 0 0 0 0 22-341
    validate-frontmatter-freshness.js 0 0 0 0 15-155
    validate-frontmatter.js 0 0 0 0 14-518
    validate-json.js 0 0 0 0 32-454
    validate-links.js 0 0 0 0 2-70
    validate-memory.js 0 0 0 0 2-462
    validate-plugins.js 0 0 100 0 2-54
    validate-skills.js 0 0 0 0 2-37
    validate-structure.js 0 0 0 0 12-141
    validate-workflows.js 0 0 0 0 8-447
    ------------------------------------------ --------- ---------- --------- --------- -------------------\n-

    @lightspeedwp/github-community-health@0.2.0 test:bash
    bats tests/bash/*.bats

    1..1
    ok 1 first-party shell scripts use strict mode # skip No first-party shell scripts found under scripts/ or .github/.

  5. ashleyshaw commented on May 27, 2026

    @ashleyshaw
    MemberAuthor

    Corrected completion summary for #63:

    Implemented and merged via PR #454 into develop.

    Completed:

    • Added JS smoke validation for critical workflow/agent imports/includes: tests/js/import-includes-smoke.test.js
    • Added Bash strict-mode enforcement test: tests/bash/strict-mode.bats
    • Added npm scripts: test:imports and test:bash
    • CI checks passed; reviewer required one rerun due to transient npm ci network failure (ECONNRESET)

    Local validation executed:

    • npm run test:imports
    • npm run test:bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions