Repository: promptfoo/promptfoo
Issue: Shared / global variables usage in all tests
Root cause: Documentation Deficiency

**Is your feature request related to a problem? Please describe.**

Hi,
would it be possible to define variables which are reused by a set of tests only once, e.g in a section above or in the .env file?

My config looks like this:
```
prompts:
 - {{template }}  

provider ..

tests:
  - vars:
      template: prompttemplate containing { shared_b } and { other_var}
      shared_b: shared_b and some more text
      other_var: some_value_1
    assert:
      - type: contains
        value: somevalue
  - vars:
      template: prompttemplate containing { shared_b } and { other_var}
      shared_b: shared_b
      other_var: different_value
    assert:
      - type: contains
        value: somevalue
```

**Describe the solution you'd like**

is there a possiblity available to define and load 'template' and 'shared_b' variable only once for reusage?
e.g. something like 
```
global vars:
  template: prompttemplate containing { shared_b } and { other_var}
  var_b: shared_b and some more long text

tests:
  - vars:
      template: {{template}}
      var_b: {{var_b}}
      other_var: some_value_1
```

**Describe alternatives you've considered**
i also tried with an external .env file but as far as i see they do not work inside test, vars?
At the moment my variables are already saved to .txts but containing some UUIDs as substing, which i would like to use as description also. Id est in best case i would like to define template: file://{{var}}-suffix.txt

Thanks in case of some advice on this!
**Additional context**



You can use defaultTest.vars to define shared variables that are available across all your test cases. For example:

```yaml
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
prompts:
  - '{{template}}'

providers:
  # ... provider config ...

defaultTest:
  vars:
    template: 'prompttemplate containing {{shared_b}} and {{other_var}}'
    shared_b: 'shared_b and some more text'

tests:
  - vars:
      other_var: some_value_1
    assert:
      - type: contains
        value: somevalue
  - vars:
      other_var: different_value
      template: overridden_template_value
    assert:
      - type: contains
        value: somevalue
```
You can also reference file values if template becomes too long. For example:

```yaml
defaultTest:
  vars:
    template: 'file://my_template.txt'
```

In this case, `my_template.txt` could contain:
```txt
prompttemplate containing {{shared_b}} and {{other_var}}
```
I’ll add an example to the [Configuration Guide](https://www.promptfoo.dev/docs/configuration/guide/#default-test-cases) for you. Let us know if you have any other questions or run into issues!

Thanks for the very quick help @mldangelo and the docs update, and thanks for the great project in general:)

Just a short follow-up; the possibility to use vars also inside the file://: is not possible I guess?
I.e. 
```
'file://my_{some_var_configured_in_default}.txt' 
```
or a workaround like building it on the fly as possible for assertions https://www.promptfoo.dev/docs/configuration/expected-outputs/python/#multiline-functions