Giter Site home page Giter Site logo

bonfire-tekton's Introduction

Insights Integration Test in Tekton for Konflux

This repository has a Tekton pipeline, and its tasks, made based on the way the tests are currently done with Clowder and Bonfire with the purpose of integrating them with Konflux.

For more information about how tests are currently handled, see this repo.

How to use

Prerequisites

  • Access to Konflux. Join the wailist here and ask for access in the #konflux-users slack channel.
  • Application in Konflux already created. You can follow the instructions in the Konflux docs. Access Konflux here.

IMPORTANT: The name of the Konflux Component must be the same name of the COMPONENT_NAME parameter in the Integration Test Scenario below.

  • Kustomize installed in your computer. Follow the instalations intructions.

Add the Integration Test Scenario to your application

To add the Integration Test Scenario to Konflux, you need to follow these next steps:

  1. Clone the konflux-release-data repo
  2. In case there is still not a directory for your tenant in the repo you just forked, you will need to create one under the directory tenants-config/cluster/<your-cluster>/tenants/<your-workspace-name>-tenant.

NOTE: The Konflux workspace is where you are deploying your applications on Konflux. It can be found in the Konflux UI, on the top left corner of the Applications page, just next to the WS letters. If you don't know, which cluster you should use, visit this link.

  1. Create your Integration Test Scenario in that directory, name it <your-konflux-application-name>-bonfire-tekton.yaml. You will need to use the same values you are currently using in your pr_check.sh. Remove the lines of the ones that you want to keep the default value. Remove parameters which are not in use (remove both: name and value). Use the following template for that:
apiVersion: appstudio.redhat.com/v1beta1
kind: IntegrationTestScenario
metadata:
  labels:
    test.appstudio.openshift.io/optional: "false" # Change to "true" if you don't need the test to be mandatory
  name: <name-of-your-konflux-application>-bonfire-tekton
  namespace: <your-workspace-name>-tenant
spec:
  application: <name-of-your-konflux-application>
  resolverRef:
    params:
    - name: url
      value: https://github.com/RedHatInsights/bonfire-tekton.git
    - name: revision
      value: main # Or whatever branch you want to test
    - name: pathInRepo
      value: pipelines/basic.yaml # This is the path to the pipeline
    resolver: git
  params:
    - name: APP_NAME
      value: # Name of app-sre "application" folder this component lives in.
    - name: COMPONENTS
      value: # Space-separated list of components to load.
    - name: COMPONENTS_W_RESOURCES
      value: # List of components to keep.
    - name: BONFIRE_COMPONENT_NAME
      value: # Name of app-sre "resourceTemplate" in deploy.yaml for this component. If it is the same as the name in Konflux, you don't need to fill this  
    - name: COMPONENT_NAME
      value: # Name of your component name in Konflux
    - name: IQE_PLUGINS
      value: # Name of the IQE plugin for this app.
    - name: IQE_MARKER_EXPRESSION
      value: # This is the value passed to pytest -m. Default is ""
    - name: IQE_FILTER_EXPRESSION
      value: # This is the value passed to pytest -k. Default is "" when no filter desired
    - name: IQE_REQUIREMENTS
      value: # "something,something_else" -- iqe requirements filter. Default is "" when no filter desired
    - name: IQE_REQUIREMENTS_PRIORITY
      value: # "something,something_else" -- iqe requirements priority filter. Default is "" when no filter desired
    - name: IQE_TEST_IMPORTANCE
      value: # "something,something_else" -- iqe test importance filter. Default is "" when no filter desired
    - name: IQE_CJI_TIMEOUT
      value: # Timeout value to pass to 'oc wait', should be slightly higher than expected test run time. Default is 30m
    - name: IQE_ENV
      value: # "something" -- value to set for ENV_FOR_DYNACONF. Default is "clowder_smoke"
    - name: IQE_SELENIUM
      value: # Whether to run IQE pod with a selenium container. Default is "false"
    - name: IQE_PARALLEL_ENABLED
      value: # Whether to run IQE in parallel mode. Default is "false"
    - name: IQE_PARALLEL_WORKER_COUNT
      value: # The number of parallel workers to use. Default is "".
    - name: IQE_RP_ARGS
      value: # Arguments to send to reportportal. Default is "".
    - name: IQE_IBUTSU_SOURCE
      value: # Ibutsu source for the current run. Default is "".

NOTE: You can fork the pipeline from https://github.com/RedHatInsigths/bonfire-tekton in order to customize it. In case you do it, you will need to change the url field in the IntegrationTestScenario.

  1. Add the following kustomization.yaml file in the same directory:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - <your-konflux-application-name>-bonfire-tekton.yaml
  - ../../../../lib/consoledot-test-pipeline
namespace: <your-workspace-name>-tenant
  1. Run the build-manifests.sh. This is script is using Kustomize to generate the Integration Test Scenario and secrets you will need to run the pipeline in the cluster. Check that the auto-generated directory is updated with these files.
  2. Commit your directory and the auto-generated directory.
  3. Create a PR from your fork, and ask for approval in the #konflux-users Slack channel.

After the approval and merge of the PR, your integration test should be available in the "Integration tests" tab of your application in your Konflux workspace. Remember that to be able of running it, you will need to trigger a new build by making a change on your repository and creating a PR.

Customizing the pipeline

If you need to add new tasks in between the ones already in the pipeline, remove or edit the ones already there, you will need to customize the pipeline itself. For that, the first step is to fork this repository.

After that, you can add all the tasks you want on the tasks directory and create a new pipeline on the pipelines directory. We are using Tekton, so for more information on how to create tasks or pipelines, follow their documentation.

To use the pipeline, you can follow the same steps in the How to use heading. Just make sure to change the references to the pipeline inside the .spec.resolverRef to yours.

bonfire-tekton's People

Contributors

gbenhaim avatar ernesgonzalez33 avatar dscervantes avatar akhil-jha avatar victoremepunto avatar shakedaviv50313 avatar awood avatar bsquizz avatar fhlavac avatar gburges avatar mayurilahane avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.