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 a @Issue IssueProcessor for Gitlab Requirements Json export #37

Open
FloHin opened this issue Mar 7, 2021 · 1 comment
Open

Add a @Issue IssueProcessor for Gitlab Requirements Json export #37

FloHin opened this issue Mar 7, 2021 · 1 comment

Comments

@FloHin
Copy link

FloHin commented Mar 7, 2021

As we evaluate to use Gitlab Requirements Management I looked to connect them with Junit4/Junit5.

https://docs.gitlab.com/ee/user/project/requirements/#allow-requirements-to-be-satisfied-from-a-ci-job

Coming to junit-pioneer with the @issue annotation, that looks very promising

As pointed out, users would need to provide a custom processor for that:

public class SimpleProcessor implements IssueProcessor {

    @Override
    public void processTestResults(
            List<IssueTestSuite> allResults) {
        for(IssueTestSuite testSuite : allResults) {
            System.out.println(testSuite.issueId());
        }
    }

}

I propose to have some configuration options to use some built-in processors like "GitlabJsonRequirements" processor to automatically create a json which could be used in Gitlab CI pipelines

Official Gitlab CI example:

requirements_confirmation:
  when: manual
  allow_failure: false
  script:
    - mkdir tmp
    - echo "{\"1\":\"passed\", \"2\":\"failed\"}" > tmp/requirements.json
  artifacts:
    reports:
      requirements: tmp/requirements.json

Just for info: I could spend some time contributing, as this feature seems small, and maybe would be better build into junit-pioneer than just randomly in our codebase.

@Michael1993 Michael1993 transferred this issue from junit-pioneer/junit-pioneer Mar 7, 2021
@Bukama
Copy link
Member

Bukama commented Mar 8, 2021

Hey,
tanks for your feature-request. I can really imagine to support that. To be honest I'm in a low-action-phase and therefore the first version of test-reports are not yet released, but I hope this gives me some upstream.

Aside from that you are free to open a PR if you like!

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

No branches or pull requests

2 participants