Skip to content

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

@FloHin

Description

@FloHin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions