The Chainlink Integration Framework is a blockchain development framework written in Go. Its primary purpose is to help chainlink developers create extensive integration, e2e, performance, and chaos tests to ensure the stability of the chainlink project. It can also be helpful to those who just want to use chainlink oracles in their projects to help test their contracts, or even for those that aren't using chainlink.
See the docs or our go reference page for more detailed info and examples. If you just want a quick overview, keep reading.
As of now, this framework is still very much a work in progress, and will have frequent changes, many of which will probably be breaking.
As of Monday, November 22, 2021, there has been a massive overhaul of how the framework works. Namely use of the helmenv library
In order to use this framework, you must have a connection to an actively running Kubernetes cluster. If you don't have one handy, check out minikube which should work fine for smaller tests, but will likely need to be allocated more power, or you'll need to use a more powerful cluster in general to run tests that require lots of services, like OCR.
Here's a simple example on deploying and interacting with a basic storage contract using this framework and Ginkgo, a BDD testing framework we've come to really enjoy. You can use another testing framework, including Go's default testing if you prefer otherwise.
See our suite/smoke directory for quite a few examples of the framework's usage.
If you would like to change the Chainlink values that are used for environments, you can use the framework.yaml
file,
or set environment variables that are all caps versions of the values found in the config file.
# Specify the image and version of the chainlink image you want to run tests against. Leave blank for default.
chainlink_image: # Image of chainlink node
chainlink_version: # Version of the image on the chainlink node
chainlink_env_values: # Environment values to pass onto the chainlink nodes
# Specify the image and version of the simulated geth image you want to run tests against. Leave blank for default.
# Has no effect when running tests on networks other than the simulated geth instances.
geth_image: # Image of the simulated geth to use
geth_version: # Version of the geth image
geth_args: # List of CLI arguments to pass to simulated geth image. WARNING
Values passed into geth_args
will fully REPLACE all existing defaults we use in our launch. This enables freedom from defaults, but you should most definitely look at all the current defaults we usually use and replace them as necessary.