Summary:
We've had a number of compatibility issues with the arcanist
based test suite, so this is an effort to run them using the
python unittest infrastructure.
This new structure allows us to create a single temporary dir
and to create a dir per test case to track the temporary files
and dirs created during the test. This is beneficial both from
a post-mortem perspective if a test fails, but also because
the paths that show up in the watchman logs will now be easily
recognizable as being associated with a given test.
This will also help us manage the windows integration tests
(https://github.com/facebook/watchman/issues/19#issuecomment-125054948)
a bit more sanely; a source of errors in the php tests is that
deleting directory trees can fail if a handle still references
any part of it, and there is often a noticeable lag where we
can hit this state and error out. By deferring the deletes
until our process end, we should minimize this issue.
I've ported a single integration test to demonstrate what this
looks like, the rest will have to be a series of diffs for
easier review.
Test Plan: `make integration` or `./runtests.py`
Reviewers: sid0
Differential Revision: https://reviews.facebook.net/D43137
Summary:
this is a change to upstream third-party source, and should
be submitted for inclusion.
Test Plan: I have an application which uses this, and it works.
Reviewers: sid0, wez
Reviewed By: wez
Differential Revision: https://reviews.facebook.net/D28641
Summary:
This draws from our hgwatchman client code to provide a simple
watchman client API for python code.
This changes the makefile so that we install our watchman python module
during `make install`. It also wires up a rudimentary test of the
client that talks to one of the instances set up by
WatchmanIntegrationEngine.
Test Plan: `./configure --with-python ; make integration`
Reviewers: sid0, achao
Reviewed By: sid0
Subscribers: moshez
Differential Revision: https://phabricator.fb.com/D1323720
Integrate python build more fully with the overal build/test code.
Fixup some integer size issues and raise errors when integers are
too large for python to handle.
Allow arc unit to exercise python unit test.
Summary:
Add a binary serialization format. This inserts fairly cleanly into our handling:
* Format can represent all JSON types implemented in our library
* Strings are no longer spec'd as being UTF-8; they're binary
* The CLI defaults to bser for client<->server communication and JSON for output
* CLI options to select output and server encoding formats
* The server responds in the same format as the request it received
The binary format describes its own length which allows clients to know ahead of
time how much memory they'll need and avoid realloc. Each data item is a copy
of its binary representation on the server, except for integer types which are
encoded using the smallest possible representation for the value at hand. This
allows for a degree of compression compared to textual JSON and is much simpler
to decode than translating string representations of numbers back and forth.
Integers are presented in host byte order since communication is always local;
it makes no sense to byteswap from LE to BE and back again.
Further compression is realized by changing the JSON library API to
define "template" objects with properties that are known at the start of
array processing; this allows the property names to be factored out of
the object value stream and allows saving approximately 50% of the space
vs. compact JSON.
A python `bser` extension is included that supports `dumps` and `loads`;
you can exercise the extension using:
```
cd python/bser
./setup.py build
PYTHONPATH=build/lib.linux-x86_64-2.6 ./tests.py
```
Reviewers: sid0
Reviewed By: sid0
CC: security-diffs@lists, bryano
Differential Revision: https://phabricator.fb.com/D809287
Task ID: 2339174