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 for AllNodesBuildParameterFactory class #369

Merged

Conversation

yashpal2104
Copy link
Contributor

@yashpal2104 yashpal2104 commented Dec 22, 2024

Testing done

I have added automated tests for the AllNodesBuildParameterFactory class

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

@yashpal2104 yashpal2104 requested a review from a team as a code owner December 22, 2024 19:03
@github-actions github-actions bot added the tests Automated test addition or improvement label Dec 22, 2024
@yashpal2104
Copy link
Contributor Author

@MarkEWaite
Here at line 37, 50 and 62 I did try to ignore the trigger build on Jenkins (built-in) which is a node by default triggered to build at the starting by writing a line of code to remove it from the params List but I was not able to remove it so I added '1' to the expected output because the node count is increased by one ultimately.
So is it ok or do I need to figure out to write the code so that the test are more efficient?
I can provide more details on the code I had written if you want me to explain further.

Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

This looks great. Very nice work.

You could further increase the branch coverage of the getParameters() method if you created a test that set the number of executors of one of the agents to 0. That branch of the getParameters() conditional does not seem to be covered in any of the current tests.

The comments I've made are all optional.

Don't forget to update your local copy of the master branch to match the upstream copy of the master branch.

Also, when creating the pull request description, the checklist formats more nicely if you use [X] something instead of [ X] something. The extra space inside the square brackets causes the GitHub formatter to not show it as a checked box.

@yashpal2104
Copy link
Contributor Author

Yes these comments accurately depict the workflow and results to expect off of tests. Thank you

Also, when creating the pull request description, the checklist formats more nicely if you use [X] something instead of [ X] something. The extra space inside the square brackets causes the GitHub formatter to not show it as a checked box.

OK I will do this from now

@MarkEWaite MarkEWaite enabled auto-merge (squash) December 23, 2024 14:20
@MarkEWaite MarkEWaite merged commit 287c3b8 into jenkinsci:master Dec 23, 2024
18 checks passed
@yashpal2104 yashpal2104 deleted the allNodesBuildParameterFactoryTest branch December 23, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Automated test addition or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants