Skip to main content
AI
  • Get started with AI

    • Red Hat AI

      Accelerate the development and deployment of enterprise AI solutions.

    • AI learning hub

      Explore learning materials and tools, organized by task.

    • AI interactive demos

      Click through scenarios with Red Hat AI, including training LLMs and more.

    • AI/ML learning paths

      Expand your Red Hat OpenShift AI knowledge using these learning resources.

    • AI quickstarts

      Focused AI use cases designed for fast deployment on Red Hat AI platforms.

    • No-cost AI training

      Foundational Red Hat AI training.

  • Featured resources

    • Red Hat OpenShift AI
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

Red Hat AI Factory with NVIDIA

Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.

Learn
  • Self-guided

    • Documentation

      Find answers, get step-by-step guidance, and learn how to use Red Hat products.

    • Learning paths

      Explore curated walkthroughs for common development tasks.

    • Guided learning

      Receive custom learning paths powered by our AI assistant.

    • See all learning
  • Hands-on

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

    • Interactive labs

      Learn by doing in these hands-on, browser-based experiences.

    • Interactive demos

      Click through product features in these guided tours.

  • Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics
  • Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
Build
  • Get started

    • Red Hat build of Podman Desktop

      A downloadable, local development hub to experiment with our products and builds.

    • Developer Sandbox

      Spin up Red Hat's products and technologies without setup or configuration.

  • Download products

    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products
  • Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset
  • References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
Community
  • Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions
  • Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github
  • Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

Join the Red Hat Developer program

Download Red Hat products and project builds, access support documentation, learning content, and more.

ConsoleDocsSupport Search
New For you

Recommended

We'll recommend resources you may like as you browse. Try these suggestions for now.

  • Product downloads
  • Cheat sheets
  • Red Hat Developer learning portal
  • Developer blog
  • E-books
  • Developer Sandbox
Log in

Get more with a Red Hat Developer account

  • Product downloads
  • Console access
  • Event registration
  • Training & trials
Explore more account benefitsLog in or register

A subscription may be required for some services.

Contact us

How Testing Farm makes testing your upstream project easier

