Prior to using build config validation, this config successfully passed the environment variable defined at the upper scope to the included'd jobs. Relevant sections of the config:
env: DEBUG=True
jobs:
include:
- name: "Unit tests"
... # build logs here would show export DEBUG=True
- name: "Integration tests"
... # build logs here would show export DEBUG=True
Is this a bug in the new config validation, or a bug in my .travis.yml ?
In a way, both
According to our documentation, as the intention is not to expand the rows in env into a separate job in the matrix, but set these env vars to all jobs, this would be the right way to specify this:
env:
global: DEBUG=True
However, our system has forever had an oddity (or bug, depending how you view it) that picked the first variable from env into each job specified in jobs.include. For other matrix expansion keys, such as os or language runtime versions (e.g. rvm, node_js etc) this makes sense, but not for env.
This oddity has indeed not been ported to the component that now runs the Build Config Validation feature due to an oversight, and so clearly, this was also a bug in our system, too.
Thanks, Sven! I understand the issue now. I appreciate the quick fix, but I appreciate even more knowing to correct way to propagate envvars to all jobs.