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

[wip] Adds specs around existing functionality #42

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

chalkos
Copy link
Collaborator

@chalkos chalkos commented Jul 24, 2016

  • fix existing specs
  • add VCR
  • model specs (to test creations, relations and accessible info)
  • session controller specs
  • reviewership specs

github controller specs:

  • handle ping event
  • do not process requests with invalid signatures
  • handle issue comment: patronus: :+1:, test, retry, :-1:, fork
  • process issue comment: only on creation, only for collaborators, only for comments starting with patronus:
  • handle status: combined/patronus success/failure/pending
  • process status: ignore commits not made by patronus
  • interact using patronus account when it has permissions, otherwise use user's account
  • merging a PR creates N new pull requests, porting the changes to N port-branches

Note: rebase this on master after merging #40

@chalkos chalkos self-assigned this Jul 24, 2016
added mocked github web hook requests generator (supports ping event and headers);
tested and fixed web hook signature verification;
tested and fixed web hook ping event handling
@chalkos
Copy link
Collaborator Author

chalkos commented Aug 6, 2016

@indirect @segiddins do you have any comments on spec/github_web_hook_request.rb ?

It is a PORO that I'm using to build the mocked web hook request info and (optionally) add it to an existing HTTP request.

Github web hooks are json, so in github_web_hook_request.rb there are methods that create an hash and use parameters to fill in the blanks (like username, repository name, etc). The hash is then converted to json and sent in the request body.

The current methods work for ping (which is mostly just setting the headers right). There are methods to create the status web hook event json, but those are not being used yet.

The next step would be to mock status web hook requests, saving patronus' interactions with github in a VCR cassette, and removing the tokens (and repeating these steps for each test: pending status, success status, failure status, forced failure, etc).

Does this seems like a step in the right direction? Or am I overcomplicating something?

…atch the pattern of the ones generated by patronus

improvement: returns HTTP 202 with explicative message when the status commit message does not match the expected pattern (instead of silently ignoring and returning HTTP 200);
fix: small adjustments in some method parameters;
…o pass; vcr cassette is not parameterized yet.
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.

1 participant