Skip to content

Latest commit

 

History

History
82 lines (63 loc) · 5.83 KB

CONTRIBUTING.md

File metadata and controls

82 lines (63 loc) · 5.83 KB

Contributing to CFCR

As a potential contributor, your changes and ideas are always welcome. Please do not hesitate to ask a question using GitHub issues or send a pull request to contribute changes.

Contributor License Agreement

If you have not previously done so, please fill out and submit an Individual Contributor License Agreement or a Corporate Contributor License Agreement.

Contributor Workflow

We encourage contributors to have discussion around design and implmentation with team members before making significant changes to the project through GitHub Issues. The product manager will prioritize where the feature will fit into the project's road map.

  1. Fork the project on GitHub
  2. Make your feature addition or bug fix. Please make sure there is appropriate test coverage.
  3. Run tests.
  4. Make sure your fork is up to date with develop.
  5. Send a pull request for the develop branch.
  6. The team will triage the pull request and prioritise it in the team's backlog of ongoing work.
  7. A team member will approve the pull request or make suggestions for changes.

Writing the tests

Unit test coverage

Unit tests code are collocated in the same package with source code.

If the changes are for BOSH templating logic then please consider adding unit tests to BOSH templating tests.

Running the Tests

Pre-requisites

  1. Install Go
  2. Install Ginkgo
  3. Install Ruby
  4. Install Bundler: gem install bundler

Running Kubo-Release Unit Tests

Execute command ./scripts/run_tests to run unit tests for kubo-release. These includes tests for the BOSH templating tests. Please run these tests before submitting a pull request.

Integration tests

Integration tests are located in kubo-ci.

  1. Install Go
  2. Install Ginkgo
  3. Have a kubeconfig to your running CFCR cluster saved at ~/.kube/config, or set export KUBECONFIG=/path/to/your/kubeconfig
  4. Clone the kubo-ci repository
  5. Run
GOPATH="./kubo-ci" ginkgo -keepGoing -r -progress -flakeAttempts=2 -skipPackage "${skipped_packages}" "./kubo-ci/src/tests/integration-tests/"

Where ${skipped_packages} is a comma-delimited string of zero, one or more of:

  • multiaz
  • persistent_volume
  • k8s_lbs
  • cidrs
  • addons

Some tests will require additional ops-files to be applied when deploying your cluster. We’d recommend reading the Continuous Integration configuration files and the integration test source code.

KDRATs tests

KDRATs (kubo-disaster-recovery-acceptance-tests) test disaster recovery of CFCR using BOSH backup and restore (BBR). Follow these instructions from the kubo-disaster-recovery-acceptance-tests repository.

Turbulence Tests

Turbulence tests are tests that introduce failure scenarios via the turbulence release to verify resilience.

  1. Clone the kubo-ci repository
  2. Your BOSH director must be deployed with turbulence.
  3. Please use the turbulence ops-file, and the CFCR ops-file which applies a development version of turbulence. This is unfortunately required until this bug is resolved.
  4. Upload the turbulence runtime config to your director, and name it turbulence. More details can be found in this CI script. This ensures a turbulence client is deployed on your CFCR cluster VMs.
  5. Deploy CFCR
  6. Have a kubeconfig to your running CFCR cluster saved at ~/.kube/config, or set export KUBECONFIG=/path/to/your/kubeconfig
  7. Create a json test config file. Refer to the turbulence test script for further hints.
  8. Run CONFIG="/path/to/testconfig" ginkgo -failFast -progress -r "./kubo-ci/src/tests/turbulence-tests/"

Upgrade Tests

Upgrade tests determine whether BOSH can automatically upgrade from the previous released version of CFCR to the latest version.

  1. Clone the kubo-ci repository
  2. Deploy CFCR with the previously released version of CFCR
  3. Create a bash script containing the bosh deploy -n instructions you just used to deploy CFCR
  4. Upload the latest release to the BOSH director
  5. Create a json testconfig file with IaaS, BOSH, and upgrade flags
  6. Run BOSH_DEPLOY_COMMAND="path/to/your/bosh-deploy-script.sh" CONFIG="/path/to/your/testconfig" ginkgo -r -v -progress "./kubo-ci/src/tests/upgrade-tests/"