Skip to content
This repository has been archived by the owner on Jan 29, 2025. It is now read-only.

v3 API tests #1804

Merged
merged 6 commits into from
Mar 19, 2019
Merged

v3 API tests #1804

merged 6 commits into from
Mar 19, 2019

Conversation

chartjes
Copy link
Contributor

  • removed debugging message
  • added in a set of tests for the v3 API that check schemas and validates SVG file types
  • added Python dependency needed for v3 API tests

…I calls, added in requirement needed for v3 tests
@chartjes chartjes requested a review from mythmon March 18, 2019 20:04
Copy link
Contributor

@mythmon mythmon left a comment

Choose a reason for hiding this comment

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

I have a couple issues, but overall this looks good. I didn't comment on every test, but I think the mismatch between detail and listing views applies to most/all of the tests.

data = r.json()

if len(data) == 0:
pytest.skip("Could not find a v3 action with the ID {}".format(action_id))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should be an error for an action to be published in the list, but not to have a detail page.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added those in because tests kept failing on CI when they passed every single time on my own laptop when using https://normandy.cdn.mozilla.net as the server.

I'm open to suggestions on how to solve this chicken-and-egg issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

The test skip for "there is no data in the listing" seem good. I think we should keep those. The second check of "there was data in the listing, but there is not detail" were the ones I had a problem with. It seems that you've already removed those though. I think we're good here.

data = r.json()

if len(data) == 0:
pytest.skip(
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should also fail for having a missing detail page.

assert r.status_code == 200


def test_v3_approval_request_with_id(conf, requests_session):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason you split this into two tests, but made the action version a single test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No reason, I can just split them into two different tests

@chartjes chartjes requested a review from mythmon March 19, 2019 13:46
@mythmon
Copy link
Contributor

mythmon commented Mar 19, 2019

bors r+

bors bot added a commit that referenced this pull request Mar 19, 2019
1804: v3 API tests r=mythmon a=chartjes

* removed debugging message
* added in a set of tests for the v3 API that check schemas and validates SVG file types
* added Python dependency needed for v3 API tests

Co-authored-by: Chris Hartjes <chartjes@littlehart.net>
@bors
Copy link
Contributor

bors bot commented Mar 19, 2019

Build succeeded

@bors bors bot merged commit 68f1926 into master Mar 19, 2019
@bors bors bot deleted the ch-v3-api-schema-checks branch March 19, 2019 16:18
mythmon added a commit to mythmon/normandy that referenced this pull request Mar 29, 2019
This reverts commit fa897a8, reversing
changes made to 99f45b1.
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.

2 participants