Skip to content
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

Mock out pem access #840

Merged
merged 2 commits into from
Jul 7, 2017
Merged

Mock out pem access #840

merged 2 commits into from
Jul 7, 2017

Conversation

begedin
Copy link
Contributor

@begedin begedin commented Jul 5, 2017

Closes #823

This PR adds a test fixture for a .pem file, used when authenticating a github request. It sets up the app configuration so that the .pem content is loaded from this fixture in the test environment, instead of being loaded from an environment variable, as it is in other cases.

This should Joken related GitHub tests to pass, for users who do not have the actual pem in their environment.

The test file simply contains a random RSA private key, since this is all we need for the process to work.

Copy link
Contributor

@joshsmith joshsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good generally. Approving so you don't have to wait for a follow-up, but would like that one comment handled.

config/test.exs Outdated

# supply sample .pem with RSA_PRIVATE_KEY for tests
config :code_corps,
github_app_pem: "./test/fixtures/github/app.pem" |> File.read!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have an actual PEM on CI, so I wonder if this shouldn't be an || statement somehow.

@begedin begedin merged commit 81575b4 into develop Jul 7, 2017
@begedin begedin deleted the mock-out-pem-access branch July 7, 2017 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App fails to compile if no GITHUB_APP_PEM environment variable
2 participants