How To Test PRs

This guide will walk you through how to pull down a Pull Request from github and merge it with your codebase into a new branch so you can test changes.

Using TortiseGit(Windows only)

Tortisegit is a Windows shell-integrated git ui tool to make it easier to work with git. If you've used tortisesvn, it's pretty much the same but git-flavored instead. If you don't already have tortisegit, you can get it here

Clean pull

Once you have tortisegit installed and hooked, we'll want to do a clean repository clone, to act as our test bed. The following steps after this can easily be done on any local repo you've already set your stuff up in, but for tutorial purposes, we'll work out of a clean repository in case anything goes wrong. Once that's done, we can move onto the next step.

Creating a new branch

Once the engine is downloaded, we can create a new branch to pull a PR into to test it.

Pulling a PR to test

Now that we've made a new branch and confirmed we're on it, it's time to pull and merge a PR from github. First, we need to go to the PR page to find one we want to work with.

Pick one that looks interesting, and once you're on the page for the PR, take note of the line under the name of the PR

HttPR_PR_Info.png

This is a quick way to get what you need to plug into tortisegit to pull the PR to our branch.

First, we need to user's name:

HttPR_PR_Info_User.png

Then the PR branch:

HttPR_PR_Info_Branch.png

We then go back to our engine directory, click RMB, and go into the "TortiseGit" option and then click "Pull".

Pull.png

You'll get a new window that looks like this:

HttPR_Pull_Window.png

Now we just need to replace the information with the User and branch name we got from the PR page on github, like so:

HttPR_Pull_Window_Changes.png

If they have a completely different repository setup, you'll have to get their github url manually, but if they forked from the main GarageGames repository, then you should be able to just replace the name between "github.com/" and "/Torque3D.git" with the PR user name we grabbed.

For the Remote Branch, just copy in the PR's branch name we also grabbed from the github PR page.

Once you do that, click OK, and it'll pull down and merge the changes!

Testing

If there are no conflicts, all the changes should be merged in an ready to be tested/used. If you haven't created a project yet, do so now, either by using the Project Manager or CMake, and compile the engine.

If you already had a project, and the PR changes engine files, you'll need to compile the project again to get the changes applied.
If script or art files were modified in the template, and you have an existing project, you'll need to copy them over to your project directory as well.

Once done, you can fire up the application and test whatever the PR was about!

From here, you'll want to take note of any issues that came up, or if everything worked perfectly, and comment on the PR letting everyone know. The more people that test PRs, the more we can be assured that the PR doesn't have any bugs sneak in past anyone.

Conflicts

In the unfortunate event a conflict occurs with a PR pull attempt, you'll need to manually resolve the conflicts before it'll work.
This is usually as easy as picking whether to keep the change in the PR at a certain codeblock in a file, or keep the original file and ignore the PR's change.

In the event of a conflict, it'll alert you that the merge failed. Click OK, and then it will pop up a new window prompting you to resolves the conflicts. Click OK once again and you'll have a list of all the files being changed in the PR pull, and it highlights the files that are conflicting.

Selecting the files opens a file comparison tool, and you can go to the problem spots and decide what changes to make to resolve the conflicts. Once you're done, the changes can be marked as resolved. Once all conflict are resolved, you'll commit them to your local branch via the Git Commit -> "TestingPRPull" option in the shell menu.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License