How to automate integration testing?

前端 未结 4 1912
旧巷少年郎
旧巷少年郎 2021-02-02 11:29

I\'d like to know something, I know that to make your test easier you should use mock during unit testing to only test the component you want, without external dependencies. But

4条回答
  •  伪装坚强ぢ
    2021-02-02 11:59

    The approach I've seen taken most often is to run unit tests immediately on checkin, and to run more lengthy integration tests at fixed intervals (possibly on a different server; that's really up to your preference). I've also seen integration tests split into "short-running" integration tests and "long-running" integration tests, which are run at different intervals (the "short-running" tests run every hour, for example, and the "long-running" tests run overnight).

    The real goal of any automated testing is to get feedback to developers as quickly as is feasible. With that in mind, you should run integration tests as often as you possibly can. If there's a wide variance in the run length of your integration tests, you should run the quicker integration tests more often, and the slower integration tests less often. How often you run any set of tests in going to depend on how long it takes all the tests to run, and how disruptive the test runs will be to shorter-running tests (including unit tests).

    I realize this doesn't answer your entire question, but I hope it gives you some ideas about the scheduling part.

提交回复
热议问题