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
Platform API returns batches where parent wiki has been deleted #776
Conversation
@@ -34,9 +34,17 @@ public function tearDown (): void | |||
public function testGetEmpty (): void | |||
{ | |||
$this->json('GET', $this->route.'/getBatches') | |||
->assertJson([]) | |||
->assertJsonCount(0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This never worked until now and would have let any response wrapped in an array pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Luckily, it's also the only place in the tests where we seem to do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment: that's a good catch; on googling it looks like we could also have $response->assertExactJson(..)
which doesn't do this more permissive check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good to know, will change.
@@ -14,6 +14,7 @@ public function handle(): void | |||
['pending_since', '=', null], | |||
['updated_at', '<', Carbon::now()->subMonths(1)], | |||
]) | |||
->union(QsBatch::doesntHave('wiki')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea to add this so that they don't clog up and never get cleared
Ticket https://phabricator.wikimedia.org/T361571