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

Add test results visualization #360

Open
wants to merge 38 commits into
base: dev_main
Choose a base branch
from

Conversation

mw-kapilg
Copy link
Member

This feature creates an in-platform view for MATLAB test results (whenever a default test runner or pre-made TestTask is used) if the user has a MATLAB Test license.

Key highlights:

  • Each row of the table represents the test file.
  • All tests for a single file are shown under that file.
  • The files with same name and different parent directories are shown separately and you can hover over the file name to see its path.
  • The table in table format allows easy management of test cases for a test file
  • You see the logs in-place for a failed/incomplete. If there are more than failures within a test case, say multiple verification failures, each verification failure will have its own dropdown and log box.
  • Each of the passed, failed, etc. buttons act as filters to respective type of tests
  • The "Open in MATLAB Online" button helps to redirect users to MATLAB Online. If their Jenkins project is connected to a git repository, they are prompted to open the in MATLAB Online for easy debugging.
  • The help button redirects users to our plugin's configuration guide.

Here's a few snapshots:
Screenshot 2024-09-18 113256
Screenshot 2024-09-18 113511

Test Name
</th>
<th class="pane-header" style="width: auto; min-width: 10em; text-align: right;">
Duration (seconds)
Copy link
Member

Choose a reason for hiding this comment

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

(s) instead of (seconds)?

Copy link
Member

Choose a reason for hiding this comment

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

Is it better to include + and - signs or drop-down arrows instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated (seconds) to (s)

Is it better to include + and - signs or drop-down arrows instead?

I didn't get this, could you explain?

Copy link
Member

Choose a reason for hiding this comment

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

Nothing major. Currently, it seems that you use the + and - buttons to expand and collapse sections in the report. I was wondering whether a drop-down arrow could do the same. In the test browser, we resort to the arrow for expansion: https://www.mathworks.com/help/matlab/matlab_prog/run-tests-using-test-browser.html#:~:text=You%20can%20also%20add%20tests%20to%20the%20test%20browser%20by%20clicking%20the%20drop%2Ddown%20arrow

Copy link
Member Author

Choose a reason for hiding this comment

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

That's true. For reference I had a look at the Jenkins JUnit and TAP plugins which were using + and - symbols to expand and collapse. I don't mind the chevrons either, do you feel using them for dropdowns would be more helpful for the user?

pom.xml Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/TestCase.java Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/TestCase.java Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/TestCase.java Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/TestCase.java Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/TestDiagnostics.java Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/TestFile.java Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/TestFile.java Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/TestFile.java Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/TestFile.java Outdated Show resolved Hide resolved
Base automatically changed from dev_main to 2.15.1-SNAPSHOT-Qualification November 14, 2024 14:10
@davidbuzinski davidbuzinski requested review from davidbuzinski and removed request for nbhoski December 12, 2024 15:10
@mw-kapilg mw-kapilg changed the base branch from 2.15.1-SNAPSHOT-Qualification to dev_main January 16, 2025 04:36
Copy link
Member

@davidbuzinski davidbuzinski left a comment

Choose a reason for hiding this comment

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

Looking good! I like the changes to MatlabTestCase and MatlabTestFile. A few more things in the MATLAB code for the TestRunnerPlugin then it should be ready to go.

Copy link
Member

@sameagen-MW sameagen-MW left a comment

Choose a reason for hiding this comment

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

Just some minor comments from me! The only blocker I see is what David mentioned with the cleanup code for the plugin.

:shipit:

src/main/java/com/mathworks/ci/TestResultsViewAction.java Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/TestResultsViewAction.java Outdated Show resolved Hide resolved
methods (Access=protected)
function reportFinalizedSuite(plugin, pluginData)
% Checkout MATLAB Test license
license('checkout', 'matlab_test');
Copy link
Member

Choose a reason for hiding this comment

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

I'm still slightly worried about this. I think ideally for me we'd do the license check and checkout at the same time, just to avoid any situations where MATLAB Test was available initially at the time of the first check but not at the time of reporting the finalized suite. Probably not a big deal though.

Copy link
Member Author

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 fine. Do you have a case in mind where the situation you're saying could happen?

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.

7 participants