Skip to content

Add swagger schema test with tagged test cases - #3528

Merged
madchap merged 4 commits into
DefectDojo:devfrom
Frostweeds:test_swagger_documentation
Jan 17, 2021
Merged

madchap merged 4 commits into
DefectDojo:devfrom
Frostweeds:test_swagger_documentation

Conversation

@Frostweeds

@Frostweeds Frostweeds commented Dec 22, 2020 •

Copy link
Copy Markdown
Contributor

This PR adds a first version of the test suite for the swagger schema. This is the test used to report #3342. I have divided the test cases into two categories. The test that are currently succeeding and the tests that are failing. The later have been tagged as broken. By doing so, we can run the first category by calling
python manage.py test dojo.unittests.test_swagger_schema.py --exclude-tag broken
and the second category by calling
python manage.py test dojo.unittests.test_swagger_schema.py --tag broken

Ideally, this test would be implemented in the current pipeline first, by adding --exclude-tag broken to the command called by the job in charge of running the unit tests then by adding a new job that would run only that test but with --tag broken and that job would be allowed to fail. By doing so, we wouldn't have a pipeline that fails until we correct all the errors in the schema but we would still ensure that new features are not breaking the schemas that are valid.

As we correct the tests that are broken, we only need to remove the tags so that the corresponding test case will be executed by the standard pipeline.

I don't know if my explanation is clear enough, let me know what you think of this approach :)

Note Do not merge already as the pipeline needs to be modified accordingly

@valentijnscholten

Copy link
Copy Markdown
Member

@madchap madchap added the apiv2 label Dec 24, 2020
@madchap
madchap merged commit 17bc5ad into DefectDojo:dev Jan 17, 2021
@madchap madchap mentioned this pull request Jan 19, 2021
9alexx3 pushed a commit to 9alexx3/django-DefectDojo that referenced this pull request Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants