Commit Graph

560 Commits

Author SHA1 Message Date
Gregory Szorc
2703caf446 run-tests: move outputcoverage() into TestRunner 2014-04-19 23:49:23 -07:00
Gregory Szorc
49cdc11656 run-tests: move outputtimes() into TestRunner 2014-04-19 23:47:59 -07:00
Gregory Szorc
f60ca60f88 run-tests: move checkhglib into TestRunner 2014-04-19 23:44:56 -07:00
Gregory Szorc
105c9c2fc1 run-tests: move installhg() into TestRunner 2014-04-19 23:43:00 -07:00
Gregory Szorc
023fa479ff run-tests: move createdfiles out of a global and into TestRunner 2014-04-19 23:39:38 -07:00
Gregory Szorc
a24163eef4 run-tests: move usecorrectpython() into TestRunner 2014-04-19 23:38:10 -07:00
Gregory Szorc
88e6be733b run-tests: move cleanup() into TestRunner 2014-04-19 23:35:27 -07:00
Gregory Szorc
e74d6a9170 run-tests: add options to runner 2014-04-19 23:33:44 -07:00
Gregory Szorc
691c3d4a63 run-tests: add options to runner 2014-04-19 23:28:59 -07:00
Gregory Szorc
fbb4e07860 run-tests: move COVERAGE_FILE out of a global 2014-04-19 23:27:11 -07:00
Gregory Szorc
cb55575cbf run-tests: move PYTHONDIR out of a global 2014-04-19 23:26:15 -07:00
Gregory Szorc
cd540cf8ab run-tests: move TMPBINDIR out of a global 2014-04-19 23:24:39 -07:00
Gregory Szorc
0b30c04fca run-tests: move BINDIR out of a global 2014-04-19 23:22:47 -07:00
Gregory Szorc
e4684a44f0 run-tests: move INST out of a global 2014-04-19 23:20:42 -07:00
Gregory Szorc
985af7905a run-tests: move HGTMP out of a global 2014-04-19 23:19:23 -07:00
Gregory Szorc
43a68f701f run-tests: move TESTDIR out of a global
This patch starts the process of removing global variables from
run-tests.py. The goal of this is to make it easier to run tests
differently without having to concern yourself with global state.
2014-04-19 23:15:24 -07:00
Gregory Szorc
6ac2fa2ac5 run-tests: establish a class to hold testing state 2014-04-19 23:07:17 -07:00
Gregory Szorc
a557fd6847 run-tests: refactor runone() into gettest() and scheduletests()
runone() has been removed. Replacing it are gettest() (which returns a
Test instance) and a small amount of boilerplate in scheduletests().
2014-04-19 22:02:55 -07:00
Gregory Szorc
cf638dcc58 run-tests: move computation of test paths into Test.__init__ 2014-04-19 21:53:15 -07:00
Gregory Szorc
2c78c23435 run-tests: move logging of test start into Test.run() 2014-04-19 21:50:23 -07:00
Gregory Szorc
0e7ab8a4df run-tests: remove remaining uses of TestResult 2014-04-19 21:21:57 -07:00
Gregory Szorc
a9a228cd32 run-tests: move output writing to Test.run() 2014-04-19 21:17:39 -07:00
Gregory Szorc
23754a084d run-tests: move err file saving to Test.run() 2014-04-19 21:14:31 -07:00
Gregory Szorc
d8e59715bf run-tests: emit exception failure result from Test.run() 2014-04-19 21:10:22 -07:00
Gregory Szorc
ac40d2296a run-tests: move test name filter to Test.run() 2014-04-19 21:08:03 -07:00
Gregory Szorc
266111b2d1 run-tests: move keyword processing into Test.run() 2014-04-19 21:05:50 -07:00
Gregory Szorc
d1cef4a6a1 run-tests: move retesting result to Test.run() 2014-04-19 21:04:08 -07:00
Gregory Szorc
e8004cbf37 run-tests: move blacklist skipping to Test.run() 2014-04-19 21:02:51 -07:00
Gregory Szorc
29ec1e08f4 run-tests: check for test file existence in Test.run()
We delay this a little bit. But it shouldn't really matter when the
check is performed.
2014-04-19 21:00:24 -07:00
Gregory Szorc
54e9611a41 run-tests: move remaining result processing to Test.run() 2014-04-19 20:53:45 -07:00
Gregory Szorc
49fbb46418 run-tests: move output difference processing to Test.run() 2014-04-19 20:52:58 -07:00
Gregory Szorc
fe13f7598d run-tests: generate timeout result in Test.run() 2014-04-19 20:48:16 -07:00
Gregory Szorc
3573cbd388 run-tests: add skip processing to Test 2014-04-19 20:47:14 -07:00
Gregory Szorc
d792278ce6 run-tests: move fail() into Test
The code was changed slightly as part of the migration to make use of
appropriate variables and modern Python conventions.
2014-04-19 20:41:08 -07:00
Gregory Szorc
42a72930a7 run-tests: move success() into Test 2014-04-19 20:35:54 -07:00
Gregory Szorc
8fab6ea01c run-tests: move err path handling to Test 2014-04-19 20:32:38 -07:00
Gregory Szorc
0dcb1a6ed2 run-tests: handle interrupted in Test.run() 2014-04-19 20:27:18 -07:00
Gregory Szorc
ddc2d7190f run-tests: kill daemons during Test.cleanup()
As a safety precaution, we kill daemons in Test.cleanup(). This is
necessary for a subsequent patch that will reraise KeyboardInterrupt
before killdaemons() runs as part of run().
2014-04-19 20:22:32 -07:00
Gregory Szorc
aa0568676a run-tests: capture reference output in Test.__init__
Reference output should be constant and doesn't need to be computed at
test execution time. We calculate it earlier.

This patch is the first in a mini series that will change how the
TestResult object works.
2014-04-19 18:50:40 -07:00
Gregory Szorc
c3bcf32fc2 run-tests: make globmatch a static method of TTest 2014-04-19 16:14:30 -07:00
Gregory Szorc
1b34005cfc run-tests: make rematch a static method of TTest 2014-04-19 16:13:02 -07:00
Gregory Szorc
19099dc4f1 run-tests: make linematch a static method of TTest
linematch only applies to t tests. It makes sense to move everything t
test related to the TTest class.
2014-04-19 16:11:49 -07:00
Gregory Szorc
df67209088 run-tests: finish moving tsttest() into TTest 2014-04-19 15:37:50 -07:00
Gregory Szorc
044e5b3e56 run-tests: move t test execution from tsttest() to TTest.run()
After this patch, tsttest() only contains output/result processing.
2014-04-19 15:28:31 -07:00
Gregory Szorc
21e213cf15 run-tests: move t test parsing into its own function
Test parsing is somewhat complicated. This patch extracts it into its
own function.

The impetus of this patch is folding tsttest() into the TTest class.
Subsequent patches will continue this work until tsttest() no longer
exists.
2014-04-19 15:19:28 -07:00
Gregory Szorc
4018f371bc run-tests: roll pytest() into PythonTest._run()
Python was the old runner function. It no longer needs to exist since
the PythonTest class took its job.
2014-04-19 14:54:04 -07:00
Gregory Szorc
bd0b5555d2 run-tests: remove threadtmp in Test.cleanup()
threadtmp is an implementation detail. We move the cleanup of this
directory to Test.cleanup() and make the variable internal. The
cleanup function will eventually disappear into unittest machinery.
2014-04-19 14:51:43 -07:00
Gregory Szorc
5b6c781b5d run-tests: allow Test.run() to run multiple times
Test.run() can now be executed multiple times on the same Test instance.
This feature is currently unused and there are no plans to implement it.
The main reason for this work was to refactor testtmp, replacements, and
env to be run-time specific as opposed to Test instance specific.
2014-04-19 14:47:34 -07:00
Gregory Szorc
d9fcd5b2f9 run-tests: capture reference output in TestResult class 2014-04-19 14:09:46 -07:00
Gregory Szorc
c1c96a878a run-tests: give TestResult a skipped attribute 2014-04-19 14:01:18 -07:00
Gregory Szorc
d1e8b83b37 run-tests: pass TestResult into run() 2014-04-19 18:31:22 -07:00
Gregory Szorc
ce51eb2ab0 run-tests: capture execution results in a TestResult class
Some implementation details of test execution still live outside of
Test. These include determining what a result means and cleaning up
after the test.

To move to the world where more of this logic can live inside Test or a
derived object, the logic for test execution needs to be refactored.
Specifically, exception trapping and opportunities for result processing
need to be moved into Test.

This patch starts the process by establishing a TestResult class for
holding the results of a test execution. In order to actually use this
class, exception trapping and execution time recording needed to be
moved into Test.run().
2014-04-19 13:50:25 -07:00
Gregory Szorc
03c657bc26 run-tests: clean up temp directory variables
testtmp is an implementation detail. It didn't need to be exposed to the
world.

threadtmp is derived from count. It is now created as part of the
constructor and mostly hidden from the outside world.
2014-04-19 13:29:26 -07:00
Gregory Szorc
b3a4d844b0 run-tests: move env into Test
Environment variables are an implementation detail of how tests are
executed. This patch moves environment variable logic into Test and
completely hides it from the outside.

With this patch, a Test can be executed with two lines: init + run().
Tests are still single-use and take a more arguments to the constructor
than likely necessary. These will get addressed in subsequent patches.
2014-04-19 13:26:12 -07:00
Gregory Szorc
d49f5e6aff run-tests: move killdaemons into Test.run()
killdaemons() was the only part of runone() looking at env variables. We
move killdaemons() into Test.run() to enable us to fully move env into
Test.
2014-04-19 13:22:52 -07:00
Gregory Szorc
f33e67ce74 run-tests: move replacements and port management into Test
replacements and ports are really implementation details of a Test. They
have been moved to instance variables.
2014-04-19 13:18:55 -07:00
Gregory Szorc
4a6575aeb5 run-tests: move createhgrc() call into Test.run()
createhgrc() is an implementation detail of how tests are run. It makes
sense to move it into Test.run().

Note that this will cause the test execution time to include the
creation of hgrc. The author does not believe this is a significant
change worth worrying about.
2014-04-19 13:11:49 -07:00
Gregory Szorc
c8d17d56b0 run-tests: move createenv() into Test
createenv() is consulting lots of test-specific variables. It makes
sense to attach it to the Test class.
2014-04-19 13:07:05 -07:00
Gregory Szorc
baae441146 run-tests: move replacements generation into Test
The API is a bit funky. Things will look better once all state is
captured in Test.
2014-04-19 13:03:24 -07:00
Gregory Szorc
37bc48e832 run-tests: move testtmp into Test class
This patch starts the process of moving test-specific variables into the
Test class. The ultimate goal is to be able to instantiate a Test with
minimal arguments and to call run() on it without too much thinking.
This will make it much easier to run tests from other contexts. It will
also enable things like running a test multiple times.
2014-04-19 12:54:09 -07:00
Gregory Szorc
b01959b720 run-tests: create classes for representing tests
Currently, the state for an individual test is scattered across a number
of functions and variables. This patch begins a process of isolating a
single test's state into instances of a class. It does this by
establishing a new Test base class and child classes for Python tests
and T tests. The class currently has a run() API that proxies into the
existing "runner" functions. Upcoming patches will move the logic for
each test type into the class.
2014-04-19 12:26:34 -07:00
Yuya Nishihara
50920757c6 run-tests: initialize global variables to suppress pyflakes warning 2014-05-02 18:25:23 +09:00
Mads Kiilerich
0e8795ccd6 spelling: fixes from spell checker 2014-04-13 19:01:00 +02:00
Mads Kiilerich
56bd029861 tests: warn on invalid #if directive 2014-04-13 19:01:00 +02:00
Simon Heimberg
584b6544fe run-tests: test result shows when a failed test could not start a server
Failing to start a server happens regularly, at least on windows buildbot.
Such a failure often has nothing to do with the test, but with the environment.
But half the test output can change because some data is missing. Therefore this
is worth an extended error message.

Detect the server failure in the diff output because it is most reliable
there. Checking the output only does not show if the server failure was
expected.

 Old failure message when server start failed:
Failed test-serve.t: output changed

 New message:
Failed test-serve.t: serve failed and output changed
2013-11-25 22:00:46 +01:00
Gregory Szorc
a283450c0f run-tests: allow test paths in other directories
Previously, test paths were assumed to be in the same directory and
wouldn't have a directory component. If a path with a directory
component was specified, it would be filtered out. This change allow
paths to contain directories. This in turn allows tests from other
directories to be executed.

Executing tests in other directories may break assumptions elsewhere in
the testing code. However, on initial glance, things appear to "just
work." This approach of running tests from other directories is
successfully being used at
https://hg.mozilla.org/hgcustom/version-control-tools/file/7085790ff3af/run-mercurial-tests.py
2014-03-24 22:12:37 -07:00
Gregory Szorc
c299dbb10c run-tests: allow option parser to be extended
This patch moves the OptionParser population into its own function so
consumers may modify the OptionParser before arguments are evaluated.
This will allow consumers to add custom options, set different defaults,
etc.
2014-03-24 21:52:28 -07:00
Gregory Szorc
f33d6c4e65 run-tests: use return values instead of sys.exit 2014-03-24 21:41:56 -07:00
Gregory Szorc
2ae9bd8d6c run-tests: Pass arguments into argument parser
Before, arguments were not passed into the optparse.OptionParser
instance and were coming from sys.argv. This patch enables consumers to
define the list of arguments to parse without having to adjust sys.argv.
2014-03-24 21:37:33 -07:00
Mads Kiilerich
6a1dd62dee tests: add run-tests --changed option for running tests changed in revisions
Convenient when polishing patches and changing details of how they change test
output.

This will probably break in weird ways for revsets with special quoting ... but
it is good enough for run-tests.

Usage example:
  yes | ./run-tests.py -li --changed qparent
2014-02-28 02:09:00 +01:00
Mads Kiilerich
9617b497ff tests: small refactoring of run-tests' handling of tests list 2014-03-19 00:19:54 +01:00
Augie Fackler
1960bb215f run-tests: move from dict() construction to {} literals
The latter are both faster and more consistent across Python 2 and 3.
2014-03-12 13:19:43 -04:00
Matt Mackall
66c8bd54e8 extensions: remove the inotify extension (BC)
This extension has always had correctness issues and has been
unmaintained for years. It is now removed in favor of the third-party
hgwatchman which is maintained and appears to be correct.

Users with inotify enabled in their config files will fall back to
standard status performance.
2014-03-01 16:20:15 -06:00
Simon Heimberg
66d9266de8 run-tests: fixed warn detection on failures with too many output
The state "warned" was reported too often. The problem fixed here is that
warnonly was only reset when a line did not match. When there was a line too
much, warnonly remained set.
Fix this by setting more states to warnonly.

More negative testing (testing on result "Failed") has been done this time.
2014-02-16 23:41:24 +01:00
Simon Heimberg
f532046c29 run-tests: fixed warn detection on detecting warn only for lines
The state "warned" was reported too often. The main problem was that
"False == 0" is true in python. Therefore use an empty string instead of 0
for reporting warn only for a line.
The other problem is fixed in the next patch.
2014-02-16 23:36:02 +01:00
Siddharth Agarwal
1f2e1568a5 run-tests.py: work when --with-hg is set to system hg
Previously we'd always assume that --with-hg is a script in a user directory,
and would write out a 'python' symlink to the same location. That didn't work
if --with-hg was set to a system installation of hg, e.g. /usr/bin/hg.

Introduce a TMPBINDIR directory which is used to write out the python symlink.
2014-02-19 21:32:14 -08:00
Patrick Mezard
5bf3ef6c1b run-tests: fix heredoctest for out-of-tree extensions
heredoctest.py directory must be in python path to use heredoctest (>>>) in
out-of-tree extension tests like:

  $ cd ext/tests
  $ python /some/hg/install/tests/run-tests.py test-ext.t
2014-02-15 15:28:32 +01:00
Simon Heimberg
b2a439bb78 run-tests: unnecessary globs also count as warnings
When a glob is unnecessary, now there's a diff output and 'run-tests.py -i'
works for accepting the output.
On windows, some tests which have "passed" currently (with some info lines
printed) will now be reported as "warned". (I recommend to recognize "warned"
by buildbot before applying this patch.)
2014-02-13 08:29:44 +01:00
Simon Heimberg
1e51f26c6e run-tests: report a test as warned when only missing globs
On windows, some test reported as failed will now be reported as "warned".
2014-02-13 08:27:53 +01:00
Simon Heimberg
434d0f2c98 run-tests: add possibility for test-runners to report a "warned" test result
A test result is recognized as "warned" when the test runner returns the exit
code False. (False is similar to 0, which is reporting a command has run
sucessfully.)

The only difference in display is that the failure message while running writes
"Warning:" instead of "ERROR:". The diff output is the same as when the test
fails. Runing "run-tests.py -i" asks to accept the changed result also for
tests reported as "warned".

When running tests, a "warned" test would look like this:
..
 --- xxxx\tests\test-something.t
 +++ xxxx\tests\test-something.t.err
@@ -1279,7 +1279,7 @@
   $ echo anything
   $ hg commit -S -m whatever
   committing subrepository s
-  committing subrepository s/sbs
+  committing subrepository s/sbs (glob)
   warning: something happened
   committing subrepository t
   $ echo something

Warning: xxxx\tests\test-sOMETHING.t output changed
~.s...s...s..


Reporting a test result as "warned" will be used in following patches.
2014-02-13 08:26:13 +01:00
Simon Heimberg
11e4ef2216 run-tests: separate exit code when no failed tests but warned ones
This can be used by buildbot to set the result "warnings" instead of "failed".
2014-02-13 08:17:39 +01:00
Simon Heimberg
8864ac070e run-tests: introduce 'warned' as test result
While running, a test resulting in 'warned' is shown as '~'.
Test results with state warned are listed between the skipped and the failed
tests. Example:
Skipped test-revert-flags.t: missing feature: executable bit
Skipped test-inotify-lookup.t: missing feature: inotify extension support
Warned test-something.t: output changed
Failed test-largefiles.t: output changed
Failed test-subrepo.t: output changed
# Ran 11 tests, 2 skipped, 1 warned, 2 failed.


The test result "warned" will be used in later patches.
2014-02-13 08:14:54 +01:00
Simon Heimberg
9463ba6189 run-tests: handle sys.exit in main function 2014-02-13 08:02:06 +01:00
Simon Heimberg
073dd453ab run-tests: remove unnecessary variable initialisation
ret is always set before it is used, so remove ret = 0
2014-02-13 07:29:28 +01:00
Simon Heimberg
9d8139803a run-tests: fix typo and print out failing line
Instead of stripping the newline and printing the line, only the newline was
printed.
The output on buildbot will make more sense now.
2014-02-11 01:15:07 +01:00
Simon Heimberg
14f515afb4 run-tests: print more information on unnecessary glob matching
Extend the message with the test name and the approximate line number. (The
line number is the one of the command producing the output.)
Finding the line to fix is easier now.

old message:
......
Info, unnecessary glob: at a/b/c (glob)
..

new message:
......
Info, unnecessary glob in test-example.t (after line 9): at a/b/c (glob)
..


