Commit Graph

9 Commits

Author SHA1 Message Date
Jun Wu
effa0da8de test-helpers: add a helper to run test using chg
Summary:
The helper could be used in individual tests to enable chg if chg exists.
This allows us to have more precise control on what tests to use chg instead
of using a global flag in run-tests.py.

This makes certain tests containing many hg commands much faster. For example,
`test-revset.t` took 99 seconds before:

  % ./run-tests.py test-revset.t --time
  .
  # Ran 1 tests, 0 skipped, 0 failed.
  # Producing time report
  start   end     cuser   csys    real      Test
    0.000  99.990  86.410  12.000  99.990   test-revset.t

And 10 seconds after:

  % ./run-tests.py test-revset.t --time
  .
  # Ran 1 tests, 0 skipped, 0 failed.
  # Producing time report
  start   end     cuser   csys    real      Test
    0.000  10.080   0.380   0.130  10.080   test-revset.t

Also enable it for some other tests. Note the whitelist is not complete.  We
probably want to whitelist more tests in the future.

The feature could be opted out by deleting `contrib/chg/chg`.

Reviewed By: phillco

Differential Revision: D6767036

fbshipit-source-id: 8220cf408aa198d5d8e2ca5127ca60e2070d3444
2018-04-13 21:50:54 -07:00
Augie Fackler
7d54ffa7a4 tests: use readlink.py instead of readlink
The latter doesn't always exist, such as on Solaris-derived platforms.

Differential Revision: https://phab.mercurial-scm.org/D996
2017-10-10 11:02:23 -04:00
David Soria Parra
34b35d6c71 convert: parse perforce data on-demand
We are using read-only attributes that parse the perforce data on
demand. We are reading the data only once whenever an attribute is
requested and use it throughout the import process. This is equivalent
to the previous behavior, but we are avoiding reading from perforce when
we initialize the object, but instead run it during the actual import
process, when the first attribute is requested (usually getheads(), see
`convertcmd.convert`).
2016-12-20 09:23:50 -08:00
FUJIWARA Katsunori
1aa9be7b1f tests: fix for failure of test-convert-p4-filetypes.t
Before this patch, test-convert-p4-filetypes.t fails (at least with
2015.2/1366233 version of p4/p4d), because some files below are
omitted in expected output for revision 1.

  - file_tempobj
  - file_xtempobj

These files are:

  - add-ed at revision 0, and
  - edit-ed at revision 1

According to perforce command reference below, file type 'tempobj' and
'xtempobj' imply '+S' modifier, which indicates that "Only the head
revision is stored". This means that these files should appear only in
the most recent revision (= revision 1).

    https://www.perforce.com/perforce/doc.current/manuals/cmdref/file.types.html

BTW, test-convert-p4-filetypes.t with 2015.2/1366233 version of p4/p4d
fails similarly also at recent revisions for hgext/convert/p4.py in
2015. Therefore, this patch should be reviewed by perforce guru, to
examine whether this failure depends on version (and/or configuration)
of p4/p4d or not.
2016-03-26 12:55:52 +09:00
Augie Fackler
a5ddb1dcfe tests: use $PYTHON instead of hardcoding python
This makes running the testsuite with pypy possible.
2014-10-15 15:35:59 -04:00
Mads Kiilerich
9313be1c56 tests: fix p4 tests so they use separate ports and can be run in parallel 2014-08-25 03:27:51 +02:00
Matt Mackall
11be5cc27c tests: replace exit 80 with #require 2014-08-06 11:43:59 -05:00
Thomas Arendsen Hein
1dffad0c67 tests: remove execute permission from two unified test files 2012-06-20 17:04:30 +02:00
Mads Kiilerich
80eee013e1 tests: unify the last sh tests
This requires a slightly smarter check-code check for sed output filtering.
2012-04-25 01:35:39 +02:00