Files
deprecated-helm-charts/test
Vic IglesiasandGitHub 237caa0ea6 Add README to test folder (#2339)
* Add README to test folder

* Kubernetes members can trigger PR tests
2017-09-27 09:50:29 -07:00
..
2017-09-22 10:08:49 +01:00
2017-05-04 12:25:55 -07:00
2017-05-04 12:25:55 -07:00
2016-09-14 13:59:30 -07:00
2017-09-27 09:50:29 -07:00
2017-08-15 12:03:00 -07:00

Charts Testing

Pull Request Testing

Procedure

Pull requests testing is run via the Kuberentes Test Infrastructure.

The configuration of the Pull Request trigger is in the config.json.

This snippet tells Test Infra to run the test/e2e.sh when testing is triggered on a pull request. The e2e.sh script will use the Charts test image to run the test/changed.sh script. This script is the main logic for validation of a pull request. It intends to only test charts that have changed in this PR.

The logic is as follows:

  1. Get credentials for the Kubernetes cluster used for testing.
  2. Install and initialize Helm
  3. For any charts that have changed:
    • Download dependent charts, if any, with helm dep update
    • Run helm lint on the chart
    • Run helm install in a new namespace for this PR+build
    • Use the test/verify-release.sh to ensure that if any pods were launched that they get to the Running state
    • Run helm test on the release
    • Delete the release

Triggering

In order for the tests to be kicked off one of the Kubernetes member must add the "ok-to-test" label. This can also be done by commenting "/ok-to-test" on the pull request.

This check is there to ensure that PRs are spot checked for any nefarious code. There are 2 things to check for:

  1. No changes have been made to file in the test folder that unnecessarily alter the testing procedures.
  2. The chart is not using images whose provenance is not traceable (usually done via the sources metadata field).

Repo syncing

The syncing of charts to the stable and incubator repos happens from a Jenkins instance that is polling for changes to the master branch. On each change it will use the test/repo-sync.sh to update the public repositories. The procedure is as follows:

  1. Setup Helm
  2. Authenticate to Google Cloud so that we can upload to the Cloud Storage bucket that hosts the charts
  3. For the stable and incubator folders:
    • Download the existing index.yaml from the repository
    • Run helm dep update on all the charts in the current repository
    • Run helm package on each chart
    • Recreate the index using helm repo index
    • Upload the repostory using gsutil rsync