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-69658] - failed-test.jelly javascript un-inlined. #451

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Artmorse
Copy link

@Artmorse Artmorse commented Oct 24, 2022

The issue
You can find all the issue details here.

My updates
I've moved the onclick calls from the failed-test.jelly file to the failureSummary.js one.

  • 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

testShowlinks.forEach((element) => {
element.onclick = (_) => {
const testId = element.id.replace('-showlink', '');
showFailureSummary(testId, document.URL + "/summary");

Choose a reason for hiding this comment

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

document.URL is wrong, as it refers to that page we're in. Request has to go to JENKINS_URL/job/fs/5/testReport/<package_name>/<test_name>/summary and not just JENKINS_URL/job/fs/5/testReport/summary
Currently this returns 404:
image

Copy link
Author

Choose a reason for hiding this comment

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

Ok, can you please complete the Reproduction steps section of the Jira ticket (JENKINS-69658) description ?

Copy link
Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

@Artmorse commented in the ticket

Copy link
Author

@Artmorse Artmorse Oct 31, 2022

Choose a reason for hiding this comment

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

Perfect! I was able to do my tests! 😄

@Artmorse
Copy link
Author

@yaroslavafenkin
Can you add the hacktoberfest-accepted label to this PR if it's seems good to you ? 😊

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.

Still does not work as expected.

image

Request URL still looks wrong:
image

Providing steps I used:

  1. Create a freestyle project
  2. Select Git as SCM, as repository URL specify https://github.com/yaroslavafenkin/security-notifier.git. As branch specifier put */fail.
  3. Add 'Invoke top-level Maven targets' build step. As goal set test.
  4. Add 'Publish JUnit test result report' post-build action. As fileset includes put **/*.xml.
  5. Save it and trigger a build.
  6. When it fails go to the build and then to 'Test Result' action.
  7. Open browser developer tools and go under 'All Failed Tests' hit the plus icon to obtain details about the failed test. You'll see failed request in the console, and should see an error as on the screenshot above.

@Kevin-CB
Copy link

Kevin-CB commented Mar 8, 2024

Hey @Artmorse, I tried reviewing this PR and followed Yaroslav's steps. I'm not encountering any errors, it's working as expected.

However, I noticed that we missed to report an occurrence of inline JS (summary.jelly#L34-L35)
It's in a different class, but closely related to your changes, so if you're still willing to work on this topic, I'd be here to review it once more and help get it finally merged!

@Artmorse
Copy link
Author

Artmorse commented Mar 8, 2024

hey @Kevin-CB, yes I'll make the changes and I'll ping you when it's done!

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.

3 participants