• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

audit/H19-Dec-2018-7,1955,803

c_glib/H19-Dec-2018-3,3992,637

cl/H19-Dec-2018-596424

cpp/H03-May-2022-3,3412,618

crossrunner/H19-Dec-2018-1,271964

csharp/H19-Dec-2018-1,7911,469

dart/H19-Dec-2018-421329

erl/H19-Dec-2018-513378

features/H03-May-2022-613481

go/H19-Dec-2018-1,9091,347

haxe/H19-Dec-2018-2,8182,400

hs/H03-May-2022-1,233824

keys/H03-May-2022-461405

lua/H19-Dec-2018-355232

netcore/H19-Dec-2018-2,0231,621

ocaml/H19-Dec-2018-301220

perl/H19-Dec-2018-913653

php/H19-Dec-2018-650458

py/H03-May-2022-2,7602,019

py.tornado/H19-Dec-2018-272175

py.twisted/H19-Dec-2018-234143

rb/H19-Dec-2018-1,400916

rs/H19-Dec-2018-1,088809

threads/H19-Dec-2018-312177

AnnotationTest.thriftH A D19-Dec-20181.8 KiB7361

BrokenConstants.thriftH A D19-Dec-2018931 2623

ConstantsDemo.thriftH A D19-Dec-20182 KiB7657

DebugProtoTest.thriftH A D19-Dec-20189.8 KiB379327

DenseLinkingTest.thriftH A D19-Dec-20182.3 KiB9984

DocTest.thriftH A D19-Dec-20186.1 KiB288230

DoubleConstantsTest.thriftH A D19-Dec-20181.1 KiB1815

EnumContainersTest.thriftH A D19-Dec-20181.4 KiB4740

EnumTest.thriftH A D19-Dec-20183.5 KiB120107

FullCamelTest.thriftH A D19-Dec-20181.1 KiB3934

Include.thriftH A D19-Dec-2018893 2422

JavaBeansTest.thriftH A D19-Dec-20181.1 KiB3935

JavaDeepCopyTest.thriftH A D19-Dec-2018441 2016

JavaTypes.thriftH A D19-Dec-20181.8 KiB10484

JsDeepConstructorTest.thriftH A D19-Dec-2018502 1916

Makefile.amH A D19-Dec-20183 KiB171128

ManyOptionals.thriftH A D19-Dec-20184.1 KiB232223

ManyTypedefs.thriftH A D19-Dec-20181.7 KiB5145

NameConflictTest.thriftH A D19-Dec-20181.7 KiB11189

OptionalRequiredTest.thriftH A D19-Dec-20182.1 KiB8977

README.mdH A D19-Dec-20186.4 KiB186135

Recursive.thriftH A D19-Dec-20181.1 KiB4841

ReuseObjects.thriftH A D19-Dec-2018993 3125

SmallTest.thriftH A D19-Dec-20181.6 KiB6151

StressTest.thriftH A D19-Dec-20181.1 KiB3631

ThriftTest.thriftH A D19-Dec-201811.1 KiB412357

TypedefTest.thriftH A D19-Dec-20181.2 KiB3632

UnsafeTypes.thriftH A D19-Dec-2018875 2522

known_failures_Linux.jsonH A D19-Dec-201815.5 KiB494494

rebuild_known_failures.shH A D19-Dec-2018562 2519

test.pyH A D19-Dec-20188.3 KiB193139

tests.jsonH A D19-Dec-201812 KiB750749

valgrind.suppressH A D19-Dec-20181.8 KiB5451

README.md

