ovh / venom

🐍 Manage and run your integration tests with efficiency - Venom run executors (script, HTTP Request, web, imap, etc... ) and assertions
Apache License 2.0
1.06k stars 144 forks source link

Add --var-env [prefix] feature #762

Closed ymartin-ovh closed 10 months ago

ymartin-ovh commented 10 months ago

Hello

With venom before 1.x, we could import any environment variables. For now, it seems to be restricted to those beginning with VENOMVAR

It would be interesting to provide a --var-env [prefix1, prefix2, ...] to allow import environment variable beginning with prefixes in the list.

Regards

yesnault commented 10 months ago

Hi,

You can use in a exec executor env variables. Example:


❯ ./venom run c.yml
 • truc (c.yml)
        • testA PASS
final status: PASS
❯ cat aa.log
foo with a bar here truc
❯ export AA=foo
❯ ./venom run c.yml
 • truc (c.yml)
        • testA PASS
final status: PASS
❯ cat aa.log
foo with a bar here foo
❯ cat c.yml
name: truc
testcases:
- name: testA
  steps:
  - type: exec
    script: echo "foo with a bar here $AA" > aa.log 
ymartin-ovh commented 10 months ago

Ok thanks.