openedx / xblock-lti-consumer

GNU Affero General Public License v3.0
28 stars 84 forks source link

feat: added error msg to launch error template #394

Closed ilee2u closed 1 year ago

ilee2u commented 1 year ago

Ticket: MST-1931

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.13% :tada:

Comparison is base (b57ccbb) 97.76% compared to head (0c3fdb9) 97.89%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #394 +/- ## ========================================== + Coverage 97.76% 97.89% +0.13% ========================================== Files 77 77 Lines 6384 6399 +15 ========================================== + Hits 6241 6264 +23 + Misses 143 135 -8 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `97.89% <100.00%> (+0.13%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files Changed](https://app.codecov.io/gh/openedx/xblock-lti-consumer/pull/394?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx) | Coverage Δ | | |---|---|---| | [lti\_consumer/\_\_init\_\_.py](https://app.codecov.io/gh/openedx/xblock-lti-consumer/pull/394?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-bHRpX2NvbnN1bWVyL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | | | [lti\_consumer/lti\_xblock.py](https://app.codecov.io/gh/openedx/xblock-lti-consumer/pull/394?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-bHRpX2NvbnN1bWVyL2x0aV94YmxvY2sucHk=) | `96.48% <100.00%> (ø)` | | | [lti\_consumer/plugin/views.py](https://app.codecov.io/gh/openedx/xblock-lti-consumer/pull/394?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-bHRpX2NvbnN1bWVyL3BsdWdpbi92aWV3cy5weQ==) | `97.92% <100.00%> (+2.50%)` | :arrow_up: | | [lti\_consumer/tests/unit/plugin/test\_views.py](https://app.codecov.io/gh/openedx/xblock-lti-consumer/pull/394?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-bHRpX2NvbnN1bWVyL3Rlc3RzL3VuaXQvcGx1Z2luL3Rlc3Rfdmlld3MucHk=) | `100.00% <100.00%> (ø)` | | | [lti\_consumer/tests/unit/test\_lti\_xblock.py](https://app.codecov.io/gh/openedx/xblock-lti-consumer/pull/394?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=openedx#diff-bHRpX2NvbnN1bWVyL3Rlc3RzL3VuaXQvdGVzdF9sdGlfeGJsb2NrLnB5) | `99.22% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ilee2u commented 1 year ago

Seeing now that codecov fails, but if I recall correctly, it isn't really feasible to run unit tests on some of these error messages due to how dependent on the LTI dataflow each piece of this is.

zacharis278 commented 1 year ago

@ilee2u took a look at the missing cases and I think it should be relatively straightforward to add some tests. We can add on to https://github.com/openedx/xblock-lti-consumer/blob/c659e07aa743cb89d8f04a41673ec58e85c9f7fe/lti_consumer/tests/unit/test_lti_xblock.py#L834 that mocks extract_real_user_data throwing and error and it looks like we already have error tests for the other missing cases in TestLti1p3LaunchGateEndpoint we just need an invalid context claim launch and another test that mocks out validate_lti_1p3_launch_data. Lemme know if you need help on setting these up