Version 10 (modified by cotto, 4 years ago)

add incomplete test for ambiguous git ids

The GitHub Trac plugin doesn't come with any test suite, so the purpose of this page is to create a list of manual tests. This will give us some level of QA that the plugin conforms to a minimal level of quality in addition to serving as a list of features which have been successfully implemented.

Setup

<Insert setup instructions here. Postgres is preferable since that's what trac.parrot.org is running on.>

Test Results

test status at  25c365
clean install (enabled) PASS
clean install (disabled) PASS
incorrect revmap PASS
tooltips FAIL*
wiki syntax PASS
changeset urls PASS
github hook FAIL
ambiguous commit id

* No long tooltips were displayed.

Test Cases

When running these test cases, use the below generic configuration options unless otherwise specified.

[github]
apitoken = <your token here> #get this from https://github.com/account
autofetch = 0
browser = http://github.com/parrot/parrot/commit/
closestatus = "closed"
enable_revmap = 1
long_tooltips = 1
svn_revmap = revmap

clean install (enabled)

The plugin can be installed onto a db which doesn't have an existing svn_revmap table.

Procedure:

  1. Start with the generic config options.
  2. Create a revmap file by running git log --quiet --format='%H%n%s%n%b'>/path/to/trac/root/revmap from a clone of Parrot's git repo.
  3. Delete the svn_revmap db table, if it exists.
  4. Enable the plugin via Trac's config file (or via trac.ini).
  5. Verify that Trac shows the need for an upgrade.
  6. Upgrade Trac.
  7. Verify that Trac no longer needs to be upgraded.

clean install (disabled)

The plugin doesn't require the extra db table if revmaps are disabled.

Procedure:

  1. Start with the generic config options, but with enable_revmap = 0.
  2. Delete the svn_revmap db table, if it exists.
  3. Enable the plugin via Trac's config file (or via trac.ini).
  4. Verify that Trac does not need to be upgraded

incorrect revmap

The plugin will fail gracefully if the revmap is broken.

Procedure:

  1. Start with the generic config options.
  2. Delete the svn_revmap db table, if it exists.
  3. Enable the plugin via Trac's config file (or via trac.ini).
  4. Generate a revmap ( git log --quiet --format='%H%n%s%n%b' ), but delete instances of "git-svn-id:".
  5. Verify that an upgrade does not produce corrupt data. *. Note that throwing an exception is fine, as long as no bad data is added to the database.

tooltips

The plugin will properly display tooltips according to configuration.

Procedure:

  1. Start with the generic config options.
  2. Create or view a wiki page with valid svn revisions and git ids.
  3. Verify that the wiki syntax works and that tooltips are displayed.
  4. Change the "long_tooltips" config option to 0 and restart Trac.
  5. Verify that truncated tooltips are displayed.

wiki syntax

The plugin will properly detect and display svn and git links.

Procedure:

  1. Start with the generic config options.
  2. Create or view a wiki page with valid and invalid svn revisions and git ids.
  3. Verify that the valid links are displayed as links.
  4. Verify that the invalid links are displayed unchanged.

changeset urls

The plugin will properly redirect changeset urls to GitHub.

Procedure:

  1. Start with the generic config options.
  2. Create or view a wiki page with valid svn revisions and git ids.
  3. Verify that the git ids redirect the appropriate commit at GitHub.
  4. Verify that the svn revisions redirect the appropriate git commit at GitHub. (look for the git-svn-id on the GitHub page)

github hook

The plugin responds correctly to GitHub's post-receive callback.

Procedure:

  1. Start with the generic config options.
  2. Get an example of the payload sent to a post-receive callback from  http://www.postbin.org/12dx3gx . Save it to a file and change one of the commit id and git-svn-id values to something unique (but still valid).
  3. Use curl to post the data to the github hook url: curl --data-urlencode payload@your_file_here http://localhost:8080/trac/test/github/APITOKEN (use the API token from github.apitoken in trac.ini)
  4. Create a wiki page that refers to the newly-added commit, both as a git id and a svn revision.
  5. Verify that the link to the commit is displayed correctly, including its tooltip.

ambiguous commit id

The plugin does something reasonable when the user attempts to link to a commit using an ambiguous prefix.

Procedure:

  1. Start with the generic config options.
  2. Inject commits with an ambiguous commit id into the db (or find some).
    • insert into svn_revmap (svn_rev, git_hash, commit_msg) VALUES (0, 'deadbeef100000000000000000000000000000000', 'ambiguous commit 1'), (0 , 'deadbeef200000000000000000000000000000000', 'ambiguous commit 2');
  3. Create or view a wiki page that refers to the above commits ambiguously.
  4. Verify that the page somehow indicates that the commit id is ambiguous.

TODO

  • browser url works