I preface my answer with the details that I run on GitHub and Jenkins.
Why does a developer have to run all the tests locally before committing. Especially in the Git paradigm, which is not a requirement. What if, for example, it takes 15-30 minutes to complete all the tests. Do you really want your developers or you personally sitting around, expecting the tests to be run locally before your commit and push your changes?
Our process is usually performed as follows:
- Make changes to the local branch.
- Run all the new tests that you created.
- Make changes to the local branch.
- Delete local changes remotely in GitHub and create a pull request.
- You have a build process that picks up changes and runs unit tests.
- If the tests failed, then fix them in the local branch and push them locally.
- Get the change code discussed in the pull request.
- After approval and all checks, click to complete the wizard.
- Repeat all unit tests.
- Click the artifact into the repository.
- Push changes in the environment (e.g. DEV, QA) and perform any integration / functional tests that are based on the complete environment.
- If you have a cloud, you can push your changes to the new node and only after all the environment tests cross the VIP to the new node (s)
- Repeat 11 until you have skipped all the pre-connected environments.
- If you practice continuous deployment, then all your changes go to PROD, if all the checks, checks, etc. pass.
My point is that developers do not use the time to run tests that locally hinder their progress, when you can turn off this work on the continuous integration server and receive notifications about problems that need to be fixed later. In addition, some tests simply cannot be performed until you commit them and place the artifact in the environment. If the environment is broken because you do not have a cloud, and perhaps you have only one server, then fix it locally and quickly click on the changes to stabilize the environment.
You can run tests locally if necessary, but this should not be the norm.
Regarding the issue with multiple developers, open source projects have long been working with this. They use forks on GitHub to allow contributors to offer new fixes and functionalities, but this is not really so different from the developer in the team creating the local branch, pushing it off remotely and gaining buy-in by checking the code before clicking, If someone is pushing for changes that violate your changes, you first try to fix them and then ask them for help. You must follow the principle of "merging early and often," as well as periodically merging updates from the master to your industry.
gaoagong
source share