Skip to content

Setup Scripts for Cram Tests #12570

@rgrinberg

Description

@rgrinberg

Problem

In cram tests, it's common to reuse code by introducing helpers in a shell script and then sourcing it in the test. There are two steps to remember in this common pattern:

  • Introduce a dependency on the helper script
  • Source it via .

It can get rather tedious to do these steps, and it's quite easy to forget the second step for example.

Solution

Introduce a setup_scripts fields in the cram stanza to automate this pattern for us. E.g.

(cram
  (setup_scripts foo.sh bar.sh))

Will make foo.sh and bar.sh setup scripts that will be sourced in every test in this directory.

Metadata

Metadata

Assignees

Labels

cramRelated to the cram test execution in Dunefeature-requestUser wanted features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions