Skip to content

support outputting gdt test scenarios as Markdown #62

@jaypipes

Description

@jaypipes

We'd like to be able to publish gdt test scenarios as nicely-formatted Markdown that will essentially be the content for a sort of "guided check".

Given the gdt test scenario YAML:

name: var-save-restore
description: a scenario that tests variable save/restore across multiple test specs
tests:
  - exec: echo 42
    var-stdout: VAR_STDOUT

  - exec: echo $$VAR_STDOUT
    var-rc: VAR_RC
    assert:
      out:
        is: 42

  - exec: echo $$VAR_RC
    assert:
      out:
        is: 0

The Markdown output should look like:

# var-save-restore

a scenario that tests variable save/restore across multiple test specs

## Test 1. `echo 42`

```sh
VAR_STDOUT=$(echo 42)
echo $VAR_STDOUT
```

Expect:

```
42
```

## Test 2. `echo $VAR_STDOUT`

```sh
echo $VAR_STDOUT
VAR_RC=$?
```

Expect:

```
42
```

## Test 3. `echo $VAR_RC`

```sh
echo $VAR_RC
```

Expect:

```
0
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions