Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 2.19 KB

CONTRIBUTING.md

File metadata and controls

44 lines (34 loc) · 2.19 KB

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Contributor Guide

Please remember to update the CHANGELOG and add appropriate tests.

Adding a unit test

To add a unit test for a function new_function() in app/src/foo/bar.h:

  • Create the file app/unit-tests/foo/bar_test.cpp if it doesn't exist and add it to app/CMakeLists.txt in the unit_tests' add_executable e.g.: add_executable( unit_tests <files...> <...> -> unit-tests/foo/bar_test.cpp )
  • In app/unit-tests/foo/bar_test.cpp create TEST()s using the GoogleTest framework.
  • To test the new unit test(s) run:
    ./build.sh
    ./run_unit_tests.sh
    

Adding a functional test

Most likely you can extend an existing test/test_*.py test. Otherwise create a new test file matching test/test_*.py and it will be run by ./run_functional_tests.sh against a CCF network with the scitt-ccf-ledger app which exists for the duration of all of the functional tests.

Code formatting

Parts of the codebase have formatting rules enforced by the CI pipeline. The rules can be checked locally by running scripts/ci-checks.sh. Formatting can be fixed automatically by running scripts/ci-checks.sh -f.