Testing is an important aspect of developing dependencies.io components, since it gives you chance to find issues without needing to run your container on our production infrastructure. Our CLI provides a useful end-to-end testing framework to check that the basic input and output of your container works as expected.
Our CLI provides a helpful
test command to ease the process of making sure a
collector or actor is compatible. You can think of it as an end-to-end (e2e)
test, which will provide a Dependencies.io JSON schema for input and verify that
the output matches what is expected.
This is the best and easiest way to test how your collector or actor will run in production.
dependencies testuses pytest under the hood. Any options you pass will be passed on to pytest. The most used options is
dependencies test -sto show all output.
dependencies test command will do several things for you:
dependencies_tests.ymlfor test instructions
For all of our official collectors and actors, we use Travis CI to run tests on every commit. The basic setup for that might look something like this:
sudo: required services: - docker language: python python: 3.6 cache: pip install: pip install dependencies-cli==0.4.0 script: dependencies test
You are free to write any of your own unit tests against your code as you would
in any other project. They can simply run alongside your