# Automated testing when merging to main

**URL:** <https://discuss.dvc.org/t/automated-testing-when-merging-to-main/826>\
**Category:** Questions\
**Created:** [July 22, 2021, 1:35pm UTC](https://discuss.dvc.org/t/automated-testing-when-merging-to-main/826 "2021-07-22T13:35:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davesteps](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@davesteps](https://discuss.dvc.org/u/davesteps)\
**Post date:** [July 22, 2021, 1:35pm UTC](https://discuss.dvc.org/t/automated-testing-when-merging-to-main/826/1 "2021-07-22T13:35:59Z")

</div>

If we assume our currently deployed model is on the `main` branch. When we train a better model on a new branch and we decide to merge into main, we want to run some CI/CD tests that will confirm our branch is ok to merge. In particular we want to test that 1) all of the dvc tracked files have been pushed to the remote and 2) if you run `dvc status` it return something like ‘All data and pipeline up to date.’. We have set up some python tests to confirm this but it doesn’t seem the most robust, I wondered if there was a more formal approach using dvc/cml functionality for doing this?

---

<div class="post-metadata">

**Author:** ![davidgortega](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/davidgortega/32/118_2.png) [@davidgortega](https://discuss.dvc.org/u/davidgortega)\
**Post date:** [July 26, 2021, 1:34pm UTC](https://discuss.dvc.org/t/automated-testing-when-merging-to-main/826/2 "2021-07-26T13:34:59Z")

</div>

@davesteps right now CML does not have such functionality.  
It sounds like a nice feature to have. Not sure if it should be a CML’s or DVC’s one.

---

<div class="post-metadata">

**Author:** ![davidgortega](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/davidgortega/32/118_2.png) [@davidgortega](https://discuss.dvc.org/u/davidgortega)\
**Post date:** [July 26, 2021, 1:53pm UTC](https://discuss.dvc.org/t/automated-testing-when-merging-to-main/826/3 "2021-07-26T13:53:02Z")

</div>

Could you please open a ticket in CMLs issues in the meantime?

---

<div class="post-metadata">

**Author:** ![dberenbaum](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dberenbaum](https://discuss.dvc.org/u/dberenbaum)\
**Post date:** [July 29, 2021, 6:45pm UTC](https://discuss.dvc.org/t/automated-testing-when-merging-to-main/826/4 "2021-07-29T18:45:14Z")

</div>

You might also want to check out [New command: dvc verify - check that the pipeline is up to date without having to pull or run it · Issue #5369 · iterative/dvc · GitHub](https://github.com/iterative/dvc/issues/5369). If that fits your needs, you could comment there to help drive the direction of that feature request.

---

<div class="post-metadata">

**Author:** ![davesteps](https://avatars.discourse-cdn.com/v4/letter/d/3bc359/32.png) [@davesteps](https://discuss.dvc.org/u/davesteps)\
**Post date:** [August 2, 2021, 12:35pm UTC](https://discuss.dvc.org/t/automated-testing-when-merging-to-main/826/5 "2021-08-02T12:35:56Z")

</div>

Thanks @davidgortega and @dberenbaum. The `dvc verify` feature sounds great and I think will largely solve the problem, I have indicated my support in the ticket. I have opened a CML issue also as it feels as though there could be some way to integrate this feature into CML also. [Feature Request: Automated testing when merging to main · Issue #681 · iterative/cml · GitHub](https://github.com/iterative/cml/issues/681)

Many thanks.
