-
Notifications
You must be signed in to change notification settings - Fork 74
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 JobInclusionFolderProperty class #416
base: master
Are you sure you want to change the base?
Add test for JobInclusionFolderProperty class #416
Conversation
* add tests for util class * Use JUnit 4 assertions with JUnit 4 tests --------- Co-authored-by: Mark Waite <[email protected]>
@MarkEWaite I can modify these tests to isolate tests by creating a new FreeStyleProject before each test to execute? If resource usage is a concern, otherwise creating new project it ensures test isolation and prevents side effects from shared state and maintaining test reliability and accuracy. That is why I have left a tearDown() method in the class if at any point in future if anyone considers this approach more reliable? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The output when I run those tests locally includes a null pointer exception that is not causing the test to fail. I don't see the null pointer exception in the output from ci.jenkins.io but I see it locally. That will need to be resolved before this pull request can be considered further. The null pointer exception message that I see is:
java.lang.NullPointerException: Cannot invoke "java.util.List.add(Object)" because "jenkins.advancedqueue.testutil.TestRunListener.actual" is null
at jenkins.advancedqueue.testutil.TestRunListener.onStarted(TestRunListener.java:33)
at hudson.model.listeners.RunListener.lambda$fireStarted$2(RunListener.java:246)
at jenkins.util.Listeners.lambda$notify$0(Listeners.java:59)
at jenkins.util.Listeners.notify(Listeners.java:67)
at hudson.model.listeners.RunListener.fireStarted(RunListener.java:244)
at hudson.model.Run.execute(Run.java:1892)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:101)
at hudson.model.Executor.run(Executor.java:442)
I did get that error locally but after (hours of) some modifications it disappeared so yes I don't have a solution right now I will get to it as it is occurring now |
Null pointer exception is fixed as far as I can tell. |
Thank you for helping out, I think I should n't have tried to change the methods in the class excuse me this time I did try something out and it didn't work out. |
No problem. I'm truly pleased that you are exploring and that you're not shy about making changes that improve testability. |
Testing done
Added a new test class for JobInclusionFolderProperty class and added a constructor in ItemInfo class.
JIRA issue JENKINS-69757
Submitter checklist