I received a letter about continuous integration more than a month ago. The content is as follows:
"In our current project, we ran a complete test using selenium grid and ran the test using ten servers in a distributed manner. It took more than one hour to run the test, and it was impossible to run the test locally. In this case, it is no longer possible for developers to submit all the test jobs locally. Have you ever encountered a similar situation? How is it solved ?"
Many people may have practiced agile or lean methods in their teams. Although some teams may feel some results, they may not be the majority satisfied. Aside from soft factors such as corporate culture, the technical understanding of a certain practice may also be greatly affected.
Our goal is to deliver software value quickly and with high quality. If "local test time" has become a bottleneck in the production process (that is, a waste of time), it should be solved.
Theoretically, "Run all tests locally and then submit again" has no problem at all, especially in the initial stage of the project. However, the code library will grow up in a day. For long-cycle projects, we need to reconsider the ideas behind this theoretical practice.
Selenium testing is a function test that consumes a lot of machine resources. Therefore, you can ask yourself some questions to find the answer.
1. Is there a unit test?
(1) If so, has the unit test coverage reached a reasonable range?
(A) If yes, these functions can be tested in a continuous integration environment.
(B) If not, strengthen unit tests until reasonable coverage is reached.
(2) If not, you can select an important function test set to run locally and add a unit test.
Unit Tests are indispensable code in the thoughtworks team. Without a unit test, you may not know how to write code.
2. Why is Function Testing slow? Can I optimize it? Can 20 machines be added if the optimization takes too long?
Machine costs are much less than human costs. An 8-core/16 GB blade server is more than 10 thousand RMB, that is, 8 machines. Apply to the functional tests mentioned above to increase the testing speed by at least 30%. What a considerable number.
As long as you understand your thoughts and make sure that your implementations remain unchanged, continuous integration is not a problem.