PropertyDamage.Export.Script (PropertyDamage v0.2.0)

View Source

Script generation dispatcher.

Generates standalone reproduction scripts in multiple languages. Scripts can be run without PropertyDamage installed.

Supported Languages

  • :elixir - Elixir script with Req HTTP client
  • :curl - Bash script with curl commands
  • :python - Python script with requests library

Usage

script = PropertyDamage.Export.Script.generate(failure, :curl,
  base_url: "http://localhost:4000",
  adapter: MyHTTPAdapter
)

File.write!("reproduce.sh", script)

Summary

Functions

Returns the file extension for a script language.

Generates a standalone script from a failure report.

Returns all supported script languages.

Types

language()

@type language() :: :elixir | :curl | :python

Functions

extension(atom)

@spec extension(language()) :: String.t()

Returns the file extension for a script language.

generate(report, language, opts \\ [])

Generates a standalone script from a failure report.

Options

  • :base_url - Base URL for HTTP calls (required)
  • :adapter - Adapter module for HTTPSpec (optional)
  • :env_var - Environment variable name for base URL (default: "BASE_URL")
  • :verbose - Include extra comments (default: true)

languages()

@spec languages() :: [language()]

Returns all supported script languages.