TeamCity incremental testing for .Net projects

前端 未结 1 1331
走了就别回头了
走了就别回头了 2021-02-10 09:21

I\'m building a modular WPF application. Each screen is a highly independent and isolated unit. The only thing shared - shell and a common library with a facade interface for th

相关标签:
1条回答
  • 2021-02-10 09:45

    You have to create build configurations and that generate artefacts and run tests.

    For example you have projects Library, Library.Tests, Portable, Poratble.Tests, App and App.Tests.

    You have to create build configuration (eg. Library build) that compiles Library and Library.Test projects. This configuration generates artefactes lets say eg. libtests.zip.

    Then you create another build configuration (eg. Run Library Tests and set the snapshot and artefacts dependency on previously created Library build configuration. In this test running configuration you have unpacking the libtests.zip file (gathered from the artefacts dependency) and create a build step (eg. NUnit runner) to run those tests.

    Be careful: You want to run tests only when something changes in Library, so under "Version Control Settings" check the Show changes from snapshot dependencies and create new VCS Trigger that will Trigger on changes in snapshot dependencies (also a checkbox).

    Then, lets assume Portable is dependent on Library and have its own suite of tests.

    Again, you should create build configuration that will compile projects Portable and Portable.Tests and generate artefacts called eg. portabletests.zip

    And yet again you create another build configuration for running this tests the same as previous. only this time you should add another snapshot dependency on Build library and Run library tests configuration. With this additional snapshot dependency you will achieve that code is compiled and run only when library build and testrun is OK.

    Same goes for App and App.Tests.

    So... When change occures in Library the whole set is rebuild and all tests are run (Library.Tests, Portable.Tests, App, App.Tests). When change happens in Portable code, Bulid portables is triggered and Portable.Tests are run and App + App.Tests are recompiles and App.Tests are run.

    On this link you can learn more about snapshot and artefacts dependencies in teamcity http://confluence.jetbrains.com/display/TCD8/Configuring+Dependencies

    0 讨论(0)
提交回复
热议问题