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

Unit test and code coverage #107

Open
peppelinux opened this issue Oct 4, 2021 · 3 comments
Open

Unit test and code coverage #107

peppelinux opened this issue Oct 4, 2021 · 3 comments
Labels
enhancement New feature or request Hacktoberfest help wanted Extra attention is needed
Milestone

Comments

@peppelinux
Copy link
Member

At this moment we have a naif integration test suite based on system command and example metadata.

https://github.com/italia/spid-sp-test/blob/main/tests/test_02_authn.py

We need instead a metadata/authnrequest templating system (as already done fo saml2 responses) and a huge number of unit test that checks spid-sp-test case-by-case, simulating some common scenario and exceptions

@peppelinux peppelinux added this to the 1.0.0 milestone Oct 4, 2021
@peppelinux peppelinux added the enhancement New feature or request label Oct 4, 2021
@peppelinux
Copy link
Member Author

Here an example about how we could implement the unit tests
f30be8c

as we can see we just need a metadata string (faulty or not!).
Once the metadata was loaded we can call the method that we want to test

@peppelinux
Copy link
Member Author

peppelinux commented Oct 4, 2021

Here an example abou how to add a unit test for the spid-sp-test metadata checks
esempio_unittest_metadata_spid-sp-test

@peppelinux
Copy link
Member Author

Here a good start point for testing authn requests
https://github.com/italia/spid-sp-test/blob/main/tests/test_06_authnrequest.py

coverage up to 84% (even if integration test cover more ... but can't be covered in the report!)
https://github.com/italia/spid-sp-test/runs/3807703820#step:7:73

@peppelinux peppelinux added the help wanted Extra attention is needed label Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants