# TestFly Part 3: CI/CD quality gates, parallel execution and 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-10-18
Category: ci-cd
Tags: TestFly, CI/CD, GitHub Actions, Quality Gates, Parallel, DevOps, SDET

> How TestFly enforces build quality gates in CI/CD with CiEnvironmentDetector and BuildThresholdEnforcer, and how to run tests in parallel in GitHub Actions.

## English

## CI support in TestFly

In a continuous delivery pipeline, flaky tests and a falling pass rate should never go by unnoticed. TestFly has three components for CI:

- `CiEnvironmentDetector` detects GitHub Actions, Jenkins, GitLab CI, CircleCI, TeamCity and Bitbucket pipelines.
- `BuildThresholdEnforcer` checks quality gates when the build finishes.
- `JUnitXmlReporter` writes a machine-readable `TEST-TestFly.xml` that CI dashboards can pick up.

## 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 a run breaks one of these thresholds, TestFly throws a `BuildQualityGateException` and exits with a non-zero code.

## Multi-browser matrix in GitHub Actions

This workflow runs the suite headless on Chrome and Firefox and uploads the HTML report for each browser, even when tests fail.

```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'da CI desteği

CI/CD hattında flaky testlerin artması ya da başarı oranının düşmesi gözden kaçmamalı. TestFly bunun için üç bileşenle geliyor:

- `CiEnvironmentDetector`, GitHub Actions, Jenkins, GitLab, CircleCI, TeamCity ve Bitbucket ortamlarını otomatik olarak tanıyor.
- `BuildThresholdEnforcer`, koşum bittiğinde kalite kapılarını (quality gates) kontrol ediyor.
- `JUnitXmlReporter`, CI entegrasyonu için standart bir `TEST-TestFly.xml` çıktısı üretiyor.

## `testfly.yml` ile kalite kapıları

```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şiklerden biri aşılırsa TestFly `BuildQualityGateException` fırlatıp pipeline'ı durduruyor.

## GitHub Actions matris pipeline'ı

Aşağıdaki workflow testleri Chrome ve Firefox üzerinde headless modda koşuyor. Testler başarısız olsa bile her tarayıcının HTML raporu artifact olarak yükleniyor.

```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
```
