# Adding Slicer to official VTK Continuous Integration aka "Contract Testing"

**URL:** <https://discourse.slicer.org/t/adding-slicer-to-official-vtk-continuous-integration-aka-contract-testing/15848>\
**Category:** Development\
**Created:** [February 4, 2021, 9:26pm UTC](https://discourse.slicer.org/t/adding-slicer-to-official-vtk-continuous-integration-aka-contract-testing/15848 "2021-02-04T21:26:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [February 4, 2021, 9:26pm UTC](https://discourse.slicer.org/t/adding-slicer-to-official-vtk-continuous-integration-aka-contract-testing/15848/1 "2021-02-04T21:26:00Z")

</div>

To more effectively identify and address issues associated with the latest version of VTK that may impact Slicer, we are working with the VTK team to setup what we call “contract testing”.

In a nutshell, Slicer will be built automatically by the VTK CI infrastructure:

- on a nightly basis
- on “demand” for merge request

For more details, see [CI jobs for contract testing (#18113) · Issues · VTK / VTK · GitLab](https://gitlab.kitware.com/vtk/vtk/-/issues/18113)

### Which Slicer build option to build on VTK CI ?

We suggest the following:

```auto
Slicer_BUILD_CLI:BOOL=OFF
Slicer_USE_QtTesting:BOOL=OFF
Slicer_USE_SimpleITK:BOOL=OFF
Slicer_BUILD_PARAMETERSERIALIZER_SUPPORT:BOOL=OFF

```

### Which tests to run on VTK CI ?

While running all tests would be ideal, we would like to instead maximize the use of available resources by identifying existing tests and also implementing new ones.

Here is an initial list of functionality to focus one (based on prior regressions):

- Fiducial selection
- Occlusion and transparency
- Volume rendering, multi-volume rendering, depth peeling
- Smoothing of segmentation in 3D view
- Building of Slicer Extension like SlicerLookingGlass and SlicerVirtualReality

We also discussed building VTK and Slicer against Qt6 and that will happen later.

### If you would like to help, here are some ideas:

1. Update Slicer to build against latest VTK:

2. The Slicer/VTK fork associated with VT9 currently has 3 patches, at least 2 of them would need to be addressed so that we can use an install tree of VTK:

3. Help to (a) identify relevant Slicer tests and (b) implement new ones

4. The VTK CI will build Slicer by passing the option `VTK_DIR` pointing to an install tree of VTK9, we need help testing.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 5, 2021, 3:39am UTC](https://discourse.slicer.org/t/adding-slicer-to-official-vtk-continuous-integration-aka-contract-testing/15848/2 "2021-02-05T03:39:20Z")

</div>

This sounds like a lot of work, but nevertheless useful. QtTesting can drive the GUI and set up rendering tests, which could be useful for catching errors in rendering output, so we could try to enable it.
