brewkit icon indicating copy to clipboard operation
brewkit copied to clipboard

top-level `test.fixture` keys don't support `extname/content`

Open jhheider opened this issue 1 year ago • 2 comments

https://github.com/pkgxdev/pantry/pull/4993/commits/f53024fa6bb7e7e988c33453327f69abbdabf153

it seems like fixture should work the same at the top level (or be removed? except shared fixtures would suffer.) as it does in script steps.

related: it might be useful for top-level (and even step-level) fixtures to support a name key, and an array of objects. that'd allow for:

test:
  fixture:
    - {
      - name: a
      - extname: py
      - content: print("fixture a")
      }
    - {
      - name: b
      - extname: py
      - content: print("fixture b")
      }
  script:
    - python $FIXTURE_a
    - python $FIXTURE_b

though we don't need this (yet). but it does provide one possible way to get rid of fixtures/props in the git repo (by moving them into the yaml). if we did this, we might want to let fixtures and props be top-level keys, so they could be segregated to the bottom to prevent visual clutter.

thoughts and ideas.

jhheider avatar Jan 25 '24 20:01 jhheider

probs we should remove the top-level fixture.

The above example though artificial would be better as inline fixtures per array node imo.

In the case where you want fixtures that maybe are more global then bundle them in the pantry as props.

mxcl avatar Jan 25 '24 21:01 mxcl

The above example though artificial would be better as inline fixtures per array node imo.

yes, i'm thinking of the cases where a node needs 2 or more fixtures, or a fixture is used across multiple nodes.

jhheider avatar Jan 25 '24 21:01 jhheider