Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
audit Renamed, relocated, and reformated the audit tool's readme file Jul 10, 2015
c_glib THRIFT-2013: add multiplex server and client test support to cpp lang… Nov 19, 2017
cl THRIFT-82: fix cl test server to return the correct SecondService str… Mar 2, 2018
cpp THRIFT-4620: add crosstest support for zlib (buffered) to cpp, enable… Sep 16, 2018
crossrunner THRIFT-4620: add crosstest support for zlib (buffered) to cpp, enable… Sep 16, 2018
csharp THRIFT-4434: .NET Core cleanup and the beginnings of compiler unit tests Jan 14, 2018
dart configure.ac, Makefile.am: introduce THRIFT variable to support cross… Sep 9, 2017
erl configure.ac, Makefile.am: introduce THRIFT variable to support cross… Sep 9, 2017
features THRIFT-4579: Move up to Ubuntu Bionic for CI builds Jun 16, 2018
go THRIFT-4620: add crosstest support for zlib (buffered) to cpp, enable… Sep 16, 2018
haxe THRIFT-4352: update artful to use haxe 3.4.4 which fixes a core in haxe Feb 17, 2018
hs THRIFT-3580 THeader for Haskell Nov 30, 2017
keys THRIFT-3660 Add V4 mapped address to test client cert's altname Feb 22, 2016
lua THRIFT-3728 http transport for thrift-lua Mar 17, 2016
netcore THRIFT-4524: .NET Core Server doesn't close properly when cancelled Mar 20, 2018
ocaml THRIFT-2886 Integrate binary type in standard Thrift cross test Jan 3, 2015
perl THRIFT-4515: cross server test improvement: graceful test server shut… Mar 19, 2018
php THRIFT-4474: Use PSR-4 autoloader by default Mar 15, 2018
py.tornado THRIFT-3602 Make Tornado server send exception on unexpected handler … Nov 30, 2017
py.twisted THRIFT-3600 Make TTwisted server send exception on unexpected handler… Nov 30, 2017
py THRIFT-4621 Add THeader for Python Sep 1, 2018
rb THRIFT-4631 Fix Ruby codegen to gen valid ruby for recursive structs Sep 15, 2018
rs THRIFT-4395: fix rust build on xenial Nov 30, 2017
threads Thrift-2029:Port C++ tests to Windows Jan 8, 2014
AnnotationTest.thrift THRIFT-4060 add better support in the cpp generator for custom ostrea… Feb 13, 2017
BrokenConstants.thrift THRIFT-387. Add license headers to a bunch of files Mar 30, 2009
ConstantsDemo.thrift THRIFT-4269 Don't append '.' to Erlang namespace if it ends in '_'. Jul 31, 2017
DebugProtoTest.thrift THRIFT-3762 Fix warnings for deprecated Thrift "byte" fields Mar 29, 2016
DenseLinkingTest.thrift THRIFT-2637 "java:fullcamel_service_methods" option to automatically … Jul 25, 2014
DocTest.thrift THRIFT-3762 Fix warnings for deprecated Thrift "byte" fields Mar 29, 2016
DoubleConstantsTest.thrift THRIFT-4476: Typecasting problem on double list items, Mar 20, 2018
EnumContainersTest.thrift THRIFT-3357: Generate EnumSet/EnumMap where elements/keys are enums Sep 21, 2017
EnumTest.thrift THRIFT-3921: Add ostream operator<< functions for enums (working with… Feb 18, 2017
FullCamelTest.thrift THRIFT-3435 Separate package for fullcamel thrift Dec 6, 2015
Include.thrift THRIFT-1995: IDL can generate uncompilable ocde Jun 9, 2013
JavaBeansTest.thrift THRIFT-734. java: Can't use primitive types in service definitions fo… Mar 16, 2010
JavaDeepCopyTest.thrift THRIFT-4177 fix java deep copy Apr 19, 2017
JavaTypes.thrift THRIFT-4555 Optionally disable copies of binary fields in constructor… Apr 17, 2018
JsDeepConstructorTest.thrift THRIFT-3748 Node.js Deserialization of lists of lists is broken Sep 25, 2016
Makefile.am THRIFT-4555 Optionally disable copies of binary fields in constructor… Apr 17, 2018
ManyOptionals.thrift THRIFT-1469. java: Java isset space optimization Dec 21, 2011
ManyTypedefs.thrift THRIFT-387. Add license headers to a bunch of files Mar 30, 2009
NameConflictTest.thrift THRIFT-2951 Fix Erlang name conflict test Feb 5, 2015
OptionalRequiredTest.thrift THRIFT-3464 Fix several defects in c_glib code generator Dec 6, 2015
README.md THRIFT-3611 Add --regex filter to cross test runner Feb 11, 2016
Recursive.thrift THRIFT-2768: Whitespace Fixup Oct 3, 2014
ReuseObjects.thrift THRIFT-2368 New option: reuse-objects for Java generator Mar 31, 2014
SmallTest.thrift THRIFT-387. Add license headers to a bunch of files Mar 30, 2009
StressTest.thrift THRIFT-3762 Fix warnings for deprecated Thrift "byte" fields Mar 29, 2016
ThriftTest.thrift THRIFT-4434: .NET Core cleanup and the beginnings of compiler unit tests Jan 14, 2018
TypedefTest.thrift THRIFT-1040 Can't end typedef lines with a semicolon Sep 11, 2014
UnsafeTypes.thrift THRIFT-4555 Optionally disable copies of binary fields in constructor… Apr 17, 2018
index.html THRIFT-3571 Make feature test result browsable Jan 23, 2016
known_failures_Linux.json THRIFT-4620: add crosstest support for zlib (buffered) to cpp, enable… Sep 16, 2018
rebuild_known_failures.sh THRIFT-3347 Improve cross test servers and clients Sep 23, 2015
result.js THRIFT-3571 Make feature test result browsable Jan 23, 2016
test.py THRIFT-3118: add http (for non-ssl and for ssl) to the python cross t… Apr 5, 2018
tests.json THRIFT-4620: add crosstest support for zlib (buffered) to cpp, enable… Sep 16, 2018
valgrind.suppress THRIFT-4106: fix errors concurrency_test was identifying Sep 7, 2017

README.md

Apache Thrift - integration test suite

This is the cross everything integration test suite for Apache Thrift.

Run

A. Using Make

The test can be executed by:

make cross

This starts the test.py script which does the real cross test with different transports, protocols and languages.

Note that this skips any language that is not built locally. It also skips tests that are known to be failing. If you need more control over which tests to run, read following section.

B. Using test script directly

Alternatively, you can invoke test.py directly. You need to runmake precross once before executing it for the first time.

For example, if you changed something in nodejs library and need to verify the patch, you can skip everything except nodejs itself and some reference implementation (currently cpp and java are recommended) like this:

./configure --without-c_glib -without-csharp --without-erlang --without-lua ...
make precross -j8
test/test.py --server cpp,java --client nodejs
test/test.py --server nodejs --client cpp,java

Another useful flag is --regex. For example, to run all tests that involve Java TBinaryProtocol:

test/test.py --regex "java.*binary"

Test case definition file

The cross test cases are defined in tests.json. The root element is collection of test target definitions. Each test target definition looks like this:

{
  "name": "somelib",

  "client": {
    "command": ["somelib_client_executable"],
    "workdir": "somelib/bin",
    "protocols": ["binary"],
    "transports": ["buffered"],
    "sockets": ["ip"],
  },
  "server": {
    "command": ["somelib_server_executable"],
    "workdir": "somelib/bin",
    "protocols": ["binary"],
    "transports": ["buffered"],
    "sockets": ["ip", "ip-ssl"],
  }
}

Either client or server definition or both should be present.

Parameters that are common to both client and server can be put to target definition root:

{
  "name": "somelib",

  "workdir": "somelib/bin",
  "protocols": ["binary"],
  "transports": ["buffered"],
  "sockets": ["ip"],

  "client": { "command": ["somelib_client_executable"] },
  "server": {
    "command": ["somelib_server_executable"],
    "sockets": ["ip-ssl"]
  }
}

For the complete list of supported keys and their effect, see source code comment at the opt of crossrunner/collect.py.

List of known failures

Since many cross tests currently fail (mainly due to partial incompatibility around exception handling), the test script specifically report for "not known before" failures.

For this purpose, test cases known to (occasionally) fail are listed in known_failures_<platform>.json where <platform> matches with python platform.system() string.

Currently, only Linux version is included.

FYI, the file is initially generated by

test/test.py --update-expected-failures=overwrite

after a full test run, then repeatedly

test/test.py --skip-known-failures
test/test.py --update-expected-failures=merge

to update the known failures, run

make fail

Test executable specification

Command line parameters

Unit tests for languages are usually located under lib//test/ cross language tests according to ThriftTest.thrift shall be provided for every language including executables with the following command line interface:

Server command line interface:

$ ./cpp/TestServer -h
Allowed options:
  -h [ --help ]               produce help message
  --port arg (=9090)          Port number to listen
  --domain-socket arg         Unix Domain Socket (e.g. /tmp/ThriftTest.thrift)
  --named-pipe arg            Windows Named Pipe (e.g. MyThriftPipe)
  --server-type arg (=simple) type of server, "simple", "thread-pool",
                              "threaded", or "nonblocking"
  --transport arg (=buffered) transport: buffered, framed, http, anonpipe
  --protocol arg (=binary)    protocol: binary, compact, json
  --ssl                       Encrypted Transport using SSL
  --processor-events          processor-events
  -n [ --workers ] arg (=4)   Number of thread pools workers. Only valid for
                          thread-pool server type

Client command line interface:

$ ./cpp/TestClient -h
Allowed options:
  -h [ --help ]               produce help message
  --host arg (=localhost)     Host to connect
  --port arg (=9090)          Port number to connect
  --domain-socket arg         Domain Socket (e.g. /tmp/ThriftTest.thrift),
                              instead of host and port
  --named-pipe arg            Windows Named Pipe (e.g. MyThriftPipe)
  --anon-pipes hRead hWrite   Windows Anonymous Pipes pair (handles)
  --transport arg (=buffered) Transport: buffered, framed, http, evhttp
  --protocol arg (=binary)    Protocol: binary, compact, json
  --ssl                       Encrypted Transport using SSL
  -n [ --testloops ] arg (=1) Number of Tests
  -t [ --threads ] arg (=1)   Number of Test threads

If you have executed the make check or make cross then you will be able to browse gen-html/ThriftTest.html with the test documentation.

Return code

The return code (exit code) shall be 0 on success, or an integer in the range 1 - 255 on errors. In order to signal failed tests, the return code shall be composed from these bits to indicate failing tests:

  #define TEST_BASETYPES     1  // 0000 0001
  #define TEST_STRUCTS       2  // 0000 0010
  #define TEST_CONTAINERS    4  // 0000 0100
  #define TEST_EXCEPTIONS    8  // 0000 1000
  #define TEST_UNKNOWN      64  // 0100 0000 (Failed to prepare environemt etc.)
  #define TEST_TIMEOUT     128  // 1000 0000
  #define TEST_NOTUSED      48  // 0011 0000 (reserved bits)

Tests that have not been executed at all count as errors.

Example:

During tests, the test client notices that some of the Struct tests fail. Furthermore, due to some other problem none of the Exception tests is executed. Therefore, the test client returns the code 10 = 2 | 8, indicating the failure of both test 2 (TEST_STRUCTS) and test 8 (TEST_EXCEPTIONS).

SSL

Test Keys and Certificates are provided in multiple formats under the following directory test/keys