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

[JENKINS-73965] Extract event handlers in MultiJobTestResults/summary.jelly #375

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

shlomomdahan
Copy link
Contributor

JENKINS-73965

Removes inline JS and onClick.

Testing done

  1. Create two freestyle projects. In the build section, add to each a shell script to create jUnit test results (need at least 4-5 failures total to show the relevant expand link.
    ex:
# Create the directory for storing test results
mkdir -p test-results

# Generate a JUnit XML report with 6 tests: 3 passed, 3 failed
cat <<EOF > test-results/test-report-project2.xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="TestSuiteProject2" tests="6" failures="3" time="0.005">
  <testcase classname="TestClass1" name="testSuccess1" time="0.001"/>
  <testcase classname="TestClass2" name="testSuccess2" time="0.001"/>
  <testcase classname="TestClass3" name="testSuccess3" time="0.001"/>

  <testcase classname="TestClass4" name="testFailure1" time="0.001">
    <failure message="Test failure 1">Assertion failed in testFailure1</failure>
  </testcase>
  
  <testcase classname="TestClass5" name="testFailure2" time="0.001">
    <failure message="Test failure 2">Null pointer exception in testFailure2</failure>
  </testcase>
  
  <testcase classname="TestClass6" name="testFailure3" time="0.001">
    <failure message="Test failure 3">Array index out of bounds in testFailure3</failure>
  </testcase>
</testsuite>
EOF
  1. in the post-build section for each freestyle project, select Publish JUnit test result report and enter the file src from example: test-results/*.xml
  2. Create new MultiJob Project.
  3. in the build steps select MultiJob Phase
  4. Add the two Phase Jobs (the two freestyle jobs just created). In the advanced section select Aggregate Test Results
  5. In the Post Build Actions, select Aggregate downstream test results and check the both boxes available.
  6. Build the project and navigate to Status section of the latest build. This brings you to the relevant screen.

Status Quo Video
CSP Report Only
CSP Restrictive

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

Copy link

@yaroslavafenkin yaroslavafenkin left a comment

Choose a reason for hiding this comment

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

LGTM

@balakine balakine merged commit 781a27c into jenkinsci:master Oct 21, 2024
18 checks passed
basil added a commit to basil/jenkins-multijob-plugin that referenced this pull request Oct 22, 2024
@basil basil mentioned this pull request Oct 22, 2024
}
</script>

<st:adjunct includes="com.tikal.jenkins.plugins.multijob.MultiJobTestResults.failure-summary" />
Copy link
Member

Choose a reason for hiding this comment

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

basil added a commit that referenced this pull request Oct 22, 2024
@basil basil added the internal label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants