allow headers and env to be passed in `IntegrationTest`.

Closes #6513.