1# Apache Thrift - integration test suite
2
3This is the cross everything integration test suite for Apache Thrift.
4
5## Run
6
7### A. Using Make
8
9The test can be executed by:
10
11    make cross
12
13This starts the [test.py](test.py) script which does the real cross test with
14different transports, protocols and languages.
15
16Note that this skips any language that is not built locally. It also skips
17tests that are known to be failing. If you need more control over which tests
18to run, read following section.
19
20### B. Using test script directly
21
22Alternatively, you can invoke [test.py](test.py) directly. You need to run`make
23precross` once before executing it for the first time.
24
25For example, if you changed something in `nodejs` library and need to verify
26the patch, you can skip everything except `nodejs` itself and some reference
27implementation (currently `cpp` and `java` are recommended) like this:
28
29    ./configure --without-c_glib -without-csharp --without-erlang --without-lua ...
30    make precross -j8
31    test/test.py --server cpp,java --client nodejs
32    test/test.py --server nodejs --client cpp,java
33
34Another useful flag is --regex. For example, to run all tests that involve
35Java TBinaryProtocol:
36
37    test/test.py --regex "java.*binary"
38
39## Test case definition file
40
41The cross test cases are defined in [tests.json](tests.json).
42The root element is collection of test target definitions.
43Each test target definition looks like this:
44
45    {
46      "name": "somelib",
47
48      "client": {
49        "command": ["somelib_client_executable"],
50        "workdir": "somelib/bin",
51        "protocols": ["binary"],
52        "transports": ["buffered"],
53        "sockets": ["ip"],
54      },
55      "server": {
56        "command": ["somelib_server_executable"],
57        "workdir": "somelib/bin",
58        "protocols": ["binary"],
59        "transports": ["buffered"],
60        "sockets": ["ip", "ip-ssl"],
61      }
62    }
63
64Either client or server definition or both should be present.
65
66Parameters that are common to both `client` and `server` can be put to target
67definition root:
68
69    {
70      "name": "somelib",
71
72      "workdir": "somelib/bin",
73      "protocols": ["binary"],
74      "transports": ["buffered"],
75      "sockets": ["ip"],
76
77      "client": { "command": ["somelib_client_executable"] },
78      "server": {
79        "command": ["somelib_server_executable"],
80        "sockets": ["ip-ssl"]
81      }
82    }
83
84For the complete list of supported keys and their effect, see source code
85comment at the opt of [crossrunner/collect.py](crossrunner/collect.py).
86
87
88## List of known failures
89
90Since many cross tests currently fail (mainly due to partial incompatibility
91around exception handling), the test script specifically report for "not known
92before" failures.
93
94For this purpose, test cases known to (occasionally) fail are listed in
95`known_failures_<platform>.json` where `<platform>` matches with python
96`platform.system()` string.
97
98Currently, only Linux version is included.
99
100FYI, the file is initially generated by
101
102    test/test.py --update-expected-failures=overwrite
103
104after a full test run, then repeatedly
105
106    test/test.py --skip-known-failures
107    test/test.py --update-expected-failures=merge
108
109to update the known failures, run
110
111    make fail
112
113## Test executable specification
114
115### Command line parameters
116
117Unit tests for languages are usually located under lib/<lang>/test/
118cross language tests according to [ThriftTest.thrift](ThriftTest.thrift) shall be
119provided for every language including executables with the following command
120line interface:
121
122**Server command line interface:**
123
124    $ ./cpp/TestServer -h
125    Allowed options:
126      -h [ --help ]               produce help message
127      --port arg (=9090)          Port number to listen
128      --domain-socket arg         Unix Domain Socket (e.g. /tmp/ThriftTest.thrift)
129      --named-pipe arg            Windows Named Pipe (e.g. MyThriftPipe)
130      --server-type arg (=simple) type of server, "simple", "thread-pool",
131                                  "threaded", or "nonblocking"
132      --transport arg (=buffered) transport: buffered, framed, http, anonpipe
133      --protocol arg (=binary)    protocol: binary, compact, json
134      --ssl                       Encrypted Transport using SSL
135      --processor-events          processor-events
136      -n [ --workers ] arg (=4)   Number of thread pools workers. Only valid for
137                              thread-pool server type
138
139**Client command line interface:**
140
141    $ ./cpp/TestClient -h
142    Allowed options:
143      -h [ --help ]               produce help message
144      --host arg (=localhost)     Host to connect
145      --port arg (=9090)          Port number to connect
146      --domain-socket arg         Domain Socket (e.g. /tmp/ThriftTest.thrift),
147                                  instead of host and port
148      --named-pipe arg            Windows Named Pipe (e.g. MyThriftPipe)
149      --anon-pipes hRead hWrite   Windows Anonymous Pipes pair (handles)
150      --transport arg (=buffered) Transport: buffered, framed, http, evhttp
151      --protocol arg (=binary)    Protocol: binary, compact, json
152      --ssl                       Encrypted Transport using SSL
153      -n [ --testloops ] arg (=1) Number of Tests
154      -t [ --threads ] arg (=1)   Number of Test threads
155
156If you have executed the **make check** or **make cross** then you will be able to browse
157[gen-html/ThriftTest.html](gen-html/ThriftTest.html) with the test documentation.
158
159### Return code
160
161The return code (exit code) shall be 0 on success, or an integer in the range 1 - 255 on errors.
162In order to signal failed tests, the return code shall be composed from these bits to indicate
163failing tests:
164
165      #define TEST_BASETYPES     1  // 0000 0001
166      #define TEST_STRUCTS       2  // 0000 0010
167      #define TEST_CONTAINERS    4  // 0000 0100
168      #define TEST_EXCEPTIONS    8  // 0000 1000
169      #define TEST_UNKNOWN      64  // 0100 0000 (Failed to prepare environemt etc.)
170      #define TEST_TIMEOUT     128  // 1000 0000
171      #define TEST_NOTUSED      48  // 0011 0000 (reserved bits)
172
173Tests that have not been executed at all count as errors.
174
175**Example:**
176
177During tests, the test client notices that some of the Struct tests fail.
178Furthermore, due to some other problem none of the Exception tests is executed.
179Therefore, the test client returns the code `10 = 2 | 8`, indicating the failure
180of both test 2 (TEST_STRUCTS) and test 8 (TEST_EXCEPTIONS).
181
182
183## SSL
184Test Keys and Certificates are provided in multiple formats under the following
185directory [test/keys](keys)
186