Skip to content

ci: Introduce a new Support::Formatters::JsonFormatter

Rémy Coutable requested to merge introduce-a-rspec-json-formatter into master

What does this MR do and why?

This introduces a new Support::Formatters::JsonFormatter borrowed from https://gitlab.com/gitlab-org/gitlab/-/blob/master/qa/qa/support/json_formatter.rb.

Example: https://gitlab-org.gitlab.io/-/gitlab/-/jobs/4383646376/artifacts/rspec/rspec-4383646376.json

{
  "version": "3.12.0",
  "messages": [
    "Run options: exclude {:quarantine=\u003etrue, :zoekt=\u003etrue}"
  ],
  "examples": [
    {
      "id": "./spec/migrations/20230208103009_fix_partition_ids_for_ci_job_artifact_spec.rb[1:1:1:1]",
      "description": "schedules background jobs for each batch of ci_job_artifacts",
      "full_description": "FixPartitionIdsForCiJobArtifact when on saas #up schedules background jobs for each batch of ci_job_artifacts",
      "status": "passed",
      "file_path": "./spec/migrations/20230208103009_fix_partition_ids_for_ci_job_artifact_spec.rb",
      "line_number": 15,
      "run_time": 1.099801204,
      "pending_message": null,
      "testcase": null,
      "quarantine": null,
      "screenshot": null,
      "product_group": null,
      "feature_category": "continuous_integration",
      "ci_job_url": "https://gitlab.com/gitlab-org/gitlab/-/jobs/4383646376"
    },
    ...
  ]
}

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Rémy Coutable

Merge request reports