Travis CI
Travis is set to run one every push to a branch or PR. The results of the builds can be found here for branches and here for PRs.
Test Workflow
In Travis CI, 4 jobs are run to test the sdk:
Before Install for Go, Ansible, and Helm
For the Go, Ansible, and Helm tests, the before_install
and install
stages are the same:
- Check if non documentation files have been updated.
- If only documentation has been updated, skip these tests.
- Run
make tidy
to ensurego.mod
andgo.sum
are up-to-date. - Build and install the sdk using
make install
. - Install ansible using
sudo pip install ansible
. - Run the
hack/ci/setup-k8s.sh
script, which spins up a kind Kubernetes cluster of a particular version by configuring docker, and downloads thekubectl
of the same version.
The Go, Ansible, and Helm tests then differ in what tests they run.
Go Tests
- Run some basic sanity checks.
- Run
go vet
. - Check that all source files have a license.
- Check that all error messages start with a lower case alphabetical character and do not end with punctuation, and log messages start with an upper case alphabetical character.
- Make sure the repo is in a clean state (this is particularly useful for making sure
go.mod
andgo.sum
are up-to-date after runningmake tidy
).
- Run
- Run unit tests.
- Run
make test-unit
.
- Run
- Run go e2e tests.
- Run
make test-e2e-go
.
- Run
Ansible tests
- Run ansible molecule tests. (
make test-e2e-ansible-molecule
)- Create and configure a new ansible type memcached-operator.
- Create cluster resources.
- Change directory to
test/ansible
and runmolecule test -s local
NOTE: All created resources, including the namespace, are deleted using a bash trap when the test finishes
Helm Tests
- Run helm e2e tests.
- Build base helm operator image.
- Create and configure a new helm type nginx-operator.
- Create cluster resources.
- Wait for operator to be ready.
- Create nginx CR and wait for it to be ready.
- Scale up the dependent deployment and verify the operator reconciles it back down.
- Scale up the CR and verify the dependent deployment scales up accordingly.
- Delete nginx CR and verify that finalizer (which writes a message in the operator logs) ran.
NOTE: All created resources, including the namespace, are deleted using a bash trap when the test finishes
Last modified September 16, 2020: [1.0.x] Fix broken links (#3893) (cfabe8d6)
当前内容版权归 operatorframework 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 operatorframework .