Git Product home page Git Product logo

report_factory's Introduction

Report Factory

Build Status

Report Factory is a storage for your test reports with intuitive API to manage all your projects test results.

The provided API are based on the JSON API convention. Currently migrating to GraphQL.

Getting Started

Follow these instructions to get Report Factory running with Docker. The configuration is ready for production.

The image of this project can be pulled from Dockerhub:

  docker pull reportfactory/server

Preconditions

  • Add Content-Type header with application/vnd.api+json
  • Add your account's X-API-KEY to header

Available API

Users

To login and get your X-API-KEY:

POST /api/v1/users/login

{
    "data":{
        "type":"users",
        "attributes":{
            "email":"[email protected]",
            "password":"Password1"
        }
    }
}

To return your user:

GET /api/v1/user


To return all registered users:

GET /api/v1/users


To create a user (Admin only):

POST /api/v1/users/create

{
    "data":{
        "type":"users",
        "attributes":{
            "name":"UserName",
            "email":"[email protected]",
            "password":"Password1",
            "type":"Tester"
        }
    }
}

To update a user (Admin only):

PUT /api/v1/users/:id

{
    "data":{
        "type":"users",
        "attributes":{
            "name":"UpdatedName",
            "email":"[email protected]"
        }
    }
}

Note: You can promote user to Admin by passing "type":"Admin"


To get user information:

GET /api/v1/users/:id


To get all reports of a user:

GET /api/v1/users/:id/reports


To get all RSpec reports of a user:

GET /api/v1/users/:id/reports/rspec


To delete a user (Admin only):

DELETE /api/v1/users/:id


Projects

To return all available projects:

GET /api/v1/projects


To create a new project (Admin only):

POST /api/v1/projects

{
    "data":{
        "type":"project",
        "attributes":{
            "project_name":"MyAwesomeProject"
        }
    }
}

To get project by name:

GET /api/v1/projects/:project_name


To update a project:

PUT /api/v1/projects/:project_name

{
    "data":{
        "type":"project",
        "attributes":{
            "project_name":"UpdatedProjectName"
        }
    }
}

To delete a project (Admin only):

DELETE /api/v1/projects/:project_name

Project Reports

To return all reports within a project:

GET /api/v1/projects/:project_name/reports


To get all RSpec reports within a project:

GET /api/v1/projects/:project_name/reports/rspec


To submit an RSpec report:

POST /api/v1/projects/:project_name/reports/rspec

{
  "data": {
    "type": "rspec_report",
    "attributes": {
      "version": "3.7.0",
      "examples": [
        {
          "id": "./spec/routing/routes_spec.rb[1:4:1]",
          "description": "routes GET /api/v1/projects/:project_name/reports/rspecto rspec_reports#index",
          "full_description": "routing /api/v1/projects/:project_name/reports/rspec routes GET /api/v1/projects/:project_name/reports/rspecto rspec_reports#index",
          "status": "passed",
          "file_path": "./spec/routing/routes_spec.rb",
          "line_number": 59,
          "run_time": 0.001341,
          "pending_message": null,
        },
        {
          "id": "./spec/requests/rspec_reports_api_spec.rb[1:1:1]",
          "description": "gets all rspec reports within project",
          "full_description": "RspecReports GET index gets all rspec reports within project",
          "status": "failed",
          "file_path": "./spec/requests/rspec_reports_api_spec.rb",
          "line_number": 11,
          "run_time": 0.032876,
          "pending_message": null,
          "exception": {
            "class": "RSpec::Expectations::ExpectationNotMetError",
            "message": "\nexpected: 200\n     got: 204\n\n(compared using ==)\n",
            "backtrace": [
              "./gems/rspec-support-3.7.0/lib/rspec/support.rb:97:in `block in \u003cmodule:Support\u003e'",
              "./gems/rspec-support-3.7.0/lib/rspec/support.rb:106:in `notify_failure'",
              "./gems/rspec-expectations-3.7.0/lib/rspec/expectations/fail_with.rb:35:in `fail_with'",
              "./gems/rspec-expectations-3.7.0/lib/rspec/expectations/handler.rb:38:in `handle_failure'",
              "./gems/rspec-expectations-3.7.0/lib/rspec/expectations/handler.rb:50:in `block in handle_matcher'",
            ]
          }
        }
      ]
      "summary": {
        "duration": 0.747558,
        "example_count": 2,
        "failure_count": 1,
        "pending_count": 0,
        "errors_outside_of_examples_count": 0
      },
      "summary_line": "2 examples, 1 failures",
    }
  }
}

To view an existing RSpec reports within a project:

GET /api/v1/projects/:project_name/reports/rspec/:id

Reports

To return all reports:

GET /api/v1/reports


To get all RSpec reports:

GET /api/v1/reports/rspec

Scenarios

To return all scenarios:

GET /api/v1/scenarios


To get all scenarios by project:

GET /api/v1/projects/:project_name/scenarios

GraphQL

Clients can fetch data using GraphQL from /graphql' endpoint. Just make sure you pass X-API-KEY` header with your user token. To acccess GraphiQL in development you need to set the token in the environment variable:

  export X_API_KEY={your_x_api_key}

Then youl'll be able to access /graphiql on your localhost.

License

The application is available as open source under the terms of the MIT License.

report_factory's People

Contributors

igor-starostenko avatar

Watchers

James Cloos avatar Joseph Yi avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.