1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-10-24 17:48:50 +02:00
Commit graph

20 commits

Author SHA1 Message Date
epriestley
8fe38f8b6d Finalize Arcanist Classes
Summary:
Mark all applicable Arcanist classes as "final", except PhutilLintEngine, which
needs a little finesse.

@jungejason / @nh, does this break any Facebook stuff?

Test Plan: Linter no longer raises warnings. Ran "testEverythingImplemented" in
Phabricator.

Reviewers: btrahan, jungejason, nh

Reviewed By: btrahan

CC: aran, epriestley

Maniphest Tasks: T795

Differential Revision: https://secure.phabricator.com/D1519
2012-01-31 12:07:05 -08:00
epriestley
f3eccfbe81 Unify arguments for 'arc lint', 'arc unit'
Summary: See T645. These commands take inconsistent and overly-magical arguments
right now. Instead, make them behave consistently and allow them both to operate
on "arc <workflow> path path2 path3 ...", which is a generally useful workflow.

Test Plan: Ran "arc lint <path>", "arc unit <path>", "arc lint --rev
HEAD^^^^^^", "arc unit --rev HEAD^^^^^^^^^^^^", etc. Ran "arc diff --trace" and
verified --rev argument to child workflows.

Reviewers: btrahan, jungejason

Reviewed By: btrahan

CC: aran, epriestley, btrahan

Maniphest Tasks: T645

Differential Revision: https://secure.phabricator.com/D1348
2012-01-10 10:42:22 -08:00
epriestley
ca879150c8 Improve detection of invalid unit and lint engines
Summary: We fatal confusingly if you specify a valid class that isn't of the
right subclass (like a linter rather than a lint engine). Improve the error
message.

Test Plan:
  - Ran "arc lint --engine PhutilSymbolLoader", "arc unit --engine
PhutilSymbolLoader", got expected failures.
  - Ran "arc diff" normally without errors.

Reviewers: btrahan, jungejason, aran

Reviewed By: aran

CC: aran

Differential Revision: https://secure.phabricator.com/D1259
2011-12-21 09:02:04 -08:00
Jakub Vrana
647c047b3c Document paths parameter in arc unit
Summary:
arc unit supports paths parameter
It is not documented in arc help

Test Plan:
arc help
Search for unit

Reviewers: slawekbiel, aran

Reviewed By: aran

CC: aran, vrana

Differential Revision: 1143
2011-11-30 15:23:09 -08:00
mgummelt
3250cbb4d3 two small changes for "arc unit" post hook
Summary:
1) unit engine getter method in the unit workflow

   we store some information (unit test results) in the engine that we
   need to access in the "arc unit" post hook

2) make requireCleanWorkingCopy() public

   "arc unit" doesn't need to be clean in general, but we'd like the
   option to upgrade the workflow to require it if necessary.  We use
   this for ensuring a repo is clean before updating unit test
   results.

Test Plan: Used both features in a custom post hook in arc unit

Reviewers: epriestley

Reviewed By: epriestley

CC: dpepper, aran, epriestley

Differential Revision: 917
2011-09-08 18:25:54 -07:00
James Ide
2892c6ef1a Have Arcanist record how much of my life was spent running each unit test
Summary:
Keeping unit tests speedy keeps them useful since people actually won't mind
running them. This diff records the time taken by each test and displays it nice
and colorized. Really, I just want to discourage non-unit tests from making
their way into ##__tests__##.

Some thoughts:

 - The "acceptableness" times are subjective but if dependencies are properly
mocked the times seem to be ok. Integration tests that make network requests to
third-party endpoints and pull in megabytes of data will not survive. This is a
good thing.
 - Fast tests get a gold star, encouraging small tests. I am sorry that the star
does not sparkle.
 - There is no way for a programmer to admit that their test is going to be slow
in some cases. They will be shamed with red text for the life of their test.
 - It might be confusing that fast but failing tests get green text and maybe a
gold star.

Test Plan: Ran some of the unit tests within Arcanist and libphutil. See
https://secure.phabricator.com/file/view/PHID-FILE-cdd3c94c219e0fd7470b/ for
sample output.
Reviewed By: epriestley
Reviewers: epriestley
CC: aran, epriestley
Differential Revision: 588
2011-07-03 23:32:27 -07:00
tuomaspelkonen
42c6f00315 Let TestEngine know if the command that triggered tests is 'arc diff' or 'arc
unit'

Summary:
We want to handle 'arc unit' and 'arc diff' differently in our test
framework.

Test Plan:
Tested that with 'arc unit' the value was set to 'unit' and with 'arc diff'
the value was set to 'diff'.

Reviewed By: epriestley
Reviewers: slawekbiel, epriestley
CC: jungejason, grglr, aran, tuomaspelkonen, epriestley
Differential Revision: 430
2011-06-10 13:00:03 -07:00
tuomaspelkonen
dcc76bb58b Send postponed test results to differential.
Summary:
Differential showed 'okay' as the arc unit status even when there were
postponed tests.

Test Plan:
Tested that test results were pushed to differential when there were
postponed tests.

Reviewed By: jungejason
Reviewers: epriestley, jungejason
CC: slawekbiel, aran, jungejason
Differential Revision: 417
2011-06-09 10:29:54 -07:00
tuomaspelkonen
9b7ee674eb Child classes can prevent echoing test results.
Summary:
We changed our Facebook implementation to echo test results while the
tests are running. We do not want to echo the test results twice.

Test Plan:
Tested that implementing the function in PhutilUnitTestEngine and
returning true showed the results and returning false didn't show the
results.

Reviewed By: epriestley
Reviewers: jungejason, epriestley, grglr, slawekbiel
Commenters: slawekbiel, aran
CC: sgrimm, slawekbiel, aran, tuomaspelkonen, epriestley
Differential Revision: 400
2011-06-07 11:01:51 -07:00
epriestley
b763cecdb2 Use a consistent indent depth to display summary test results
Summary:
I typed the wrong number of spaces into some of these.

Test Plan:
Visual inspection, ran 'arc unit'

Reviewed By: tuomaspelkonen
Reviewers: tuomaspelkonen
CC: aran, tuomaspelkonen
Differential Revision: 402
2011-06-07 10:53:42 -07:00
tuomaspelkonen
fe9daa7ae3 'arc diff' passes the diff ID to Test Engine class.
Summary:
Test Engine classes might need the differential Diff ID to be
able to attach postponed test results to diffs.

Test Plan:
Added setDifferentialDiff function to PhutilUnitTestEngine class
and made sure it was called with the correct diff ID when running
'arc diff --preview'

Reviewed By: jungejason
Reviewers: jungejason, grglr
Commenters: sgrimm
CC: epriestley, sgrimm, slawekbiel, aran, tuomaspelkonen, jungejason
Differential Revision: 395
2011-06-02 12:19:05 -07:00
slawekbiel
d70e5db39e Aggregate display of postponed tests
Summary:
Displaying each postponed test separately was spammy.
Now it will only display a single line with the total count

Test Plan:
~/local/arcanist/bin/arc unit --sandcastle-tests
35 tests to run.
Completed 'ParentInfoTestCase.php'
Interrupted 'MentionsUntagTestCase.php'
    PASS  ParentInfoTestCase
  POSTPONED  34 tests

Reviewed By: sgrimm
Reviewers: jungejason, sgrimm
CC: sgrimm
Revert Plan:
sure

Other Notes:

Differential Revision: 173
2011-04-28 12:05:00 -07:00
slawekbiel
aa44db2f96 [Adding postpone status for unittests]
Summary:
That's for the tests that will be run asynchronously.

Test Plan:
run arc unit with some tests that returned postponed status - they showed up.
Background was yellow.

Reviewed By: epriestley
CC: epriestley
Revert Plan:
sure

Other Notes:

Differential Revision: 77
2011-03-21 19:11:58 -07:00
epriestley
5099b005cf Some documentation.
Summary:

Test Plan:

Reviewers:

CC:
2011-02-19 11:36:08 -08:00
epriestley
0eecd3108f Resolve further subtlety with untracked files.
Summary:

Test Plan:

Reviewers:

CC:
2011-02-18 17:08:10 -08:00
epriestley
2f37912946 Expose the already-functional "--engine" flag for the unit workflow.
Summary:

Test Plan:

Reviewers:

CC:
2011-02-16 11:53:13 -08:00
epriestley
83a0083b3b Improve argument passthru behavior to make added args available to test engines.
Summary:
When you add new arguments to the unit command, they need to be
threaded through to the unit engine. This enables you to specify passthru
command which will be shipped through the callstack.

Test Plan:
Ran 'arc diff --maxtests 8 --apply-patches --trace' and verified
resulting behavior was correct.

Differential Revision: 207877
Reviewed By: dschleimer
Reviewers: dschleimer
CC: dschleimer
Revert Plan:
OK
2011-02-01 20:45:32 -08:00
epriestley
3f13e36182 Update arcanist to use the PhutilSymbolLoader.
Summary: This should also fix the bug with double help for certain commands

Test Plan:

Reviewers:

CC:
2011-01-12 16:02:28 -08:00
epriestley
7d36705215 Ship unresolved unit test information to Differential.
Summary:

Test Plan:

Reviewers:

CC:
2011-01-11 22:37:06 -08:00
epriestley
2e73916fa2 Initial commit. 2011-01-09 15:22:25 -08:00