Skip to content

Refactor GitHub Actions workflow to eliminate test duplication #60

Description

@maxrantil

Context

PR #59 introduces tests/installation-test.sh as a comprehensive standalone test script, but the GitHub Actions workflow duplicates this logic inline (~80 lines of duplication).

Problem

DRY Violation: Test logic exists in two places:

  • tests/installation-test.sh (363 lines)
  • .github/workflows/shell-quality.yml (200+ lines of equivalent logic)

Impact: Changes require updates in two places, increasing maintenance burden.

Recommended Solution

Refactor workflow to invoke the test script instead of duplicating logic:

- name: Run comprehensive installation tests
  run: ./tests/installation-test.sh "$TEMP_HOME" "$GITHUB_WORKSPACE"

- name: Upload diagnostic artifacts
  if: failure()
  uses: actions/upload-artifact@v4
  with:
    name: installation-test-diagnostics
    path: ${{ env.TEMP_HOME }}/diagnostics
    retention-days: 7

Benefits

  • Single source of truth for test logic
  • Easier maintenance
  • Guaranteed consistency between CI and local tests

Trade-offs

  • Loses GitHub Actions step-level visibility in CI logs
  • Slightly harder to debug individual test failures (all in one step)

Estimated Effort

30-45 minutes

Priority

Medium - Follow-up to PR #59 after critical issues resolved

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions