Prevent leaking environment information.

Only export the current environment and test (if testing is enabled).