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

x/build/cmd/gopherbot: add Gerrit mock/integration tests #52901

Open
rolandshoemaker opened this issue May 13, 2022 · 2 comments
Open

x/build/cmd/gopherbot: add Gerrit mock/integration tests #52901

rolandshoemaker opened this issue May 13, 2022 · 2 comments
Labels
Builders x/build issues (builders, bots, dashboards) NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@rolandshoemaker
Copy link
Member

rolandshoemaker commented May 13, 2022

We currently have no real tests for the way gopherbot interacts with Gerrit, nor is there a simple way to implement them. For complex (and, arguably, somewhat dangerous functionality, like #48021, autosubmit) this makes implementation a bit of a crapshoot, since we end up mostly just hoping we got the behavior right and testing in prod.

@rolandshoemaker rolandshoemaker added Testing An issue that has been verified to require only test changes, not just a test failure. Builders x/build issues (builders, bots, dashboards) NeedsFix The path to resolution is known, but the work has not been done. labels May 13, 2022
@rolandshoemaker rolandshoemaker added this to the Backlog milestone May 13, 2022
@dmitshur
Copy link
Contributor

dmitshur commented May 17, 2022

Since it's not already mentioned, I'll add that one of the few ways to test gopherbot changes now is via its -dry-run mode. This helps, but it's not a complete nor ideal solution.

If we mock individual Gerrit API responses and create tests based on those, it'll help with some types of changes, but contribute little for types of changes where a sequence of state changes (and behaving exactly like the real Gerrit server does, which changes over time) has important effects on the outcome (as one example, see #21312 (comment)).

There's some similarity and overlap here with #37603, which is about another component maintner that also interacts with Gerrit (and GitHub) (and is one of gopherbot dependencies at this time).

@dmitshur
Copy link
Contributor

git-codereview implements a fake Gerrit server (type gerritServer) and a git helper (type gitTest) for its tests, which might be relevant here (spotted via #50576).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsFix The path to resolution is known, but the work has not been done. Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

2 participants