August 17, 2023
David Kornel Jakub Stejskal
Related topics:
CI/CDGitOpsJavaKubernetesOpen source
Related products:
Red Hat OpenShiftRed Hat Enterprise Linux

    Although continuous integration is widely used in public projects, it has many limitations such as the size of resources or execution time. For instance, when you use GitHub actions free tier, you are limited to agents with 2 cpu and 7 GB of memory and total execution time of 2000 minutes per month. Other CI providers, like Azure Pipelines or Travis CI, have similar limitations. Continuous integration systems are popular, but free tier is not enough for some use cases. Fortunately, there is the Testing Farm for community projects maintained or co-maintained by Red Hat or Fedora/CentOS projects. 

    In this article, we will focus on how to use Testing Farm for projects with written and managed tests in different testing frameworks like JUnit. 

    What is Testing Farm?

    Testing Farm is an open-source testing system offered as a service. You can use Testing Farm in various ways such as:

    • Run tests using the CLI from your local machine to create a testing machine.
    • Integrate it into the project as a CI check via GitHub Actions or Packit.
    • Send HTTP requests to the service API with desired requirements.

    The tests are defined via tmt, a test management tool that allows users to manage and execute tests on different environments. For more details about how Fedora manages the testing via tmt check out the Fedora CI documentation.

    Strimzi e2e tests

    As a reference project, we use strimzi-kafka-operator and test suite. The test suite is written in Java and uses the Junit5 test framework. As an execution environment, it requires a Kubernetes platform such as Red Hat OpenShift, Minikube, EKS, or similar. Due to these requirements, it is not easy to run the tests with the full potential of parallel tests execution on Azure (used as the main CI tool in Strimzi organization).

    How to onboard

    As the first step, you need access to the Testing Farm API. You should follow the onboarding guide, part of the official documentation.

    Get the secret

    This secret is specific to the user and used for authentication and authorization to the service.

    Add tmt to your project

    Even if users don't use tmt for test case management, there are several parts to implement in the project to make Testing Farm understand your needs.

    You have to mark the root folder in your project with the .fmf directory, this can be done by using the tmt init command. For more details, check our configuration in the Strimzi repository.

    Create a test plan

    The plan for Testing Farm contains a test plan definition. This definition is composed of hardware requirements, preparation steps for creating a VM executor, and specific plans. The specific plan defines selectors for tests that should be executed. As part of preparation steps, we also spin-up the Minikube cluster and build and push Strimzi container images used during testing. On the bottom of the file, we specify specific test plan names and configuration for executions of specific tests defined later in this article.

    The following is an example of our plan:

    # TMT test plan definition
    # https://tmt.readthedocs.io/en/latest/overview.html
    
    # Baseline common for all test plans
    #######################################################################
    summary: Strimzi test suite
    discover:
      how: fmf
    
    # Required HW
    provision:
      hardware:
        memory: ">= 24 GiB"
        cpu:
          processors: ">= 8"
    
    # Install required packages and scripts for running strimzi suite
    prepare:
      - name: Install packages
        how: install
        package:
          - wget
          - java-17-openjdk-devel
          - xz
          - make
          - git
          - zip
          - coreutils
    
    ... ommited
    
      - name: Build strimzi images
        how: shell
        script: |
          # build images
          eval $(minikube docker-env)
          ARCH=$(uname -m)
          if [[ ${ARCH} == "aarch64" ]]; then
            export DOCKER_BUILD_ARGS="--platform linux/arm64 --build-arg TARGETPLATFORM=linux/arm64"
          fi
          export MVN_ARGS="-B -DskipTests -Dmaven.javadoc.skip=true --no-transfer-progress"
          export DOCKER_REGISTRY="localhost:5000"
          export DOCKER_ORG="strimzi"
          export DOCKER_TAG="test"
          
          make java_install
          make docker_build
          make docker_tag
          make docker_push
    
    # Discover tmt defined tests in tests/ folder
    execute:
      how: tmt
    
    # Post install step to copy logs
    finish:
      how: shell
      script:./systemtest/tmt/scripts/copy-logs.sh
    #######################################################################
    
    /smoke:
      summary: Run smoke strimzi test suite
      discover+:
        test:
          - smoke
    
    /regression-operators:
      summary: Run regression strimzi test suite
      discover+:
        test:
          - regression-operators
    
    /regression-components:
      summary: Run regression strimzi test suite
      discover+:
        test:
          - regression-components
    
    /kraft-operators:
      summary: Run regression kraft strimzi test suite
      discover+:
        test:
          - kraft-operators
    
    /kraft-components:
      summary: Run regression kraft strimzi test suite
      discover+:
        test:
          - kraft-components
    
    /upgrade:
      summary: Run upgrade strimzi test suite
      provision:
        hardware:
          memory: ">= 8 GiB"
          cpu:
            processors: ">= 4"
      discover+:
        test:
          - upgrade
    
    

    To see the full version, refer to our repository.

    How to execute tests

    To execute tests, we create a simple shell script which calls the maven command to execute the Strimzi test suite. We also define metadata for tests which specify environment variables for test suites and other configurations like timeout.

    In this test metadata example, you can see that we specify default env variables and configuration and specific tests override this configuration.

    test:
     ./test.sh
    duration: 2h
    environment:
      DOCKER_ORG: "strimzi"
      DOCKER_TAG: "test"
      TEST_LOG_DIR: "systemtest/target/logs"
      TESTS: ""
      TEST_GROUPS: ""
      EXCLUDED_TEST_GROUPS: "loadbalancer"
      CLUSTER_OPERATOR_INSTALLTYPE: bundle
    adjust:
      - environment+:
          EXCLUDED_TEST_GROUPS: "loadbalancer,arm64unsupported"
        when: arch == aarch64, arm64
    
    /smoke:
      summary: Run smoke strimzi test suite
      tag: [smoke]
      duration: 20m
      tier: 1
      environment+:
        TEST_PROFILE: smoke
    
    /upgrade:
      summary: Run upgrade strimzi test suite
      tag: [strimzi, kafka, upgrade]
      duration: 5h
      tier: 2
      environment+:
        TEST_PROFILE: upgrade
    
    /regression-operators:
      summary: Run regression strimzi test suite
      tag: [strimzi, kafka, regression, operators]
      duration: 10h
      tier: 2
      environment+:
        TEST_PROFILE: operators
    
    /regression-components:
      summary: Run regression strimzi test suite
      tag: [strimzi, kafka, regression, components]
      duration: 12h
      tier: 2
      environment+:
        TEST_PROFILE: components
    
    /kraft-operators:
      summary: Run regression kraft strimzi test suite
      tag: [strimzi, kafka, kraft, operators]
      duration: 8h
      tier: 2
      environment+:
        TEST_PROFILE: operators
        STRIMZI_FEATURE_GATES: "+UseKRaft,+StableConnectIdentities"
    
    /kraft-components:
      summary: Run regression kraft strimzi test suite
      tag: [strimzi, kafka, kraft, components]
      duration: 8h
      tier: 2
      environment+:
        TEST_PROFILE: components
        STRIMZI_FEATURE_GATES: "+UseKRaft,+StableConnectIdentities"
    
    

    Run Testing Farm from the command line

    Finally, we can try our changes via cmd. We need to install the Testing Farm CLI tool and API token. To install the Testing Farm CLI, follow this guide.

    For example, we can run a smoke test on fedora-38 with both architectures  (x86_64 and aarch64) with one command:

    $ testing-farm request --compose Fedora-38 --git-url https://github.com/strimzi/strimzi-kafka-operator.git --git-ref main --arch x86_64,aarch64  --plan smoke
    
    📦 repository https://github.com/strimzi/strimzi-kafka-operator.git ref main test-type fmf
    💻 Fedora-38 on x86_64
    💻 Fedora-38 on aarch64
    🔎 api https://api.dev.testing-farm.io/v0.1/requests/*******-40ba-8a45-3c1fbe3da73a
    💡 waiting for request to finish, use ctrl+c to skip
    👶 request is waiting to be queued
    👷 request is queued
    🚀 request is running
    🚢 artifacts https://artifacts.dev.testing-farm.io/*******-40ba-8a45-3c1fbe3da73a
    

    When the test run is completed, we can see the results in the web UI, as shown in Figure 1.

    Testing farm web UI
    Figure 1: The testing farm job results in the UI.

    How Packit service simplifies integration

    Testing Farm deals with resource problems, but we still need to deal with execution time limits. In Strimzi, our full regression takes around 20 hours, which is insane to run on GitHub Actions, and it is quite complicated to run it on Azure Pipelines. Here is where Packit service comes in.

    Packit is an open-source project that eases the integration of your project with Fedora Linux, CentOS Stream, and other distributions. Packit is mostly used by projects that build RPM packages. However, it can be easily used only for triggering tests on Testing Farm.

    To use Packit service, users should follow the onboarding guide. We are using Packit on GitHub to install the application and grant access to our organization.

    After finishing the onboarding, users can create a configuration file for Packit in the repository. Because we want to only run tests, we use jobs: tests, but you can use different kinds of jobs and triggers. To see the full options for Packit, we suggest checking the documentation or the article, How to set up Packit to simplify upstream project integration.

    The following is an example of our configuration file:

    # Default packit instance is a prod and only this is used
    # stg instance is present for testing new packit features in forked repositories where stg is installed.
    packit_instances: ["prod", "stg"]
    upstream_project_url: https://github.com/strimzi/strimzi-kafka-operator
    issue_repository: https://github.com/strimzi/strimzi-kafka-operator
    jobs:
      - job: tests
        trigger: pull_request
        # Suffix for job name
        identifier: "upgrade"
        targets:
          # This target is not used at all by our tests, but it has to be one of the available - https://packit.dev/docs/configuration/#aliases
          - centos-stream-9-x86_64
          - centos-stream-9-aarch64
        # We don't need to build any packages for Fedora/RHEL/CentOS, it is not related to Strimzi tests
        skip_build: true
        manual_trigger: true
        labels:
          - upgrade
        tf_extra_params:
          test:
            fmf:
              name: upgrade
      #######################################################################
    
      - job: tests
        trigger: pull_request
        # Suffix for job name
        identifier: "regression-operators"
        targets:
          # This target is not used at all by our tests, but it has to be one of the available - https://packit.dev/docs/configuration/#aliases
          - centos-stream-9-x86_64
          - centos-stream-9-aarch64
        # We don't need to build any packages for Fedora/RHEL/CentOS, it is not related to Strimzi tests
        skip_build: true
        manual_trigger: true
        labels:
          - regression
          - operators
          - regression-operators
          - ro
        tf_extra_params:
          test:
            fmf:
              name: regression-operators
    .. ommited
    
    

    The full .packit.yaml file is available on Strimzi GitHub.

    If you successfully onboard to the Packit service, you will see the triggered check in the GitHub pull request, as shown in Figure 2.

    Trigger packit from github web UI
    Figure 2: An illustration of the triggered testing farm jobs.

    Testing Farm simplifies your upstream project

    In this article, you've learned how to set up and use Testing Farm with Packit. These two services makes building and testing your upstream project easy. Now you can on-board and use it.

    Last updated: September 19, 2023

    Related Posts

    • Schedule tests the GitOps way with Testing Farm as GitHub Action

    • Test GitHub projects with GitHub Actions and Testing Farm

    • Testing in production: From DevTestOops to DevTestOps

    • Leveraging Kubernetes and OpenShift for automated performance tests (part 1)

    Recent Posts

    • A day in the life of an NVIDIA H100 on Red Hat OpenShift 5

    • Migrate BuildConfigs to builds for Red Hat OpenShift with one plug-in install

    • Run Red Hat Enterprise Linux CoreOS on NVIDIA BlueField DPUs

    • Agent harness engineering: Separating model capabilities from enforcement

    • What's new for developers in Red Hat Enterprise Linux 10.3 and 9.9

    What’s up next?

    GitOps has become a standard in deploying applications to Kubernetes, and many companies are adopting the methodology for their DevOps and cloud-native strategy. Download the GitOps Cookbook for useful recipes and examples for successful hands-on applications development and deployment with GitOps.

    Download the GitOps Cookbook
    Red Hat Developers logo

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    Red Hat Developer

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI