Logo di Allure Reporting

Allure Reporting

Community
manikosto
allure-reporting

Allure Report integration with pytest — decorators, steps, attachments, severity levels, test categorization, CI/CD integration, and custom report plugins.

Panoramica

Pubblicato damanikosto
Repositoryclaude-code-python-stack
Nome della skillallure-reporting
Stelle
54
Fork
10
File inclusi
Solo istruzioni
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da manikosto su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Allure Reporting in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/manikosto/claude-code-python-stack/tree/main/skills/allure-reporting
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/manikosto/claude-code-python-stack.git /tmp/claude-code-python-stack
mkdir -p .claude/skills
cp -r /tmp/claude-code-python-stack/skills/allure-reporting .claude/skills/allure-reporting
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Allure Reporting in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Allure Reporting non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Allure Reporting non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Allure Reporting Patterns

Comprehensive Allure Report integration for pytest test suites.

When to Activate

  • Setting up Allure in a pytest project
  • Adding Allure metadata to test classes
  • Configuring Allure in CI/CD pipelines
  • Debugging test report rendering issues
  • Creating custom Allure plugins or extensions

Setup

bash
# Install
pip install allure-pytest

# Run tests with Allure
pytest --alluredir=allure-results -v

# Generate and open report
allure serve allure-results

# Generate static report
allure generate allure-results -o allure-report --clean

pyproject.toml

toml
[tool.pytest.ini_options]
addopts = "--alluredir=allure-results --clean-alluredir"

Allure Decorator Hierarchy

Required on EVERY test class and method:

python
import allure

@allure.epic("E-Commerce Platform")           # Top-level product area
@allure.feature("Shopping Cart")               # Feature being tested
class TestAddToCart(BaseTest):

    @allure.story("Add single item")           # User story
    @allure.severity(allure.severity_level.CRITICAL)  # Priority
    @allure.title("User can add product to cart")     # Human-readable title
    @allure.description("Verify that authenticated user can add a product to their cart")
    @allure.tag("cart", "positive")
    @allure.link("https://jira.example.com/PROJ-123", name="PROJ-123")
    def test_add_product_to_cart(self):
        ...

Severity Levels

LevelWhen to UseExample
BLOCKERApp unusable if failsLogin, payment processing
CRITICALMajor feature brokenUser creation, order placement
NORMALStandard functionalityProfile update, search
MINORMinor inconveniencePagination, sorting
TRIVIALCosmeticUI text, formatting

Allure Steps

Method-level steps (API service classes)

python
class OrdersAPI(BaseAPIClient):

    @allure.step("Create order with {len(items)} items")
    def create_order(self, items: list[dict]) -> httpx.Response:
        return self.client.post("/api/v1/orders", json={"items": items})

    @allure.step("Get order #{order_id} status")
    def get_order_status(self, order_id: int) -> httpx.Response:
        return self.client.get(f"/api/v1/orders/{order_id}/status")

Inline steps (inside test methods)

python
def test_complete_order_flow(self):
    with allure.step("Create a new user"):
        user = self.create_test_user()

    with allure.step("Add items to cart"):
        self.cart_api.add_item(user["id"], product_id=1, quantity=2)

    with allure.step("Place order"):
        response = self.orders_api.create_order(user["id"])
        assert response.status_code == 201
        order_id = response.json()["id"]

    with allure.step("Verify order status is 'pending'"):
        status_resp = self.orders_api.get_order_status(order_id)
        assert status_resp.json()["status"] == "pending"

Attachments

Attach request/response to every API call

python
class HTTPClient:
    def _attach_to_allure(self, response: httpx.Response):
        allure.attach(
            body=str(response.request.url),
            name="Request URL",
            attachment_type=allure.attachment_type.TEXT,
        )
        if response.request.content:
            allure.attach(
                body=response.request.content.decode("utf-8"),
                name="Request Body",
                attachment_type=allure.attachment_type.JSON,
            )
        allure.attach(
            body=response.text,
            name=f"Response [{response.status_code}]",
            attachment_type=allure.attachment_type.JSON,
        )
        allure.attach(
            body=str(dict(response.headers)),
            name="Response Headers",
            attachment_type=allure.attachment_type.JSON,
        )

Attach screenshots (E2E/UI tests)

python
@allure.step("Take screenshot: {name}")
def attach_screenshot(page, name: str):
    screenshot = page.screenshot()
    allure.attach(screenshot, name=name, attachment_type=allure.attachment_type.PNG)

Attach logs on failure

python
@pytest.fixture(autouse=True)
def attach_logs_on_failure(request, caplog):
    yield
    if request.node.rep_call and request.node.rep_call.failed:
        allure.attach(
            body=caplog.text,
            name="Test Logs",
            attachment_type=allure.attachment_type.TEXT,
        )

@pytest.hookimpl(tryfirst=True, hookwrapper=True)
def pytest_runtest_makereport(item, call):
    outcome = yield
    rep = outcome.get_result()
    setattr(item, f"rep_{rep.when}", rep)

Dynamic Allure Metadata

python
class BaseTest:
    @pytest.fixture(autouse=True)
    def _set_allure_metadata(self, request):
        """Auto-set Allure metadata from test class/method."""
        if request.cls:
            allure.dynamic.parent_suite(request.cls.__module__)
            allure.dynamic.suite(request.cls.__name__)
        allure.dynamic.sub_suite(request.node.name)

        # Add environment info
        allure.dynamic.parameter("env", self.settings.ENV_NAME)

Environment Info

python
# conftest.py — generate environment.properties for Allure
import pytest

def pytest_sessionfinish(session, exitstatus):
    """Write environment info for Allure report."""
    allure_dir = session.config.getoption("--alluredir", default=None)
    if allure_dir:
        env_file = Path(allure_dir) / "environment.properties"
        settings = Settings()
        env_file.write_text(
            f"Base.URL={settings.BASE_URL}\n"
            f"Environment={settings.ENV_NAME}\n"
            f"Python={sys.version}\n"
            f"pytest={pytest.__version__}\n"
        )

Categories (defect classification)

json
// allure-results/categories.json
[
  {
    "name": "API Errors",
    "matchedStatuses": ["failed"],
    "messageRegex": ".*assert.*status_code.*"
  },
  {
    "name": "Schema Validation Failures",
    "matchedStatuses": ["failed"],
    "messageRegex": ".*validation error.*|.*ValidationError.*"
  },
  {
    "name": "Infrastructure Issues",
    "matchedStatuses": ["broken"],
    "messageRegex": ".*ConnectionError.*|.*TimeoutError.*"
  },
  {
    "name": "Flaky Tests",
    "matchedStatuses": ["failed"],
    "traceRegex": ".*flaky.*"
  }
]

CI/CD Integration

GitHub Actions

yaml
name: API Tests
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.12'

      - name: Install dependencies
        run: pip install -r requirements-test.txt

      - name: Run tests
        run: pytest --alluredir=allure-results -v -n auto
        env:
          BASE_URL: ${{ secrets.TEST_BASE_URL }}
          TEST_USER_EMAIL: ${{ secrets.TEST_USER_EMAIL }}
          TEST_USER_PASSWORD: ${{ secrets.TEST_USER_PASSWORD }}

      - name: Upload Allure results
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: allure-results
          path: allure-results/

      - name: Allure Report
        if: always()
        uses: simple-elf/allure-report-action@master
        with:
          allure_results: allure-results

      - name: Deploy report to GitHub Pages
        if: always()
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: allure-report

Quick Reference

DecoratorLevelRequired
@allure.epic("...")Test classYes
@allure.feature("...")Test classYes
@allure.story("...")Test methodYes
@allure.severity(...)Test methodYes
@allure.title("...")Test methodRecommended
@allure.step("...")API methodsYes
@allure.tag("...")Test methodOptional
@allure.link("...")Test methodOptional
allure.attach(...)Inside stepsFor API calls
allure.dynamic.*RuntimeFor base classes

Remember: A good Allure report tells a story. Epic -> Feature -> Story -> Steps. Anyone reading the report should understand what was tested, how, and why it failed.

Domande frequenti

Cosa fa la skill IA Allure Reporting?

Allure Report integration with pytest — decorators, steps, attachments, severity levels, test categorization, CI/CD integration, and custom report plugins.

Perché usare Allure Reporting su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Allure Reporting è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Allure Reporting in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/manikosto/claude-code-python-stack/tree/main/skills/allure-reporting. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Allure Reporting?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Allure Reporting?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Allure Reporting: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Allure Reporting è gratuita?

È pubblicata su GitHub da manikosto. Consulta il repository per i termini di licenza. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