Skip to content

Commit

Permalink
Merge pull request #48 from fescobar/beta
Browse files Browse the repository at this point in the history
Adding statistics info to emailable-report
Updating to Allure 2.13.0
  • Loading branch information
fescobar authored Sep 9, 2019
2 parents 38fafc1 + ee72c0e commit 6950a7a
Show file tree
Hide file tree
Showing 9 changed files with 127 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ language: bash

env:
global:
- ALLURE_RELEASE=2.12.1
- ALLURE_RELEASE=2.13.0
- TARGET=frankescobar/allure-docker-service
- QEMU_VERSION=v4.0.0
matrix:
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Table of contents
* [Override server link](#override-server-link)
* [Develop a new template](#develop-a-new-template)
* [Using Allure Options](#using-allure-options)
* [SUPPORT](#SUPPORT)
* [Gitter](#gitter)
* [DOCKER GENERATION (Usage for developers)](#docker-generation-usage-for-developers)

## FEATURES
Expand Down Expand Up @@ -60,9 +62,9 @@ The following table shows the provided Manifest Lists.

| **Tag** | **allure-docker-service Base Image** |
|----------------------------------------|---------------------------------------------------|
| latest, 2.12.1 | frankescobar/allure-docker-service:2.12.1-amd64 |
| | frankescobar/allure-docker-service:2.12.1-arm32v7 |
| | frankescobar/allure-docker-service:2.12.1-arm64v8 |
| latest, 2.13.0 | frankescobar/allure-docker-service:2.13.0-amd64 |
| | frankescobar/allure-docker-service:2.13.0-arm32v7 |
| | frankescobar/allure-docker-service:2.13.0-arm64v8 |

## USAGE
### Generate Allure Results
Expand Down Expand Up @@ -271,7 +273,7 @@ You can switch the version container using `frankescobar/allure-docker-service:$
Docker Compose example:
```sh
allure:
image: "frankescobar/allure-docker-service:2.12.1"
image: "frankescobar/allure-docker-service:2.13.0"
```
or using latest version:

Expand Down Expand Up @@ -393,6 +395,11 @@ Reference:
- https://docs.qameta.io/allure/#_config_samples
- https://docs.qameta.io/allure/#_job_dsl_plugin

## SUPPORT
### Gitter
[![Gitter](https://badges.gitter.im/allure-docker-service/community.svg)](https://gitter.im/allure-docker-service/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)


## DOCKER GENERATION (Usage for developers)
### Install Docker
```sh
Expand All @@ -407,7 +414,7 @@ If you want to use docker without sudo, read following links:

### Build image
```sh
docker build -t allure-release --build-arg RELEASE=2.12.1 .
docker build -t allure-release -f docker/archive/Dockerfile --build-arg RELEASE=2.13.0 .
```
### Run container
```sh
Expand Down Expand Up @@ -458,5 +465,5 @@ docker run -d -p 4040:4040 -p 5050:5050 frankescobar/allure-docker-service
```
### Download specific tagged image registered (Example)
```sh
docker run -d -p 4040:4040 -p 5050:5050 frankescobar/allure-docker-service:2.12.1
docker run -d -p 4040:4040 -p 5050:5050 frankescobar/allure-docker-service:2.13.0
```
121 changes: 110 additions & 11 deletions allure-docker-api/templates/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<div class="lead">Allure Docker Service</div>
<br>
<ul class="list-group">
<li class="list-group-item d-flex justify-content-between align-items-center">
Tests Cases
<span class="badge badge-primary badge-pill">{{ testCases|length }}</span>
</li>
<li class="list-group-item d-flex justify-content-between align-items-center">
Server Link
<span class="badge badge-light badge-pill">
Expand All @@ -26,15 +22,82 @@
</li>
</ul>

{% set count = namespace(total=testCases|length,passed=0,failed=0,broken=0,skipped=0,unknown=0) %}
{% for testCase in testCases %}
{% if testCase.status=='passed' %}
{% set count.passed = count.passed + 1 %}
{% elif testCase.status=='failed' %}
{% set count.failed = count.failed + 1 %}
{% elif testCase.status=='broken' %}
{% set count.broken = count.broken + 1 %}
{% elif testCase.status=='skipped' %}
{% set count.skipped = count.skipped + 1 %}
{% elif testCase.status=='unknown' %}
{% set count.unknown = count.unknown + 1 %}
{% endif %}
{% endfor %}

{% set percentage = namespace(passed=0,failed=0,broken=0,skipped=0,unknown=0) %}
{% if testCases|length != 0 %}
{% set percentage.passed = (count.passed * 100)/testCases|length %}
{% set percentage.failed = (count.failed * 100)/testCases|length %}
{% set percentage.broken = (count.broken * 100)/testCases|length %}
{% set percentage.skipped = (count.skipped * 100)/testCases|length %}
{% set percentage.unknown = (count.unknown * 100)/testCases|length %}
{% endif %}
<br>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th scope="col" class="table-active text-center">Total</th>
<th scope="col" class="table-success text-center">Passed</th>
<th scope="col" class="table-danger text-center">Failed</th>
<th scope="col" class="table-warning text-center">Broken</th>
<th scope="col" class="table-light text-center">Skipped</th>
<th scope="col" class="table-dark text-center">Unknown</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="col" class="text-center">{{ testCases|length }}</th>
<th scope="col" class="text-center">{{ count.passed }} ({{'%0.2f'| format(percentage.passed)}}%)</th>
<th scope="col" class="text-center">{{ count.failed }} ({{'%0.2f'| format(percentage.failed)}}%)</th>
<th scope="col" class="text-center">{{ count.broken }} ({{'%0.2f'| format(percentage.broken)}}%)</th>
<th scope="col" class="text-center">{{ count.skipped }} ({{'%0.2f'| format(percentage.skipped)}}%)</th>
<th scope="col" class="text-center">{{ count.unknown }} ({{'%0.2f'| format(percentage.unknown)}}%)</th>
</tr>
</tbody>
</table>
</div>

<hr class="my-4">

{% set css = namespace(border='', badge='') %}
{% for testCase in testCases %}
<div
class="card border-secondary mb-3 {% if testCase.status=='passed' %} border-success{% elif testCase.status=='failed'%} border-danger{% elif testCase.status=='broken'%} border-warning{% elif testCase.status=='skipped'%} border-light{% elif testCase.status=='unknown'%} border-dark{% endif %}">
{% if testCase.status=='passed' %}
{% set css.border = 'border-success' %}
{% set css.badge = 'badge-success' %}
{% elif testCase.status=='failed' %}
{% set css.border = 'border-danger' %}
{% set css.badge = 'badge-danger' %}
{% elif testCase.status=='broken' %}
{% set css.border = 'border-warning' %}
{% set css.badge = 'badge-warning' %}
{% elif testCase.status=='skipped' %}
{% set css.border = 'border-light' %}
{% set css.badge = 'badge-light' %}
{% elif testCase.status=='unknown' %}
{% set css.border = 'border-dark' %}
{% set css.badge = 'badge-dark' %}
{% endif %}

<div
class="card border-secondary mb-3 {{ css.border }}">
<div class="card-header">
{{testCase.name}} <span
class="badge badge-pill {% if testCase.status=='passed' %} badge-success{% elif testCase.status=='failed'%} badge-danger{% elif testCase.status=='broken'%} badge-warning{% elif testCase.status=='skipped'%} badge-light{% elif testCase.status=='unknown'%} badge-dark{% endif %}">{{testCase.status}}</span>
{{testCase.name}}
<span
class="badge badge-pill {{css.badge}}">{{testCase.status}}</span>
</div>

<div class="card-body">
Expand Down Expand Up @@ -87,9 +150,21 @@
<!-- TABLE - BEFORE STAGES -->
{% if testCase.beforeStages is defined %}
{% for beforeStage in testCase.beforeStages %}
{% set css = namespace(table='') %}
{% for step in beforeStage.steps %}
{% if step.status=='passed' %}
{% set css.table = 'table-success' %}
{% elif step.status=='failed' %}
{% set css.table = 'table-danger' %}
{% elif step.status=='broken' %}
{% set css.table = 'table-warning' %}
{% elif step.status=='skipped' %}
{% set css.table = 'table-light' %}
{% elif step.status=='unknown' %}
{% set css.table = 'table-dark' %}
{% endif %}
<tr
class="{% if step.status=='passed' %} table-success{% elif step.status=='failed' %} table-danger {% elif step.status=='broken' %} table-warning {% elif step.status=='skipped' %} table-light {% elif step.status=='unknown' %} table-dark{% endif %}">
class="{{ css.table }}">
<td>{{step.name}}</td>
{% if step.time is defined and step.time.duration is defined %}
<td>{{step.time.duration/1000}} s</td>
Expand Down Expand Up @@ -123,9 +198,21 @@ <h6>{{step.statusTrace}}</h6>
<!-- TABLE - TEST STAGES -->
{% if testCase.testStage is defined %}

{% set css = namespace(table='') %}
{% for step in testCase.testStage.steps %}
{% if step.status=='passed' %}
{% set css.table = 'table-success' %}
{% elif step.status=='failed' %}
{% set css.table = 'table-danger' %}
{% elif step.status=='broken' %}
{% set css.table = 'table-warning' %}
{% elif step.status=='skipped' %}
{% set css.table = 'table-light' %}
{% elif step.status=='unknown' %}
{% set css.table = 'table-dark' %}
{% endif %}
<tr
class="{% if step.status=='passed' %} table-success{% elif step.status=='failed' %} table-danger {% elif step.status=='broken' %} table-warning {% elif step.status=='skipped' %} table-light {% elif step.status=='unknown' %} table-dark{% endif %}">
class="{{ css.table }}">
<td>{{step.name}}</td>
{% if step.time is defined and step.time.duration is defined %}
<td>{{step.time.duration/1000}} s</td>
Expand Down Expand Up @@ -158,9 +245,21 @@ <h6>{{step.statusTrace}}</h6>
<!-- TABLE - AFTER STAGES -->
{% if testCase.afterStages is defined %}
{% for afterStage in testCase.afterStages %}
{% set css = namespace(table='') %}
{% for step in afterStage.steps %}
{% if step.status=='passed' %}
{% set css.table = 'table-success' %}
{% elif step.status=='failed' %}
{% set css.table = 'table-danger' %}
{% elif step.status=='broken' %}
{% set css.table = 'table-warning' %}
{% elif step.status=='skipped' %}
{% set css.table = 'table-light' %}
{% elif step.status=='unknown' %}
{% set css.table = 'table-dark' %}
{% endif %}
<tr
class="{% if step.status=='passed' %} table-success{% elif step.status=='failed' %} table-danger {% elif step.status=='broken' %} table-warning {% elif step.status=='skipped' %} table-light {% elif step.status=='unknown' %} table-dark{% endif %}">
class="{{ css.table }}">
<td>{{step.name}}</td>
{% if step.time is defined and step.time.duration is defined %}
<td>{{step.time.duration/1000}} s</td>
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
context: ../allure-docker-service
dockerfile: docker/archive/Dockerfile
args:
RELEASE: "2.12.1"
RELEASE: "2.13.0"
environment:
CHECK_RESULTS_EVERY_SECONDS: 1
KEEP_HISTORY: "TRUE"
Expand Down
4 changes: 2 additions & 2 deletions docker-custom/Dockerfile.bionic-custom
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ ARG JDK=adoptopenjdk:11-jre-openj9-bionic
FROM $ARCH/$JDK

ARG BUILD_DATE
ARG BUILD_VERSION=2.12.1-custom
ARG BUILD_VERSION=2.13.0-custom
ARG BUILD_REF=na
ARG ARCH=amd64
ARG ALLURE_RELEASE=2.12.1
ARG ALLURE_RELEASE=2.13.0
ARG ALLURE_REPO=https://dl.bintray.com/qameta/maven/io/qameta/allure/allure-commandline

LABEL org.label-schema.build-date=${BUILD_DATE} \
Expand Down
Binary file modified images/emailable-report-custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/emailable-report-server-link.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/emailable-report-title.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/emailable-report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6950a7a

Please sign in to comment.