Repository: promptfoo/promptfoo
Issue: A way to prevent vars array auto-expansion
Root cause: Unimplemented Feature Gap

As far as I understand (maybe I'm missing something?) there is no way to pass an array as a `vars` property value without promptfoo assuming it is specifying multiple test-cases and auto-expanding the test definition, running it multiple times using a different array element in each run. This is a nifty feature, but it would be great to have a way to turn it off, ideally at the test-definition level, but even globally for the whole promptfoo configuration file.

Example configuration -

Assuming a prompt that looks like this
```javascript
const prompt = ({ vars:  ingredients }) => {
	return [
		{
			"role": "system",
			"content": "You are a recipe suggestion bot, suggest a recipe that uses the list of ingredients provided";
		},
		{
			"role": "user",
			// here I'm joining the values with line breaks, but you could imagine I might want to compare this
			// with another prompt version in which the values are numbered, for example.
			"content": ingredients.join("\r\n") 
		}
	];
};
module.exports = prompt;
```

One might want to construct a test like this -
```yaml
tests:
  - vars:
      ingredients:
        - Microwave popcorn
        - Ground beef
        - Pop Rocks

```

But as far as I can see there is no way to make this work, currently. When running, the prompt will get called 3 times with a `ingredients` being a string (i.e. a single array element each time) instead of the expected array.

#476 adds an envar that disables var expansion.  Unfortunately our options are limited because I don't want to break people who _are_ using this feature.  Will merge after I test etc

@typpo thanks for the quick response!

What if it was a setting on the `testCase` itself? i.e. somthing like

```yaml
tests:
  - disableVarExpansion: true
    vars:
      ingredients:
        - Microwave popcorn
        - Ground beef
        - Pop Rocks
```

That way you're giving more granular control without breaking any existing setups (assuming `disableVarExpansion` defaults to `false`, which it should).

Also, considerting env vars are not a super convenient way to configure things, especially if you have multiple prompfoo files that you're using with different settings, it might be a good idea to just add a new "global settings" section to the promptfoo config definition. Something like that would make it much simpler to "share" tests within teams, because you don't have to configure your run environment before every run, which - for a team - would require documenting the "extra steps" needed to make a test work (i.e. which env vars should be set to what value).

i.e. something like
```yaml
globalSettings:
  disableVarExpansion: true
  disableTemplating: true

tests:
  - vars:
      ingredients:
        - Microwave popcorn
        - Ground beef
        - Pop Rocks
```

Another option (which _I think_ isn't as good but could also provide an answer to the sharing problem I discribed) would be adding support for `.env` files. If `promptfoo eval` would look for a `.env` file placed next to the prompfoo configuration file itself, and automatically load it, that would also make it easier to share setups without requiring an additional section in the configuration file.

Just updated the PR to include a test option `disableVarExpansion`, and will land it today!

The `globalSettings` thing already exists in the form of `defaultTest` :) It'd look something like this:

```yaml
defaultTest:
  options:
    disableVarExpansion: true

tests:
  - vars:
      ingredients:
        - Microwave popcorn
        - Ground beef
        - Pop Rocks
```

This is published in 0.42.0