Merge lp:~jtv/launchpad/standard-test-template into lp:launchpad

Proposed by Jeroen T. Vermeulen
Status: Merged
Approved by: Jeroen T. Vermeulen
Approved revision: no longer in the source branch.
Merged at revision: 11151
Proposed branch: lp:~jtv/launchpad/standard-test-template
Merge into: lp:launchpad
Diff against target: 18 lines (+3/-1)
1 file modified
buildout-templates/bin/lint.sh.in (+3/-1)
To merge this branch: bzr merge lp:~jtv/launchpad/standard-test-template
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+30193@code.launchpad.net

Commit message

Make test template testable; fix "make lint" for symlinks.

Description of the change

= Test Standard Test Template =

Now that the standard_test_template.py sample test contains an actual test class, we might as well include it in the test suite. It'll help us spot breakage that would otherwise be quiet, such as if we moved TestCase out of lib/lp/testing/__init__.py or put the layers in a different place.

Jono suggested that I do this by moving the template file into a testable location, and replace the original with a symlink to the test. (We also considered linking the other way, but that was less clear).

While doing this I noticed bug 606768: "make lint" breaks because it gets a list of changed files from "bzr st," and any symlinks in this list are tagged with a trailing @. I fixed that by filtering out trailing @ markers. I also verified that this still works when I edit one of the test GPG keys, which have a @ somewhere in the middle of the name.

To test,
{{{
./bin/test -vvc -m lp.testing.tests.test_standard_test_template
}}}

No lint, once I fixed lint.

Jeroen

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank Jeroen.

This looks good to land.

review: Approve (code)
Revision history for this message
Jeroen T. Vermeulen (jtv) wrote :

Thanks for the fast review. The other 7 lazy bastards I requested reviews from today were too busy flying home to do some work on Sunday. At least I can rely on you. :-)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildout-templates/bin/lint.sh.in'
2--- buildout-templates/bin/lint.sh.in 2010-07-06 13:16:00 +0000
3+++ buildout-templates/bin/lint.sh.in 2010-07-17 21:48:46 +0000
4@@ -50,7 +50,9 @@
5 # bzr diff failed
6 exit 1
7 fi
8- files=`bzr st --short $rev_option | sed '/^.[MN]/!d; s/.* //'`
9+ # Extract filename from status line. Strip the @ that mark symlinks.
10+ files=`bzr st --short $rev_option |
11+ sed -e '/^.[MN]/!d; s/.* //' -e 's/@$//'`
12 else
13 # Add newlines so grep filters out pyfiles correctly later.
14 files=`echo $* | tr " " "\n"`
15
16=== renamed file 'standard_test_template.py' => 'lib/lp/testing/tests/test_standard_test_template.py'
17=== added symlink 'standard_test_template.py'
18=== target is u'lib/lp/testing/tests/test_standard_test_template.py'