# TestFly Part 3: CI/CD Quality Gates, Parallel Execution & CI Metadata

URL: https://hakangul.lovable.app/blog/testfly-part-3-multi-browser-ci-cd-pipelines-github-actions
Author: Hakan Gül — Team Lead Senior Test Automation Engineer
Published: 2026-08-28
Updated: 2026-08-29
Category: ci-cd
Tags: TestFly, CI/CD, GitHub Actions, Quality Gates, Parallel, DevOps, SDET

> Enforce build quality gates in CI/CD. Discover TestFly's CiEnvironmentDetector, BuildThresholdEnforcer, and parallel execution in GitHub Actions.

## English

## Enterprise CI/CD with TestFly

In modern continuous delivery pipelines, flaky tests and degraded pass rates must not block deployments silently. TestFly features dedicated CI subsystems:

1. **`CiEnvironmentDetector`:** Auto-detects GitHub Actions, Jenkins, GitLab CI, CircleCI, TeamCity, and Bitbucket pipelines.
2. **`BuildThresholdEnforcer`:** Enforces strict quality gates on build completion.
3. **`JUnitXmlReporter`:** Generates machine-readable `TEST-TestFly.xml` for CI dashboard integration.

---

## 1. Configuring CI Quality Gates in `testfly.yml`

```yaml
execution:
  mode: local
  parallel: methods
  threadCount: 4
  maxActiveSessions: 4

ci:
  failOnPassRateBelow: 95.0 # Fails the build if pass rate < 95%
  maxFlakyTests: 2          # Fails if more than 2 tests are flaky
```

If quality thresholds are breached, TestFly throws a `BuildQualityGateException` and exits with a non-zero code.

---

## 2. GitHub Actions Multi-Browser Matrix Workflow

```yaml
name: TestFly E2E Regression

on:
  push:
    branches: [ master, main ]
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        browser: [ chrome, firefox ]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with:
          distribution: 'temurin'
          java-version: '17'
          cache: 'maven'

      - name: Run TestFly Tests
        run: mvn clean test -Dbrowser.name=${{ matrix.browser }} -Dbrowser.headless=true

      - name: Upload TestFly HTML Report
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: testfly-report-${{ matrix.browser }}
          path: target/testfly-report.html
```

## Türkçe

## TestFly ile Kurumsal CI/CD

Sürekli dağıtım (CI/CD) hatlarında kararsız (flaky) testler ve düşen başarı oranları gözden kaçmamalıdır. TestFly dahili CI alt sistemleri barındırır:

1. **`CiEnvironmentDetector`:** GitHub Actions, Jenkins, GitLab, CircleCI, TeamCity ve Bitbucket ortamlarını otomatik tanır.
2. **`BuildThresholdEnforcer`:** Koşum sonunda kalite kapılarını (Quality Gates) denetler.
3. **`JUnitXmlReporter`:** CI entegrasyonu için standart `TEST-TestFly.xml` çıktısı üretir.

---

## 1. `testfly.yml` ile Kalite Kapıları Tanımlama

```yaml
execution:
  mode: local
  parallel: methods
  threadCount: 4
  maxActiveSessions: 4

ci:
  failOnPassRateBelow: 95.0 # Başarı oranı %95'in altına düşerse build'i patlat
  maxFlakyTests: 2          # 2'den fazla flaky test çıkarsa build'i durdur
```

Eşik aşılırsa TestFly `BuildQualityGateException` fırlatarak pipeline'ı güvenle durdurur.

---

## 2. GitHub Actions Matris Pipeline'ı

```yaml
name: TestFly E2E Regression

on:
  push:
    branches: [ master, main ]
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        browser: [ chrome, firefox ]
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-java@v4
        with:
          distribution: 'temurin'
          java-version: '17'
          cache: 'maven'

      - name: TestFly Testlerini Koş
        run: mvn clean test -Dbrowser.name=${{ matrix.browser }} -Dbrowser.headless=true

      - name: HTML Raporunu Yükle
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: testfly-report-${{ matrix.browser }}
          path: target/testfly-report.html
```
