New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitpoller propagate env to git 2116 attempt #2 #255

Merged
merged 2 commits into from Sep 30, 2011

Conversation

Projects
None yet
2 participants
@msabramo
Contributor

msabramo commented Sep 30, 2011

This is a rework of #254.

For this branch, I added the test first in f49d9e9. If you run trial buildbot.test.unit.test_changes_gitpoller.TestGitPoller.test_poll at this commit, it will fail with exceptions.AssertionError: Expected environment to have TEST_THAT_ENVIRONMENT_GETS_PASSED_TO_SUBPROCESSES = 'TRUE'. If you then update to 81eb076, then the test will pass.

In 81eb076, instead of doing wrapper methods (a la svnpoller), I simply modified every call to the Twisted getProcessOutput* functions to pass env=os.environ.

Marc Abramowitz added some commits Sep 28, 2011

Marc Abramowitz
When calling external git commands, pass the environment so that crucial
environment variables like SSH_AGENT_PID and SSH_AUTH_SOCK get
propagated. Otherwise, buildbot will not be able to make use of ssh keys
with passphrases that are cached by ssh-agent.
@msabramo

This comment has been minimized.

Show comment
Hide comment
@msabramo

msabramo Sep 30, 2011

Contributor

Before:

$ git reset --hard f49d9e90                                              
HEAD is now at f49d9e9 Add tests that check that environment variables are propagated.

$ trial buildbot.test.unit.test_changes_gitpoller.TestGitPoller.test_poll
...
exceptions.AssertionError: Expected environment to have TEST_THAT_ENVIRONMENT_GETS_PASSED_TO_SUBPROCESSES = 'TRUE'
...

After:

$ git reset --hard gitpoller_propagate_env_to_git_2116_2                 
HEAD is now at 81eb076 When calling external git commands, pass the environment so that crucial

$ trial buildbot.test.unit.test_changes_gitpoller.TestGitPoller.test_poll
buildbot.test.unit.test_changes_gitpoller
  TestGitPoller
    test_poll ...                                                          [OK]

-------------------------------------------------------------------------------
Ran 1 tests in 0.005s

PASSED (successes=1)
Contributor

msabramo commented Sep 30, 2011

Before:

$ git reset --hard f49d9e90                                              
HEAD is now at f49d9e9 Add tests that check that environment variables are propagated.

$ trial buildbot.test.unit.test_changes_gitpoller.TestGitPoller.test_poll
...
exceptions.AssertionError: Expected environment to have TEST_THAT_ENVIRONMENT_GETS_PASSED_TO_SUBPROCESSES = 'TRUE'
...

After:

$ git reset --hard gitpoller_propagate_env_to_git_2116_2                 
HEAD is now at 81eb076 When calling external git commands, pass the environment so that crucial

$ trial buildbot.test.unit.test_changes_gitpoller.TestGitPoller.test_poll
buildbot.test.unit.test_changes_gitpoller
  TestGitPoller
    test_poll ...                                                          [OK]

-------------------------------------------------------------------------------
Ran 1 tests in 0.005s

PASSED (successes=1)

ayust added a commit that referenced this pull request Sep 30, 2011

Merge pull request #255 from msabramo/gitpoller_propagate_env_to_git_…
…2116_2

Gitpoller propagate env to git 2116 attempt #2

@ayust ayust merged commit 8d9377d into buildbot:master Sep 30, 2011

thinkski pushed a commit to kuna-systems/buildbot that referenced this pull request Sep 10, 2014

Merge pull request #255 from msabramo/gitpoller_propagate_env_to_git_…
…2116_2

Gitpoller propagate env to git 2116 attempt #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment