Skip to content

feat: support executing external executable scripts from command handlers #28

@snytkine

Description

@snytkine

Overview

Placeholder issue — requirements will be refined in a future update.

Add the ability to execute external executable scripts (shell scripts, binaries, etc.) from inside a command handler component, triggered as part of a test suite run.

Background

Spring Shell 4.0.2 (used by this project) does not provide built-in script execution support — that feature was removed in the 3.x/4.x rewrite. However, Java's ProcessBuilder can be used directly inside a command handler method to launch external processes. This approach is:

  • Thread-safe: ProcessBuilder and Process instances live on the call stack; no shared mutable state in the singleton bean
  • GraalVM native-image compatible: ProcessBuilder is a JDK core class with no reflection or dynamic proxy requirements

Potential use cases (to be refined)

  • Pre/post hooks around a test suite run (e.g. seed a database, start a mock server, clean up)
  • Inline script steps within a test case sequence
  • External validation scripts triggered by assertion results

Notes

  • Must not affect thread safety of existing singleton beans
  • Must remain GraalVM native-image compatible (no runtime reflection)
  • Script execution behaviour (blocking vs. async, stdout/stderr capture, exit-code handling) to be decided during requirements refinement

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions