Closed rcorre closed 3 years ago
Nice! Looking a bit at it now, it is definitely not setup to test the runner / cloning part. I think that's why merge_pull_request
was separated out as a public function there -- to be able to test that functionality.
Thought 1: Maybe we should just move the slack messaging into merge_pull_request
? Not sure there's really a good reason for it to be inside the runner instead.
Thought 2: It would be cool to also add a label. Maybe failed-backport
or something? That would make these PRs easily searchable.
Excuse the force push, it was pretty much a rewrite. It's tested now though!
retitle the PR to indicate this is a stepping stone
ah, oops, it was a pretty simple addition so I just pushed another commit before I noticed this.
FWIW, with this rewrite I think we could make merge_pull_request
private and just exercise the worker, if that's better. Though I guess that would make the test async.
reopened as #277 to get build running
Octobot reports a backport failure via a DM to the PR author, which can be missed and lost, leaving no persistent record of what happened.
Octobot should additionally comment on the PR itself.
I haven't tested this live, nor via unit tests :grimacing:.
For the former, I tried to create an org in public github but got a bit stumped on how to create an app/get a token.
For the latter, it seemed like I needed to create a full
Runner
inpr_merge_test
, which hasn't been done before. The runner takes aGithubSessionFactory
. I tried to create a Mock for that, but sincenew_session
returnsResult<GithubSession>
(notResult<Session>
), I couldn't have my mock return aMockSession
instead. Here's what I tried:Which errors
expected struct GithubSession, found struct MockGithub
. I don't know enough about Rust to figure this out, but I might try again later.new_session
returning aBox
could work, perhaps? Or I'm on totally the wrong track trying to test this.