The data templating language


Jsonnet comes with over 600 tests (and growing) that exercise various corner cases of the language. These should be very useful for anyone porting Jsonnet to e.g. Java.

The full corpus of tests can be invoked via 'make test'.

Unit tests: In the test_suite directory are a large number of unit tests that each exercise the interaction of a few features of the Jsonnet language. If adding a standard library function, a test should be added here. Also any fixed bugs should have a test added so that other implementations of Jsonnet can avoid the same mistake.

Website examples: All the examples on the website are tested the ensure that the output advertised in the website page is actually correct. The code is found in the examples directory.

Bindings: There are a couple of simple tests for the C and Python APIs which are run as part of 'make test'.

Benchmarks: There are a few simple benchmarks in the benchmarks directory. These are not executed by 'make test' because they take a while to run.

Continuous Integration

Jsonnet is set up to use Travis for continuous integration testing. This currently runs the full test suite (via make test) on gcc and clang compilers, but only Linux is currently available. The tests run every commit and are posted to the IRC channel.

To avoid embarrassment, always run 'make test' on your dev machine before submitting a pull request. :)