# TestFly Part 8: Flakiness Quarantine Engine & Java SPI Extensibility

URL: https://hakangul.lovable.app/blog/testfly-part-8-enterprise-observability-allure-reportportal-testrail
Author: Hakan Gül — Team Lead Senior Test Automation Engineer
Published: 2026-08-28
Updated: 2026-08-29
Category: devops
Tags: TestFly, Quarantine, Flakiness, SPI, ReportAdapter, ExecutionHook, DevOps, SDET

> Master TestFly's quarantine engine (testfly-quarantine.yml), flakiness scoring, and Java SPI extension points for custom drivers, report adapters, and lifecycle hooks.

## English

## Quarantine Engine & Java SPI Extensibility

The final pillar of TestFly is designed for long-term maintainability: **Flakiness Quarantine** and **Java SPI Extensibility**.

---

## 1. Flakiness Quarantine Engine (`testfly-quarantine.yml`)

Instead of deleting or commenting out flaky tests, quarantine them cleanly without blocking CI pipelines:

```yaml
# testfly-quarantine.yml (Project Root)
quarantine:
  enabled: true
  tests:
    - className: io.testfly.examples.PaymentTest
      methodName: testStripeWebhook
      reason: "Waiting for third-party webhook fix (JIRA-4021)"
      owner: "@payment-team"
```

Quarantined tests are executed in CI, but their failures are flagged as **QUARANTINED** rather than failing the build.

---

## 2. Java SPI Extension Points

Extend TestFly without forking or modifying framework internals:

| Extension Point | Interface | Registration |
| :--- | :--- | :--- |
| **Custom Driver Provider** | `NamedDriverProvider` | `DriverProviderRegistry.register()` or `META-INF/services` |
| **Report Adapter** | `ReportAdapter` | `ReportAdapterRegistry.register()` or SPI |
| **Lifecycle Hook** | `ExecutionHook` | `HookRegistry.register()` or SPI |
| **Full Plugin** | `TestFlyPlugin` | `PluginRegistry.register()` or SPI |

### Example: Custom Slack Report Adapter
```java
package io.testfly.examples.plugins;

import io.testfly.reporting.ReportAdapter;
import io.testfly.metrics.ExecutionMetrics;

public class SlackReportAdapter implements ReportAdapter {

    @Override
    public String getName() {
        return "slack";
    }

    @Override
    public void onSuiteFinish(ExecutionMetrics metrics) {
        // Send Slack webhook with pass rate and failed test summaries
    }
}
```

---

## Summary of the TestFly Masterclass

Across all 8 parts, we explored:
1. **Part 1:** Zero-boilerplate setup with `BaseTest` and `testfly.yml`
2. **Part 2:** Semantic locators (`getByRole`), `BasePage`, and `WaitEngine`
3. **Part 3:** CI/CD quality gates (`BuildThresholdEnforcer`) and parallel execution
4. **Part 4:** AI test generation and self-healing with `testfly-mcp`
5. **Part 5:** BDD with Cucumber 7, `BaseCucumberSteps`, and `@retryable`
6. **Part 6:** Built-in `ApiClient`, `BaseApiTest`, and hybrid workflows
7. **Part 7:** Bundled axe-core accessibility (`accessibility()`) and `VisualAssert`
8. **Part 8:** Flakiness quarantine engine and Java SPI extensibility

👉 **[Explore TestFly on GitHub](https://github.com/hakanngul/testfly)** and build reliable test suites today!

## Türkçe

## Karantina Motoru ve Java SPI Eklenti Mimarisi

TestFly'ın kurumsal sürdürülebilirlik sağlayan son iki temel gücü: **Flakiness Karantina Motoru** ve **Java SPI Eklenti Altyapısı**.

---

## 1. Karantina Motoru (`testfly-quarantine.yml`)

Flaky testleri silmek veya `@Ignore` ile kapatmak yerine, CI akışını engellemeden karantinaya alın:

```yaml
# testfly-quarantine.yml (Proje Kök Dizini)
quarantine:
  enabled: true
  tests:
    - className: io.testfly.examples.PaymentTest
      methodName: testStripeWebhook
      reason: "Üçüncü parti webhook düzeltmesi bekleniyor (JIRA-4021)"
      owner: "@odeme-takimi"
```

Karantinadaki testler CI üzerinde koşulur ancak patladığında build'i kırmak yerine raporda **QUARANTINED** olarak işaretlenir.

---

## 2. Java SPI Eklenti Noktaları

TestFly'ı çatallamadan (fork) SPI ile genişletin:

| Eklenti | Arayüz | Kayıt Yöntemi |
| :--- | :--- | :--- |
| **Özel Driver Sağlayıcı** | `NamedDriverProvider` | `DriverProviderRegistry.register()` veya SPI |
| **Rapor Adaptörü** | `ReportAdapter` | `ReportAdapterRegistry.register()` veya SPI |
| **Yaşam Döngüsü Hook** | `ExecutionHook` | `HookRegistry.register()` veya SPI |
| **Tam Eklenti** | `TestFlyPlugin` | `PluginRegistry.register()` veya SPI |

### Örnek: Özel Slack Rapor Adaptörü
```java
package io.testfly.examples.plugins;

import io.testfly.reporting.ReportAdapter;
import io.testfly.metrics.ExecutionMetrics;

public class SlackReportAdapter implements ReportAdapter {

    @Override
    public String getName() {
        return "slack";
    }

    @Override
    public void onSuiteFinish(ExecutionMetrics metrics) {
        // Slack webhook'una başarı oranı ve hata özetini gönder
    }
}
```

---

## 8 Bölümlük TestFly Masterclass Özeti

Tüm seri boyunca şunları inceledik:
1. **Bölüm 1:** `BaseTest` ve `testfly.yml` ile sıfır şablon kodlu kurulum
2. **Bölüm 2:** Semantik seçiciler (`getByRole`), `BasePage` ve `WaitEngine`
3. **Bölüm 3:** CI/CD kalite kapıları (`BuildThresholdEnforcer`) ve paralel koşum
4. **Bölüm 4:** `testfly-mcp` ile yapay zeka test üretimi ve self-healing
5. **Bölüm 5:** Cucumber 7 BDD, `BaseCucumberSteps` ve `@retryable`
6. **Bölüm 6:** Dahili `ApiClient`, `BaseApiTest` ve hibrit UI+API akışları
7. **Bölüm 7:** Dahili axe-core erişilebilirlik (`accessibility()`) ve `VisualAssert`
8. **Bölüm 8:** Flakiness karantina motoru ve Java SPI eklenti mimarisi

👉 **[TestFly GitHub Deposu](https://github.com/hakanngul/testfly)**
