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 publisher for test. #54

Closed
XiongKezhi opened this issue Dec 19, 2020 · 1 comment · Fixed by #55 or #59
Closed

Add publisher for test. #54

XiongKezhi opened this issue Dec 19, 2020 · 1 comment · Fixed by #55 or #59
Labels
good first issue Good for newcomers help wanted Extra attention is needed tests

Comments

@XiongKezhi
Copy link
Contributor

Currently, we don't have a reliable way to test the features (e.g. status checks, checks steps) that require the involvement of an implementation. Thus, adding a LogPublisher only for testing that logs the check details or anything being published is a good way to improve our test coverage and quality.

After injecting the LogPublisher into the Jenkins instance while testing, we can later check the log to make assertions, examples are like:

assertThat(JenkinsRule.getLog(buildSuccessfully(job)))

@XiongKezhi XiongKezhi added good first issue Good for newcomers help wanted Extra attention is needed test labels Dec 19, 2020
@mrginglymus
Copy link
Contributor

For the junit plugin I created a publisher that just stores published checks in a simple list:

https://github.com/jenkinsci/junit-plugin/blob/master/src/test/java/io/jenkins/plugins/junit/checks/JUnitChecksPublisherTest.java#L35-L66

that can be inspected after a run has finished.

Might this be something useful to move into here?

@XiongKezhi XiongKezhi added tests and removed test labels Dec 22, 2020
@XiongKezhi XiongKezhi changed the title Add a LogPublisher for test. Add publisher for test. Dec 22, 2020
@XiongKezhi XiongKezhi linked a pull request Dec 22, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed tests
Projects
None yet
2 participants