Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

api: test_rest: result: add skip filter #1132

Merged
merged 1 commit into from
Mar 25, 2024
Merged

Conversation

roxell
Copy link
Contributor

@roxell roxell commented Mar 21, 2024

No description provided.

Copy link
Member

@katieworton katieworton 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 to me - thank you for implementing this :)

I have left a quick question on the unit tests to make sure I understand where one of the numbers is coming from 👍

def test_tests_filter_by_result_pass(self):
data = self.hit('/api/tests/?result=true')
self.assertEqual(list, type(data['results']))
self.assertEqual(50, len(data['results']))
Copy link
Member

Choose a reason for hiding this comment

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

Is this 50 because we limit results to 50 per page? I can see the other tests have this too, but couldn't see where it came from.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @katieworton , you got that one right! https://github.com/Linaro/squad/blob/master/squad/settings.py#L412
By default, REST API page size is 50. They are all created on the top of that file: https://github.com/Linaro/squad/blob/master/test/api/test_rest.py#L109-L137

Copy link
Member

Choose a reason for hiding this comment

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

Perfect - thanks for confirming!

Perhaps the 50 should be read from a variable in the tests so it's clearer where it comes from, but that's a separate task :)

This will make it possible to filter on skip's too which should be:
https://qa-reports.linaro.org/api/tests/?result__isnull=true

Signed-off-by: Anders Roxell <[email protected]>
@chaws
Copy link
Collaborator

chaws commented Mar 25, 2024

This looks good, the failures are due to a recent release of DRF which breaks squad testing. I'll send a patch to fix that later today.

@chaws chaws merged commit 6a47536 into Linaro:master Mar 25, 2024
3 of 7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants