Skip to content

Prevent TestResultsSummaryPlugin from throwing jsonencode related errors - #10

Merged
mw-kapilg merged 4 commits into
mainfrom
kapilg/error-check
Mar 11, 2026
Merged

Prevent TestResultsSummaryPlugin from throwing jsonencode related errors#10
mw-kapilg merged 4 commits into
mainfrom
kapilg/error-check

Conversation

@mw-kapilg

Copy link
Copy Markdown
Contributor

Fixes matlab-actions/run-tests#74

This change is only a short term patch; a long term solution will be submitted soon.

@mw-hkhan

mw-hkhan commented Mar 9, 2026

Copy link
Copy Markdown

So essentially, with this fix we are adding a try–catch block to handle cases where jsonencode throws an error, correct? In those situations, what do users currently experience—do they simply not get any test summary view?

@mw-hkhan

mw-hkhan commented Mar 9, 2026

Copy link
Copy Markdown

Can you verify that this solution works for the two use cases from the customer escalations?

@sameagen-MW sameagen-MW left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same feedback as the other PR. Seems like a reasonable short term fix to me.

Comment thread plugins/+testframework/TestResultsSummaryPlugin.m Outdated
@mw-kapilg

Copy link
Copy Markdown
Contributor Author

So essentially, with this fix we are adding a try–catch block to handle cases where jsonencode throws an error, correct? In those situations, what do users currently experience—do they simply not get any test summary view?

That's correct and, in those situations, the user won't see any view.

Can you verify that this solution works for the two use cases from the customer escalations?

I was able to reproduce one of the two user issues and can confirm the fix was working fine. For the other issue, the user couldn't share any of their files (even smaller reproducible version) due to IP issues so can't reproduce the exact use case.

@mw-hkhan

Copy link
Copy Markdown

So essentially, with this fix we are adding a try–catch block to handle cases where jsonencode throws an error, correct? In those situations, what do users currently experience—do they simply not get any test summary view?

That's correct and, in those situations, the user won't see any view.

Can you verify that this solution works for the two use cases from the customer escalations?

I was able to reproduce one of the two user issues and can confirm the fix was working fine. For the other issue, the user couldn't share any of their files (even smaller reproducible version) due to IP issues so can't reproduce the exact use case.

@mw-kapilg - What happens when a test suite contains a mix of MATLAB and Simulink tests? Users were previously able to view the results, but after adding several additional mldatx‑based tests, they now encounter this exception.

@mw-kapilg

Copy link
Copy Markdown
Contributor Author

@mw-kapilg - What happens when a test suite contains a mix of MATLAB and Simulink tests? Users were previously able to view the results, but after adding several additional mldatx‑based tests, they now encounter this exception.

For a test suite containing both MATLAB and Simulink tests, the plugin should work fine. If the users were able to previously view the results, they'll continue to see them even after this change.

If the suite contains a SL test that involves an edge case scenario which results in an exception, the test results view won't be shown at all (not even for other MATLAB and non-erroring SL tests).

@mw-kapilg
mw-kapilg merged commit 89bece8 into main Mar 11, 2026
4 checks passed
@davidbuzinski
davidbuzinski deleted the kapilg/error-check branch March 26, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Simulink test execution errors out while generating test results summary

4 participants