The test result is still pass as before.
2014-01-16 12:08:57 +01:00
Simon Heimberg
2967b15687 run-tests: suggest to append glob when only path sep does not match
When the line does not match because of \ instead of / (on windows), append
(glob) in the expected output.
This allows to rename test-bla.t.err to test-bla.t for getting a correct
output. This worked for other failures like missing (esc), but not here.

  Output example (only +- lines of diff):
Before:
-  path/with/local/sep
+  path\\with\\local/sep
Now:
-  path/with/local/sep
+  path/with/local/sep (glob)
2014-01-16 12:08:29 +01:00
Simon Heimberg
ee6f6f78e3 run-tests: test each line matching function on its own
This has several advantages.
 * Each match function can return some information to the caller runone (used in
   the next patch).
 * It is not checked that the line ends in " (glob)" when rematch() returns
   false.
 * And it looks more readable.
2014-01-16 12:06:49 +01:00
Simon Heimberg
4367a66877 run-tests: set the thread name to the test name for info on error
This does not happen when running normal. But when fiddling around with
the test infrastructure, this helps a lot.

  Old traceback messge
Exception in thread Thread-7:
Traceback (most recent call last):
...

  new traceback message
Exception in thread test-something.t:
Traceback (most recent call last):
...
2014-01-16 11:26:54 +01:00
Simon Heimberg
eff53c5d86 run-tests: report tests as failed when run-test raises an error
Before no message was returned to the main thread. No result was registered
and no new thread was started.
This does not happen when running normal. But when fiddling around with
the test infrastructure, this helps a lot.
2014-01-16 18:55:35 +01:00
Simon Heimberg
d4d6543b3a run-tests: better check for python version
Compare version by using pythons tuple comparison. So we do not match on python
3.0 or newer.
2013-11-25 22:00:46 +01:00
Mads Kiilerich
ca46558bdd tests: python hash seed is only relevant after failures - otherwise keep quiet 2013-11-17 10:59:35 -05:00
Sean Farley
2ced3aebc5 run-tests: remove files that we potentially create outside of $TMPDIR 2013-11-15 22:57:11 -05:00
Sean Farley
1c3131bb1b run-tests: remove code that creates a dummy 'diffstat'
This was introduced in 23816898bed5 for an old test that is no longer the same.
2013-11-15 22:56:08 -05:00
Mads Kiilerich
8c414ba152 run-tests: place the .t shell script next to $TESTTMP and with a useful name
--keep can thus keep it around - very convenient for debugging.
2013-10-03 14:50:47 +02:00
David Soria Parra
72600cc4d7 shelve: add a shelve extension to save/restore working changes
This extension saves shelved changes using a temporary draft commit,
and bundles the temporary commit and its draft ancestors, then
strips them.

This strategy makes it possible to use Mercurial's bundle and merge
machinery to resolve conflicts if necessary when unshelving, even
when the destination commit or its ancestors have been amended,
squashed, or evolved. (Once a change has been unshelved, its
associated unbundled commits are either rolled back or stripped.)

Storing the shelved change as a bundle also avoids the difficulty
that hidden commits would cause, of making it impossible to amend
the parent if it is a draft commits (a common scenario).

Although this extension shares its name and some functionality with
the third party hgshelve extension, it has little else in common.
Notably, the hgshelve extension shelves changes as unified diffs,
which makes conflict resolution a matter of finding .rej files and
conflict markers, and cleaning up the mess by hand.

