Phabricator/TestPlan: Difference between revisions
DaveLawrence (talk | contribs) No edit summary |
DaveLawrence (talk | contribs) No edit summary |
||
Line 2: | Line 2: | ||
== Getting Started == | == Getting Started == | ||
'''NOTE:''' We are using the dev server for QA test runs. | |||
''' | The following manual steps are required to get QA up and running for Phabricator testing on Mozilla's staging server. | ||
Alternatively, you can try out the a preset environment using Docker from this [https://github.com/dklawren/phabricator-qa Github repo]. Once checked out run: | |||
docker-compose build | |||
docker-compose run qa su - phab | |||
You will still need to perform step 8 using your own Conduit API keys. | |||
'''Manual Setup''' | |||
1. Clone the following repositories to the same directory on your machine: | 1. Clone the following repositories to the same directory on your machine: | ||
git clone https://github.com/phacility/libphutil | git clone https://github.com/phacility/libphutil $HOME/libphutil | ||
git clone https://github.com/phacility/arcanist | git clone https://github.com/phacility/arcanist $HOME/arcanist | ||
git clone https://github.com/mozilla-conduit/arcanist --branch master --single-branch cinnabarc | git clone https://github.com/mozilla-conduit/arcanist --branch master --single-branch $HOME/cinnabarc | ||
2. Add vanilla arcanist (<code>bin | 2. Add vanilla arcanist (<code>$HOME/arcanist/bin</code> from your phacility repo checkout) to your path. On OS X and Linux (and the Windows 10 Linux Subsystem), you can add the following to your `~/.bash_profile`: | ||
export PATH="$PATH:$HOME/arcanist/bin" | |||
Doing so will allow you to use the <code>arc</code> command from anywhere on your machine. | Doing so will allow you to use the <code>arc</code> command from anywhere on your machine. | ||
Line 19: | Line 28: | ||
git clone https://github.com/glandium/git-cinnabar.git --branch master --single-branch | git clone https://github.com/glandium/git-cinnabar.git --branch master --single-branch | ||
export PATH=/ | export PATH="$PATH:$HOME//git-cinnabar:$PATH | ||
cd git-cinnabar && git cinnabar download | cd git-cinnabar && git cinnabar download | ||
4. Alias Arcanist modified for git-cinnabar use to <code>cinnabarc</code>. This will allow to use both vanilla and modified Arcanist interchangeably: | 4. Alias Arcanist modified for git-cinnabar use to <code>cinnabarc</code>. This will allow to use both vanilla and modified Arcanist interchangeably. You can add the following to your `~/.bash_profile: | ||
alias cinnabarc="$HOME/cinnabarc/bin/arc" | |||
5. Install the moz-phab arcanist wrapper used for submitting stacked revisions to Phabricator. You can see instructions on how to install from the [https://github.com/mozilla-conduit/review Github repo]. The <code>moz-phab</code> command needs to be in your PATH such as in $HOME/bin. | |||
6. Reload your .bash_profile: | |||
source $HOME/.bash_profile | |||
7. Clone the repo(s) you plan to test on: | |||
* <code>hg clone https://hg.mozilla.org/automation/phabricator-qa-dev/</code> | * <code>hg clone https://hg.mozilla.org/automation/phabricator-qa-dev/</code> | ||
* <code>git clone hg::https://hg.mozilla.org/automation/phabricator-qa-dev/ phabricator-qa-dev-cinnabar</code> | * <code>git clone hg::https://hg.mozilla.org/automation/phabricator-qa-dev/ phabricator-qa-dev-cinnabar</code> | ||
8. In the local <code>phabricator-qa-dev</code> repository checkout, run: | |||
arc install-certificate | arc install-certificate | ||
Line 41: | Line 56: | ||
cinnabarc install-certificate | cinnabarc install-certificate | ||
9. Test away! You can create branches within your local <code>phabricator-qa-dev</code> repository checkout, add commits, and send them to Phabricator via <code>mozphab</code>. See the [http://moz-conduit.readthedocs.io/en/latest/phabricator-user.html Mozilla Phabricator User Documentation] for more. | |||
This should be all you need to get going with moz-phab, arc, and our staging and dev servers! | This should be all you need to get going with moz-phab, arc, and our staging and dev servers! | ||
Line 74: | Line 89: | ||
#* To create bugs directly and bypass triaging, go to https://bugzilla.allizom.org/enter_bug.cgi?product=Firefox&format=__default__ (staging) or https://bugzilla-dev.allizom.org/enter_bug.cgi?product=Firefox&format=__default__ (dev) | #* To create bugs directly and bypass triaging, go to https://bugzilla.allizom.org/enter_bug.cgi?product=Firefox&format=__default__ (staging) or https://bugzilla-dev.allizom.org/enter_bug.cgi?product=Firefox&format=__default__ (dev) | ||
# Using the repo listed in the "Getting Started" section above that matches the environment you are testing, make some change to a file. | # Using the repo listed in the "Getting Started" section above that matches the environment you are testing, make some change to a file. | ||
# Run <code>hg commit -A -m ' | # Run <code>hg commit -A -m 'Bug <bugid>: New changes</code> | ||
# Run <code>moz-phab</code> | # Run <code>moz-phab</code> | ||
====Results==== | ====Results==== | ||
Line 87: | Line 100: | ||
## The link is correct based on the environment (bugzilla.allizom.org for staging, bugzilla-dev.allizom.org for dev). | ## The link is correct based on the environment (bugzilla.allizom.org for staging, bugzilla-dev.allizom.org for dev). | ||
## If the bug in Bugzilla is a public bug, the revision should also be public. | ## If the bug in Bugzilla is a public bug, the revision should also be public. | ||
# Visiting the bug on Bugzilla shows an | # Visiting the bug on Bugzilla shows an entry for the new revision in the Phabricator Revisions section. | ||
# Author received an email from <code>mozphab-dev@mozilla.com</code>. It has a title formatted as "[Differential] [Changed Policy] D{revision number}: {first line}." and a body with a text "phab-bot changed the visibility from "Administrators" to "Public (No Login Required)"." | # Author received an email from <code>mozphab-dev@mozilla.com</code>. It has a title formatted as "[Differential] [Changed Policy] D{revision number}: {first line}." and a body with a text "phab-bot changed the visibility from "Administrators" to "Public (No Login Required)"." | ||
Line 112: | Line 125: | ||
# Go to bugzilla and create a security bug: | # Go to bugzilla and create a security bug: | ||
#* Click "Edit Bug", open the "Security" panel, and check one of the security-sensitive boxes, e.g. "Security-Sensitive Core Bug". | #* Click "Edit Bug", open the "Security" panel, and check one of the security-sensitive boxes, e.g. "Security-Sensitive Core Bug". | ||
# | # Run <code>hg commit -A -m 'Bug <bugid>: Private changes</code> | ||
# Run <code>moz-phab</code>. | # Run <code>moz-phab</code>. | ||
====Results==== | ====Results==== | ||
Line 127: | Line 138: | ||
# The revision is visible to the user who made it. | # The revision is visible to the user who made it. | ||
# The revision is visible to users belonging to the security groups of the bug. | # The revision is visible to users belonging to the security groups of the bug. | ||
# | # Visiting the bug on Bugzilla shows an entry for the new revision in the Phabricator Revisions section. | ||
# The revision is NOT visible to the public without logging in. | # The revision is NOT visible to the public without logging in. | ||
# The revision is NOT visible to logged in members without the correct permission. | # The revision is NOT visible to logged in members without the correct permission. | ||
Line 136: | Line 147: | ||
====Test Plan==== | ====Test Plan==== | ||
# | # Go to bugzilla and create a public bug: | ||
# Run <code>hg commit -A -m 'Bug <bugid>: Public changes</code> | |||
# Run <code>moz-phab</code>. | # Run <code>moz-phab</code>. | ||
# Check if revision is available for public. | # Check if revision is available for public. | ||
# Go to bugzilla and create a security bug: | # Go to bugzilla and create a security bug: | ||
Line 157: | Line 167: | ||
# The revision is NOT visible to logged in members without the correct permission. | # The revision is NOT visible to logged in members without the correct permission. | ||
# The revision IS visible to the second Bugzilla user. | # The revision IS visible to the second Bugzilla user. | ||
# | # Visiting the bug on Bugzilla shows an entry for the new revision in the Phabricator Revisions section. | ||
# The reviewer received an email from the author with a text "The content for this message can only be transmitted over a secure channel." and a link to Phabricator. | # The reviewer received an email from the author with a text "The content for this message can only be transmitted over a secure channel." and a link to Phabricator. | ||
Line 163: | Line 173: | ||
====Test Plan==== | ====Test Plan==== | ||
# Enter the bug id as specified for each expected result below. | # Enter the bug id as specified for each expected result below. | ||
# Run <code>hg commit -A -m 'Bug <bugid>: Public changes</code> | |||
# Run <code>moz-phab</code>. | |||
====Results==== | ====Results==== | ||
Line 177: | Line 186: | ||
====Test Plan==== | ====Test Plan==== | ||
# | # Run <code>hg commit -A -m 'Bug <bugid>: Public changes</code> | ||
# Run <code>moz-phab</code> | # Run <code>moz-phab</code>. | ||
# Create a different comment using same bug id but different title. | |||
# | |||
====Result==== | ====Result==== | ||
# Both revisions are created successfully. | # Both revisions are created successfully. | ||
# | # Visiting the bug on Bugzilla shows 2 corresponding entries for the revisions in the Phabricator Revisions section. | ||
=== T8 - Requesting and leaving a review on a revision is successful === | === T8 - Requesting and leaving a review on a revision is successful === | ||
Line 209: | Line 216: | ||
# Create a new bug. | # Create a new bug. | ||
# Create a commit and run <code>moz-phab</code>. | # Create a commit and run <code>moz-phab</code>. | ||
# | # On a previously created revision, perform the "Abandon Revision" action from the "Add Action" dropdown. | ||
====Results==== | ====Results==== | ||
# The bug | # The bug shows the revision as 'Abandoned' in the Phabricator Revisions list of the bug. | ||
# The bug | # The bug history shows the attachment is being set to obsolete. | ||
=== T10 - Reclaiming a revision unobsoletes the attachment === | === T10 - Reclaiming a revision unobsoletes the attachment === | ||
Line 222: | Line 228: | ||
====Results==== | ====Results==== | ||
# The bug's Phabricator attachment is unobsoleted. | # The bug's Phabricator attachment is unobsoleted and the revisions is no abandoned in the Phabricator revisions list. | ||
=== T11 - Creating a Diff from local git repository to remote Mercurial repository is not allowed === | === T11 - Creating a Diff from local git repository to remote Mercurial repository is not allowed === | ||
Line 228: | Line 234: | ||
====Test Plan==== | ====Test Plan==== | ||
# Change directory to the repository <code>phabricator-qa-dev-cinnabar</code>. | # Change directory to the repository <code>phabricator-qa-dev-cinnabar</code>. | ||
# Create a commit with git and run <code> | # Create a commit with git and run <code>arc diff</code>. | ||
# Fill the needed data (<code>Test Plan</code>) and confirm. | # Fill the needed data (<code>Test Plan</code>) and confirm. | ||
Line 261: | Line 267: | ||
# Create a new hg commit. | # Create a new hg commit. | ||
# Run <code>moz-phab</code>. | # Run <code>moz-phab</code>. | ||
====Results==== | ====Results==== |
Revision as of 02:56, 28 March 2019
Getting Started
NOTE: We are using the dev server for QA test runs.
The following manual steps are required to get QA up and running for Phabricator testing on Mozilla's staging server.
Alternatively, you can try out the a preset environment using Docker from this Github repo. Once checked out run:
docker-compose build docker-compose run qa su - phab
You will still need to perform step 8 using your own Conduit API keys.
Manual Setup
1. Clone the following repositories to the same directory on your machine:
git clone https://github.com/phacility/libphutil $HOME/libphutil git clone https://github.com/phacility/arcanist $HOME/arcanist git clone https://github.com/mozilla-conduit/arcanist --branch master --single-branch $HOME/cinnabarc
2. Add vanilla arcanist ($HOME/arcanist/bin
from your phacility repo checkout) to your path. On OS X and Linux (and the Windows 10 Linux Subsystem), you can add the following to your `~/.bash_profile`:
export PATH="$PATH:$HOME/arcanist/bin"
Doing so will allow you to use the arc
command from anywhere on your machine.
3. Install git-cinnabar:
git clone https://github.com/glandium/git-cinnabar.git --branch master --single-branch export PATH="$PATH:$HOME//git-cinnabar:$PATH cd git-cinnabar && git cinnabar download
4. Alias Arcanist modified for git-cinnabar use to cinnabarc
. This will allow to use both vanilla and modified Arcanist interchangeably. You can add the following to your `~/.bash_profile:
alias cinnabarc="$HOME/cinnabarc/bin/arc"
5. Install the moz-phab arcanist wrapper used for submitting stacked revisions to Phabricator. You can see instructions on how to install from the Github repo. The moz-phab
command needs to be in your PATH such as in $HOME/bin.
6. Reload your .bash_profile:
source $HOME/.bash_profile
7. Clone the repo(s) you plan to test on:
hg clone https://hg.mozilla.org/automation/phabricator-qa-dev/
git clone hg::https://hg.mozilla.org/automation/phabricator-qa-dev/ phabricator-qa-dev-cinnabar
8. In the local phabricator-qa-dev
repository checkout, run:
arc install-certificate
Follow the instructions presented in the command line to associate your local machine with the Phabricator instance via an API key.
Repeat the process in phabricator-qa-dev-cinnabar
. Use cinnabarc
instead:
cinnabarc install-certificate
9. Test away! You can create branches within your local phabricator-qa-dev
repository checkout, add commits, and send them to Phabricator via mozphab
. See the Mozilla Phabricator User Documentation for more.
This should be all you need to get going with moz-phab, arc, and our staging and dev servers!
Test Plan
These tests will help ensure that our extensions continue to work as expected when Phabricator is upgraded. They are important as Phacility make no guarantees that internal modules/objects/APIs won't change. See the upgrade process for more.
Please update this doc with new tests as features are added/changed and as holes in the plan are discovered.
T1 - Signing up is successful
Test Plan
- Create a new BMO account.
- Make sure to include an irc nick in the Real Name field.
- E.g. "John Doe [:jdoe]"
- Go to Phabricator and login as the new user.
- Finish account creation.
Results
- After logging into Phabricator, on the "Create a New Account" page,
- Username should be prefilled with the irc nick,
- Real Name is correct and does not contain [] or any other extraneous characters.
- Clicking register approval completes account creation without error.
- The account works as expected.
T2 - Creating a revision is successful
Test Plan
- Make sure you have moz-phab properly setup on your machine and have run
arc install-certificate
using the Phabricator user you wish to test with as documented above. - Go to BMO and create a new bug as the Bugzilla user that the Phabricator account is connected to. (Or use an existing public bug).
- To create bugs directly and bypass triaging, go to https://bugzilla.allizom.org/enter_bug.cgi?product=Firefox&format=__default__ (staging) or https://bugzilla-dev.allizom.org/enter_bug.cgi?product=Firefox&format=__default__ (dev)
- Using the repo listed in the "Getting Started" section above that matches the environment you are testing, make some change to a file.
- Run
hg commit -A -m 'Bug <bugid>: New changes
- Run
moz-phab
Results
moz-phab
only submitted the 1 newly created commit.- Visit Phabricator and there should be a new revision with the title.
- The revision should contain the correct diff of the changes that were made.
- The "Bugzilla Bug ID" is correct.
- The Bug number is correct.
- The link is correct based on the environment (bugzilla.allizom.org for staging, bugzilla-dev.allizom.org for dev).
- If the bug in Bugzilla is a public bug, the revision should also be public.
- Visiting the bug on Bugzilla shows an entry for the new revision in the Phabricator Revisions section.
- Author received an email from
mozphab-dev@mozilla.com
. It has a title formatted as "[Differential] [Changed Policy] D{revision number}: {first line}." and a body with a text "phab-bot changed the visibility from "Administrators" to "Public (No Login Required)"."
T3 - Updating a revision with an amended commit is successful
Test Plan
hg update
to a commit which you previously submitted with moz-phab- Make a change and run
hg commit --amend
- Run
moz-phab
Results
- moz-phab should automatically detect a revision and ask you if you want to update it.
- The revision is updated with the new diff on Phabricator:
- The History tab should have two entries, Diff 1 and Diff 2.
- The Commits tab should have a single entry.
- The bug id and other information remains unchanged.
T4 - Creating a secure revision is successful
Your Bugzilla user must belong to a security group, e.g. core-security.
Test Plan
- Go to bugzilla and create a security bug:
- Click "Edit Bug", open the "Security" panel, and check one of the security-sensitive boxes, e.g. "Security-Sensitive Core Bug".
- Run
hg commit -A -m 'Bug <bugid>: Private changes
- Run
moz-phab
.
Results
- The diff and information of the revision are as expected.
- The revision has a "Custom Policy" attached to it.
- Click "Edit Revision" and then click on the "Visible To" drop down, and select the "Custom Policy" choice.
- It should read "Allow members of projects", followed by the names of projects corresponding to all Bugzilla groups the private bug is categorized under. For example, a bug private to core-security, should have the project name "bmo-core-security".
- The revision has a "secure-revision" project tag added.
- The revision has a warning titled "This is a secure revision.".
- The revision added the creator as a subscriber.
- The revision is visible to the user who made it.
- The revision is visible to users belonging to the security groups of the bug.
- Visiting the bug on Bugzilla shows an entry for the new revision in the Phabricator Revisions section.
- The revision is NOT visible to the public without logging in.
- The revision is NOT visible to logged in members without the correct permission.
T5 - Adding a secure bug to an existing revision locks it down
Your Bugzilla user must belong to a security group, e.g. core-security. You will also need a second, unprivileged user.
Test Plan
- Go to bugzilla and create a public bug:
- Run
hg commit -A -m 'Bug <bugid>: Public changes
- Run
moz-phab
. - Check if revision is available for public.
- Go to bugzilla and create a security bug:
- Click "Edit Bug", open the "Security" panel, and check one of the security-sensitive boxes, e.g. "Security-Sensitive Core Bug".
- Edit the revision created above, and set the Bugzilla Bug ID field to the ID of the newly created bug.
- Add the second, unprivileged Bugzilla user to the bug's CC list.
Results
- The revision has a "Custom Policy" attached to it.
- Click "Edit Revision" and then click on the "Visible To" drop down, and select the "Custom Policy" choice.
- It should read "Allow members of projects", followed by the names of projects corresponding to all Bugzilla groups the private bug is categorized under. For example, a bug private to core-security, should have the project name "bmo-core-security".
- The revision has a "secure-revision" project tag added.
- The revision has the creator and the second Bugzilla user as subscribers.
- The revision is visible to the user who made it.
- The revision is visible to users belonging to the security groups of the bug.
- The revision is NOT visible to the public without logging in.
- The revision is NOT visible to logged in members without the correct permission.
- The revision IS visible to the second Bugzilla user.
- Visiting the bug on Bugzilla shows an entry for the new revision in the Phabricator Revisions section.
- The reviewer received an email from the author with a text "The content for this message can only be transmitted over a secure channel." and a link to Phabricator.
T6 - Creating a revision checks the bug id
Test Plan
- Enter the bug id as specified for each expected result below.
- Run
hg commit -A -m 'Bug <bugid>: Public changes
- Run
moz-phab
.
Results
- Entering an invalid bug id, e.g "abcd efg" or "$1000", fails.
- Entering the id of a bug that does not exist fails.
- Entering the id of a bug of a secure revision that the user does not have access to fails.
- Entering a valid bug id is successful.
T7 - Creating multiple revisions with the same bug id is successful
Test Plan
- Run
hg commit -A -m 'Bug <bugid>: Public changes
- Run
moz-phab
. - Create a different comment using same bug id but different title.
Result
- Both revisions are created successfully.
- Visiting the bug on Bugzilla shows 2 corresponding entries for the revisions in the Phabricator Revisions section.
T8 - Requesting and leaving a review on a revision is successful
Test Plan
- Ensure that you have 2 Phabricator accounts that log in via Bugzilla ready to go.
- Create a commit, run
moz-phab
. - Input the title, summary, test plan, and bug id of a public bug.
- For the "Reviewers" field enter the Phabricator username of the other account.
- Log into Phabricator as the reviewer account.
- Add the "Accept Revision" action at the bottom. Submit.
- Add the "Request Changes" action at the bottom. Submit.
Results
- The Phabricator attachment on Bugzilla is present.
- Reviewer received an email from author with a text "{author} added a reviewer: {reviewer}"
- Author received an email from reviewer with a text "{reviewer} accepted this revision."
- Author received an email from reviewer with a text "{reviewer} requested changes to this revision."
T9 - Abandoning a revision obsoletes the attachment
Test Plan
- Create a new bug.
- Create a commit and run
moz-phab
. - On a previously created revision, perform the "Abandon Revision" action from the "Add Action" dropdown.
Results
- The bug shows the revision as 'Abandoned' in the Phabricator Revisions list of the bug.
- The bug history shows the attachment is being set to obsolete.
T10 - Reclaiming a revision unobsoletes the attachment
Test Plan
- In the revision created as part of the "Abandoning a revision obsoletes the attachment" test, perform the "Reclaim revision" action.
Results
- The bug's Phabricator attachment is unobsoleted and the revisions is no abandoned in the Phabricator revisions list.
T11 - Creating a Diff from local git repository to remote Mercurial repository is not allowed
Test Plan
- Change directory to the repository
phabricator-qa-dev-cinnabar
. - Create a commit with git and run
arc diff
. - Fill the needed data (
Test Plan
) and confirm.
Results
- Creating a diff fails with :
ERR-CONDUIT-CORE: Local VCS (git) is different from the remote repository VCS (hg).
T12 - Patching Diff created from git repository
Test Plan
- Using a commit created above run
cinnabarc diff HEAD~
. - Fill the needed data (
Test Plan
) and confirm. - Change directory to
phabricator-qa-dev
. - Run
moz-phab patch D{number of the revision created above}
.
Results
- Code is sucessfully patched using the Diff.
T13 - Verify the private revisions deliver emails that does not contain any sensitive content
Your Bugzilla user must belong to a security group, e.g. core-security.
Test Plan
- Login to Phabricator (after creating account in Bugzilla) using an account that can have email delivered to it, such as your own email address.
- At the top right of Phabricator, click on your initial or gravatar image to open the drop down menu and select "Settings".
- Click on "Email Delivery".
- Select "Enable Self Action Mail" for the "Self Action" drop down.
- Click "Save Changes".
- Go to Bugzilla and create a security bug:
- Click "Edit Bug", open the "Security" panel, and check one of the security-sensitive boxes, e.g. "Security-Sensitive Core Bug".
- Create a new hg commit.
- Run
moz-phab
.
Results
- The diff and information of the revision are as expected.
- The revision has a "Custom Policy" attached to it.
- The revision has a "secure-revision" project tag added.
- The revision has a warning titled "This is a secure revision".
- Check to see if you received an email about the new object (Revision) that was just created.
- The email should not contain any information about the revision other than a link to Phabricator.
- Clicking on the link in the email should take you to the Phabricator page that displays the full unfiltered email contents.
- The email contents should contain the title, summary, test plan, reviewers, etc. of the new revision.
- Submitting a public revision should instead show the full contents in the email similar to what was displayed on the Phabricator mail page.