Phabricator/TestPlan: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 2: Line 2:
== Getting Started ==
== Getting Started ==


The following steps are required to get QA up and running for Phabricator testing on Mozilla's staging server.
'''NOTE:''' We are using the dev server for QA test runs.


'''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/arc</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` (modifying the path appropriately):
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`:
     alias arc='/Users/youruser/path/to/arcanist/bin/arc'
     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=/Users/youruser/path/to/git-cinnabar:$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.


    alias cinnabarc='/Users/youruser/path/to/cinnabarc/bin/arc'
6. Reload your .bash_profile:


5. Clone the repo(s) you plan to test on:
    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>


6. In the local <code>phabricator-qa-dev</code> repository checkout, run:  
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


7. 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.   
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 'commit1: New changes</code>
# Run <code>hg commit -A -m 'Bug <bugid>: New changes</code>
# Run <code>moz-phab</code>
# Run <code>moz-phab</code>
# Input something for the title, summary, test plan, and the correct bug id.
# Save and exit the file.


====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 <code>x-phabricator-request</code> attachment.
# 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".
# Create a new hg commit.
# Run <code>hg commit -A -m 'Bug <bugid>: Private changes</code>
# Run <code>moz-phab</code>.
# Run <code>moz-phab</code>.
# Enter the title, summary, test plan, and the bug id of the security bug.
# Submit the revision.


====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.
# There is an <code>x-phabricator-request</code> attachment on the bug in Bugzilla.
# 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====
# Create a new hg commit.
# 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>.
# Enter the title, summary, and test plan.  Do not include a bug number.
# Submit the revision.
# 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.
# There is an <code>x-phabricator-request</code> attachment on the bug in Bugzilla.
# 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====
# Create a new hg commit.
# Run <code>moz-phab</code>
# Enter information for the title, summary, and 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====
# Create a new hg commit.
# Run <code>hg commit -A -m 'Bug <bugid>: Public changes</code>
# Run <code>moz-phab</code>
# Run <code>moz-phab</code>.
# Enter information for the title, summary, and test plan.
# Create a different comment using same bug id but different title.
# Enter the bug id.
# Repeat and create another revision with the same bug id.


====Result====
====Result====
# Both revisions are created successfully.
# Both revisions are created successfully.
# There are 2 corresponding <code>x-phabricator-request</code> attachments on the bug in Bugzilla.
# 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>.
# Input the title, summary, test plan, and bug id of the newly created bug.
# On a previously created revision, perform the "Abandon Revision" action from the "Add Action" dropdown.
# Go to the newly created revision and perform the "Abandon Revision" action from the "Add Action" dropdown.


====Results====
====Results====
# The bug has no active attachments listed.
# The bug shows the revision as 'Abandoned' in the Phabricator Revisions list of the bug.
# The bug has one obsolete attachment listed, linking to the created revision.
# 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>moz-phab</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>.
# Enter the title, summary, test plan, and the bug id of the security bug.
# Submit the revision.


====Results====
====Results====
637

edits