newdevs:git:test
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
newdevs:git:test [2019/06/28 18:42] – [B2. Create a Testing Branch] tmccanna | newdevs:git:test [2023/06/01 11:58] (current) – udpate branch name from main to master gmcharlton | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | **New Developers Working Group** | ||
====== Git for Windows ====== | ====== Git for Windows ====== | ||
===== Using Git to Test Patches ===== | ===== Using Git to Test Patches ===== | ||
- | ===== Get the Commit Hash ===== | + | ===== 1. Get the Commit Hash ===== |
First, you will need to identify the unique commit ID (hash) of the patch you wish to test. This is most easily found by clicking on a link in the related launchpad bug. Once there, copy the first 7+ characters from the unique commit code. | First, you will need to identify the unique commit ID (hash) of the patch you wish to test. This is most easily found by clicking on a link in the related launchpad bug. Once there, copy the first 7+ characters from the unique commit code. | ||
Line 9: | Line 10: | ||
{{ : | {{ : | ||
- | ===== Load the Patch to Your Test Server ===== | + | ===== 2. Load the Patch to Your Test Server ===== |
The next steps will be somewhat different depending on whether you have direct access to a test server that has Git installed or whether you have file access via WinSCP or another file transfer program. | The next steps will be somewhat different depending on whether you have direct access to a test server that has Git installed or whether you have file access via WinSCP or another file transfer program. | ||
- | ===== Option A: Testing When You Have File Access ===== | + | ===== Option A: Testing When You Have File Access |
==== A1. Update Your Local Repository ==== | ==== A1. Update Your Local Repository ==== | ||
Line 19: | Line 20: | ||
- Open Git Bash on your computer. | - Open Git Bash on your computer. | ||
- Navigate into your Evergreen repository. | - Navigate into your Evergreen repository. | ||
- | - If the master | + | - If the main branch isn't currently checked out, check it out: **git checkout |
- | - Make sure your local repository is current: git pull | + | - Make sure your local repository is current: |
==== A2. Create a Testing Branch ==== | ==== A2. Create a Testing Branch ==== | ||
- | - Create and checkout a local testing branch: git checkout -b lp12345_branch_name | + | - Create and checkout a local testing branch: |
* This branch does not have to have the same name as the branch you will be testing, but it makes it easier to keep track of. | * This branch does not have to have the same name as the branch you will be testing, but it makes it easier to keep track of. | ||
- | - Pull changes into the testing branch using the unique commit id: git cherry-pick 7ab7281f5 | + | - Pull changes into the testing branch using the unique commit id: **git cherry-pick 7ab7281f5** |
+ | * If you receive an error while cherry picking, you can stop it: **git cherry-pick --abort** | ||
+ | * If the branch has multiple commits, you can cherry-pick them one at a time (oldest to newest) or you can cherry-pick a range of commits at once (oldest to newest): **git cherry-pick 7ab7281f5^..8lgls9a34** | ||
==== A3. Upload Changed Files ==== | ==== A3. Upload Changed Files ==== | ||
Line 42: | Line 45: | ||
- Open Git Bash on the server as the root user. | - Open Git Bash on the server as the root user. | ||
- Navigate into your Evergreen repository. | - Navigate into your Evergreen repository. | ||
- | - If the master | + | - If the main branch isn't currently checked out, check it out: git checkout |
- | - Make sure your local repository is current: git pull | + | - Make sure your local repository is current: |
==== B2. Create a Testing Branch ==== | ==== B2. Create a Testing Branch ==== | ||
- | - Create and checkout a local testing branch: git checkout -b lp12345_branch_name | + | - Create and checkout a local testing branch: |
* This branch does not have to have the same name as the branch you will be testing, but it makes it easier to keep track of. | * This branch does not have to have the same name as the branch you will be testing, but it makes it easier to keep track of. | ||
- | - Pull changes into the testing branch using the unique commit id: git cherry-pick 7ab7281f5 | + | - Pull changes into the testing branch using the unique commit id: **git cherry-pick 7ab7281f5** |
- | * If you receive an error while cherry picking, you can stop it: git cherry-pick --abort | + | * If you receive an error while cherry picking, you can stop it: **git cherry-pick --abort |
+ | ** | ||
==== B3. Upload Changed Files ==== | ==== B3. Upload Changed Files ==== | ||
- | Using WinSCP (or your other FTP-style program), transfer each of the changed | + | Copy each file to the ' |
+ | |||
+ | <code bash> | ||
+ | cp Open-ILS/ | ||
+ | </ | ||
+ | |||
+ | ===== 3. Restart Services as Needed ===== | ||
+ | |||
+ | If you are only testing changes to template (tt2) files or basic javascript files, then just clearing | ||
+ | |||
+ | If you are testing changes to configuration | ||
+ | |||
+ | To restart OpenSRF | ||
+ | <code bash> | ||
+ | su - opensrf -c "bash -i -c '/ | ||
+ | </ | ||
+ | |||
+ | To restart Autogen (this refreshes the org unit tree, incorporates field mapper changes, etc.): | ||
+ | <code bash> | ||
+ | su - opensrf -c / | ||
+ | </ | ||
+ | |||
+ | To restart Apache and WebSockets (the underlying servers/ | ||
+ | <code bash> | ||
+ | systemctl restart apache2 websocketd-osrf | ||
+ | </ | ||
+ | |||
+ | //If// your test server is running the NGINX http/proxy server, you can also restart that: | ||
+ | <code bash> | ||
+ | systemctl restart nginx | ||
+ | </ | ||
+ | |||
+ | If you are testing very large changes, or changes that modify the database, you may need to rebuild the Evergreen installation. This requires significant Linux knowledge to do, and instructions are located at: [[https:// | ||
- | ===== Test ===== | + | ===== 4. Test ===== |
Test everything thoroughly to be sure it solves the problem that the developer wanted to solve. Be sure to test any other related pages/ | Test everything thoroughly to be sure it solves the problem that the developer wanted to solve. Be sure to test any other related pages/ | ||
- | ===== Create a Sign-Off Branch ===== | + | ===== 5. Create a Sign-Off Branch ===== |
If testing is //not// successful, update the launchpad bug report with details. | If testing is //not// successful, update the launchpad bug report with details. |
newdevs/git/test.1561761722.txt.gz · Last modified: 2022/02/10 13:34 (external edit)