GithubHelp home page GithubHelp logo

twnel / allure-box Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pupssman/allure-box

0.0 4.0 0.0 4 KB

Docker container to generate and serve allure report via simple API

Groovy 68.96% Python 31.04%

allure-box's Introduction

Allure report box

A simplish container aimed at generating allure reports in a unifor way and displaying them

Usage

  • run container with docker run -p <myport>:80 pupssman/allure-box http://how.i.will.expose.container:<myport>/ -- container listens on HTTP port 80 inside, you should expose it somehow and pass the exposed base URL as a launch parameter
  • send POST request with multipart/form-data body of report's files to /generate handle of the container
  • receive back JSON similar to {"result": "OK", "url": "http://how.i.xxx:<myport>/3/output/index.html"}
  • navigate your browser to said URL and examine the report

Minimalistic python client

This serves as an example for a simple client to this container. With little work it can be reduced to a bash-usable one-liner.

In [13]: import os

In [14]: import requests

In [15]: d = '/trash/areports/'

In [17]: print requests.post('http://localhost:8083/generate', files={f: open(os.path.join(d, f), 'rb').read() for f in os.listdir(d) if os.path.isfile(os.path.join(d, f))}).json()['url']
http://localhost:8083//5/output/index.html

Running tests

  • install pytest and requests python packages
  • build and deploy container as in Usage
  • run py.test --boxurl=<container_endpoint_url> tests.py

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.