GithubHelp home page GithubHelp logo

kryndex / test-infra Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kubernetes/test-infra

0.0 1.0 0.0 35.36 MB

Test infrastructure for the Kubernetes project.

License: Apache License 2.0

Python 21.88% Makefile 1.15% Go 70.63% Shell 1.96% Smarty 0.01% JavaScript 2.46% CSS 0.30% HTML 1.33% Roff 0.29%

test-infra's Introduction

Kubernetes Test Infrastructure

Build Status Go Report Card GoDoc

The test-infra repository contains a collection of tools for testing Kubernetes and displaying Kubernetes tests results. See also CONTRIBUTING.md.

See the architecture diagram for an overview of how the different services interact.

Viewing test results

Automated testing

Test anything with the following pattern:

git clone https://github.com/kubernetes/test-infra
test-infra/jenkins/bootstrap.py --job=J --repo=R --service-account=S.json --upload=gs://B

The --job=J flag specifies what test job to run. The --repo=R (or --bare) flag controls what we check out from git.

Anyone can reconfigure our CI system with a test-infra PR that updates the appropriate files. Detailed instructions follow:

E2E Testing

Our e2e testing uses kubetest to build/deploy/test kubernetes clusters on various providers. Please see those documents for additional details about this tool as well as e2e testing generally.

Create a new job

Create a PR in this repo to add/update/remove a job or suite. Specifically you'll need to do the following:

  • Create an entry in jobs/config.json for the job
    • If this is a kubetest job create the corresponding jobs/env/FOO.env file
    • It will pick a free project from boskos pool by default, or
    • You can also set --gcp-project=foo in jobs/config.json for a dedicated project, make sure the project has the right IAM grants
  • Add the job name to the test_groups list in testgrid/config/config.yaml
    • Also the group to at least one dashboard_tab
  • Add the job to the appropriate section in prow/config.yaml
    • Presubmit jobs run on unmerged code in PRs
    • Postsubmit jobs run after merging code
    • Periodic job run on a timed basis
  • (Deprecated!) Some old jobs still run on jenkins
    • Please do not add new jobs to jenkins
    • Jenkins configuration is defined at jenkins/job-configs
    • More deprecated details at jenkins/README.md

NOTE: kubernetes/kubernetes and kubernetes-security/kubernetes must have matching presubmits.

Please test the job on your local workstation before creating a PR:

mkdir /tmp/whatever && cd /tmp/whatever
$GOPATH/src/k8s.io/test-infra/jenkins/bootstrap.py \
  --job=J \  # aka your new job
  --repo=R1 --repo=R2 \  # what repos to check out
  --service-account ~/S.json  # the service account to use to launch GCE/GKE clusters
# Note: create a service account at the cloud console for the project J uses

Release branch jobs & Image validation jobs

Release branch jobs and image validation jobs are defined in test_config.yaml. We test different master/node image versions against multiple k8s branches on different features.

Those jobs are using channel based versions, current supported testing map is:

  • k8s-dev : master
  • k8s-beta : release-1.9
  • k8s-stable1 : release-1.8
  • k8s-stable2 : release-1.7
  • k8s-stable3 : release-1.6

Our build job will generate a ci/(channel-name) file pointer in gcs.

After you update test_config.yaml, please run

bazel run //experiment:generate_tests -- --yaml-config-path=experiment/test_config.yaml --json-config-path=jobs/config.json  --prow-config-path=prow/config.yaml && bazel run //jobs:config_sort

to regenerate the job configs.

We are moving towards making more jobs to fit into the generated config.

Presubmit will tell you if you forget to do any of this correctly.

Merge your PR and @k8s-ci-robot will deploy your change automatically.

Update an existing job

Largely similar to creating a new job, except you can just modify the existing entries rather than adding new ones.

Update what a job does by editing its definition in jobs/config.json. For the kubetest jobs this typically means editing the jobs/FOO.env files it uses.

Update when a job runs by changing its definition in prow/config.yaml. The test-infra oncall must push prow changes (make -C prow update-config).

Update where the job appears on testgrid by changing testgrid/config/config.yaml.

Delete a job

The reverse of creating a new job: delete the appropriate entries in jobs/config.json, prow/config.yaml and testgrid/config/config.yaml.

Merge your PR and @k8s-ci-robot will deploy your change automatically.

Building and testing the test-infra

We use Bazel to build and test the code in this repo. The commands bazel build //... and bazel test //... should be all you need for most cases. If you modify Go code, run ./hack/update-bazel.sh to keep BUILD files up-to-date.

Contributing Test Results

The Kubernetes project encourages organizations to contribute execution of e2e test jobs for a variety of platforms (e.g., Azure, rktnetes). For information about how to contribute test results, see Contributing Test Results.

Other Docs

test-infra's People

Contributors

0xmichalis avatar apelisse avatar bentheelder avatar caesarxuchao avatar cblecker avatar cjwagner avatar eparis avatar fejta avatar foxish avatar gmarek avatar grodrigues3 avatar ixdy avatar k8s-ci-robot avatar krzyzacy avatar lavalamp avatar madhusudancs avatar mikedanese avatar mtaufen avatar pipejakob avatar random-liu avatar rmmh avatar shyamjvs avatar spiffxp avatar spxtr avatar stevekuznetsov avatar wojtek-t avatar wonderfly avatar xiangpengzhao avatar yguo0905 avatar zmerlynn avatar

Watchers

 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.