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 33 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

@mw-kapilg mw-kapilg marked this pull request as ready for review October 23, 2024 08:07
@mw-kapilg
Copy link
Member Author

@mw-hrastega, for text review you can go through all the .jelly files.

<button id="Incomplete" onclick="showTests(id)" class="jenkins-button jenkins-!-margin-4 jenkins-!-padding-0" style="display: inline; width:8em;" tooltip="Incomplete tests">
<p>${it.incompleteCount}<br>
<l:icon class="symbol-alert-circle-outline plugin-ionicons-api icon-lg jenkins-!-warning-color"/>
</br><br></br>Incomplete</p>
Copy link
Member

Choose a reason for hiding this comment

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

The test browser uses different icons for incomplete and "not run" tests.

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

pom.xml Outdated
<artifactId>bom-2.164.x</artifactId>
<version>4</version>
<artifactId>bom-2.346.x</artifactId>
<version>1763.v092b_8980a_f5e</version>
Copy link
Member

Choose a reason for hiding this comment

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

since We are updating this, could we consider updating it to the latest ? https://github.com/jenkinsci/bom/blob/master/README.md

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
src/main/java/com/mathworks/ci/TestDiagnostics.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/TestFile.java Outdated Show resolved Hide resolved
src/main/java/com/mathworks/ci/TestResultsViewAction.java Outdated Show resolved Hide resolved

public List<List<TestFile>> getTestResults() throws ParseException, InterruptedException, IOException {
List<List<TestFile>> testResults = new ArrayList<>();
FilePath fl = new FilePath(new File(build.getRootDir().getAbsolutePath() + File.separator + MatlabBuilderConstants.TEST_RESULTS_VIEW_ARTIFACT + this.actionID + ".json"));
Copy link
Member

Choose a reason for hiding this comment

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

Does this work for a Windows server and Linux agent and vice-versa? I've sometimes run into trouble with using File.separator in those cases.

I'm always a little nervous about working with file paths in the Jenkins plugin because it's really easy to get a path to a file on the agent that doesn't exist on the server and vice-versa. Something I mess up all the time haha.

This case looks good to me though as all of the action code should be running on the agent!

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't get me started on file paths issue with Jenkins, I've devoted so much time to fixing those 😭
Haven't tested this combination yet but sure will test it before releasing.

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
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