We do not yet allow hunk-level choosing of changes to record.
Compared to the hgshelve extension, this is a small regression in
usability, but we hope to integrate that at a later point, once the
record machinery becomes more reusable and robust.
2013-08-29 09:22:13 -07:00
Augie Fackler
3f08f4aa32 run-tests: find mercurial path with syntax valid on both py2 and py3 2013-09-19 15:29:28 -04:00
Augie Fackler
a4c5cf3750 run-tests: if run by python3, execute setup.py with --c2to3 2013-09-19 15:29:04 -04:00
Simon Heimberg
96b55afc5a run-tests: only check the common criteria once per test 2013-07-26 21:18:40 -04:00
Matt Mackall
d64dd7b443 run-tests: backout a71b92f5b8d5 line endings change
It made the windows buildbot sad.
2013-07-18 23:22:59 -05:00
Brendan Cully
b22788d1aa run-tests: revert previous commit, run() waits after a timeout 2013-07-18 09:42:44 -07:00
Brendan Cully
ec9f9a7a0f run-tests: reap timed-out zombies 2013-07-18 09:39:01 -07:00
Simon Heimberg
690fb7f82d run-tests: generally handle line endings on windows by re
Recently this regexp was only appended when running a python test. When running
a tsttest there was a separate handling for each line type. Simplify and unify
this.
2013-07-13 23:58:01 +02:00
Simon Heimberg
2fc2f7ad2e run-tests: test for os.altsep instead of os.name when checking \ for /
This tells more explicitly what it is about
2013-07-13 23:57:55 +02:00
Brendan Cully
4e99027450 run-tests: replace popen locking with a noop _cleanup handler on py24
This also avoids the race condition, and isn't detrimental to job scheduling.
2013-07-17 13:42:08 -07:00
Brendan Cully
f3860d2150 run-tests: only lock Popen wait/poll on python 2.4
It can cause scheduling bubbles and is not necessary on newer pythons.
2013-07-17 13:02:12 -07:00
Brendan Cully
90d44a096b run-tests: lock popen wait/poll
In python2.4, any call to Popen() may attempt to wait on any active
process, and wait is not thread-safe. Make it thread-safe.
See http://bugs.python.org/issue1731717 for details.
2013-07-17 12:45:12 -07:00
Matt Mackall
14f333f579 run-tests: patch over py2.4 proc.wait() race 2013-07-16 12:44:11 -05:00
Simon Heimberg
8a32578a00 cleanup: remove unused imports
detected by pyflakes
2013-06-13 01:36:58 +02:00
simon@laptop-tosh
e5622bbc0e run-tests: sort missing files first instead of raising an error
sort first for early telling typos in test names
2013-06-11 23:39:48 +02:00
simon@laptop-tosh
975f5dea4c run-tests: call Threads constructor with keyword arguments
This is suggested in the python documentation
(on http://docs.python.org/2/library/threading.html#thread-objects)
2013-06-09 16:49:08 +02:00
simon@laptop-tosh
400b5ef2b9 run-tests: ignoring tests works again
running with --retest did not work anymore because runone still returned None
for this case. But this is not allowed since a204317f039b.
2013-06-09 16:42:55 +02:00
Matt Mackall
2a02cc28af run-tests: simplify interrupted message 2013-06-07 16:04:11 -05:00
Matt Mackall
df0aab998a run-tests: remove spurious disable of --time with --debug 2013-06-07 15:58:14 -05:00
Matt Mackall
5a359facfe run-tests: always gather runtimes 2013-06-07 15:56:16 -05:00
Simon Heimberg
cbe95e49e5 run-tests: when interrupted report time in failure message
When --time is specified, the interruption message of an interrupted test is
extended with the time the test has run

INTERRUPTED: /path/to/tests/test-example.t (after 513 seconds)
2013-06-05 22:05:29 +02:00
Simon Heimberg
3d444f656b run-tests: report interrupted tests
When the test run is aborted, a message is printed for each interrupted test.
This is helpful when a test is hanging.

example failure message:
INTERRUPTED: /path/to/tests/test-example.t

The message can appear before or after the line with the number of tests
2013-06-05 22:05:02 +02:00
Simon Heimberg
43548443c6 run-tests: open hgrc file only for writing
The file is not read here. Opening with "w+" is unnecessary.
2013-06-05 22:42:43 +02:00
Matt Mackall
bf221e220d run-tests: make --noskips work 2013-06-06 14:40:26 -05:00
Matt Mackall
4ee271c45d run-tests: add --loop support
This makes it easy to run tests repeatedly at high loads to look for test failures.
2013-06-02 18:09:06 -05:00
Matt Mackall
177f6f2cb0 run-tests: --interactive and --jobs no longer conflict 2013-06-02 17:58:51 -05:00
Matt Mackall
c5fd75f600 run-tests: sort certain slow tests earlier by keyword
There are a few tests that evade the size heuristic
2013-06-02 17:58:49 -05:00
Matt Mackall
8481b7ff76 run-tests: drop unused resultslock 2013-06-02 17:57:37 -05:00
Matt Mackall
438cc52b80 run-tests: drop options.child and users 2013-06-02 17:57:36 -05:00
Matt Mackall
66a2eb9cb9 run-tests: remove runchildren, now unused 2013-06-02 17:56:53 -05:00
Matt Mackall
9f730ea353 run-tests: schedule largest tests first 2013-06-02 17:56:51 -05:00
Matt Mackall
3a93b9c7d3 run-tests: introduce thread scheduler 2013-06-02 16:58:22 -05:00
Matt Mackall
532173d915 run-tests: use count to calculate port to use
This will keep threads from using the same server ports
2013-06-02 16:55:19 -05:00
Matt Mackall
8fbe5c7e8f run-tests: introduce threadtmp directory 2013-06-02 16:38:15 -05:00
Matt Mackall
c9da438759 run-tests: add abort flag
This will be used to help threads clean up gracefully
2013-06-02 16:29:35 -05:00
Matt Mackall
cc7f14311d run-tests: move more variables to env 2013-06-02 16:29:22 -05:00
Matt Mackall
fc271a759c run-tests: simplify env deletion 2013-06-02 16:29:20 -05:00
Matt Mackall
488a78e3ca run-tests: move most of remaining environment tweaks 2013-06-02 16:22:51 -05:00
Matt Mackall
95e4c8b6bf run-tests: move environment creation to a separate function 2013-06-02 16:22:51 -05:00
Matt Mackall
19ab24f165 run-tests: move HGRCPATH to env 2013-06-02 16:22:51 -05:00
Matt Mackall
5fc51a32ce run-tests: move DAEMON_PIDS to env 2013-06-02 16:22:51 -05:00
Matt Mackall
8c77edfd66 run-tests: move HGPORT setting to env 2013-06-02 16:22:34 -05:00
Matt Mackall
f3e5fe5277 run-tests: write tmp paths into env copy 2013-06-02 15:33:41 -05:00
Matt Mackall
5417598833 run-tests: use env dict to kill daemons 2013-06-02 14:04:55 -05:00
Matt Mackall
fc7662fd0d run-tests: add env dict to isolate test environment 2013-06-02 13:45:08 -05:00
Matt Mackall
38303ad1d7 run-tests: remove some unnecessary globals 2013-05-27 15:24:19 -05:00
Matt Mackall
65bbf02e19 run-tests: add a log function 2013-05-24 14:30:43 -05:00
Matt Mackall
0bef60f271 run-tests: make vlog a proper function 2013-05-24 14:30:43 -05:00
Matt Mackall
60b62579bb run-tests: unify marks and result codes 2013-05-24 14:30:43 -05:00
Matt Mackall
c97fde7db9 run-tests: change return code of runone 2013-05-24 14:30:35 -05:00
Matt Mackall
9dccd87998 run-tests: regroup some initialization checks 2013-05-24 13:53:56 -05:00
Matt Mackall
fde01215f9 run-tests: fix a path existence check 2013-05-24 13:52:05 -05:00
Matt Mackall
8bd32fc6fa run-tests: regroup some variable initialization 2013-05-24 13:51:20 -05:00
Matt Mackall
037d2bf78a run-tests: regroup nested functions 2013-05-24 13:48:25 -05:00
Matt Mackall
f100d35303 run-tests: regroup temp dir creation 2013-05-24 13:47:17 -05:00