[ 
https://issues.apache.org/jira/browse/THRIFT-2926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14264947#comment-14264947
 ] 

Randy Abernethy commented on THRIFT-2926:
-----------------------------------------

The JavaScript test suite is not perfectly aligned with the current Apache 
Thrift test strategy (THRIFT-847). 

h4. Apache Thrift Test Strategy
Apache Thrift uses "make check" to drive language by language unit tests. These 
test each language's implementation of Apache Thrift for internal consistency 
and belong in thrift/lib/+lang+/test. Apache Thrift "make cross" drives cross 
language integration tests which insure languages can communicate with each 
other using a range of protocols and transports. These tests are found in 
thrift/test, along with other shared testing components (largely thrift IDL 
files). As this is a work in progress, many languages have no presence in the 
current make cross tests and still others have skewed make check test suites. 

h4. Apache Thrift Browser JavaScript Test Structure
JavaScript tests are currently organized into two suites. 
* ant thrift/lib/js/test/build.xml   -   These test JavaScript in the browser 
against a Java server. These tests require Java to be installed and also 
require the Java libs/tests to be built. Presently, to run these tests, you can 
run "./bootstrap.sh; ./configure; make check" at the thrift root, or if you 
have already done so in the past, you can run "make check" in 
thrift/lib/js/test to just run the JavaScript tests. Java must be installed 
when you run ./configure. Note: The cmake build does not yet support "make 
check" (1/5/2015).
* grunt thrift/lib/js/Gruntfile.js   -   These test JavaScript in the Browser 
(using Phantom as the host) against JavaScript on the server (using NodeJS as 
the host). All of the JavaScript build tools (principally grunt and npm) are 
JavaScript based and do not require Java to be installed to work, though they 
do require Node.js. This test suite is more comprehensive than the build.xml 
suite, testing SSL, various jQuery arrangements, etc.

h4. Target JavaScript Test Structure
Given that the Ant JavaScript to Java tests are cross language, these should be 
moved to the make check chain (integrated with thrift/test/test.+sh/py+, 
eliminating the thrift/lib/js/test/build.xml altogether). The grunt tests 
should then be wired into the make check tests as the go forward unit tests. 

h4. Tests for a new protocol
Any new protocol should have standard unit tests and a full set of integration 
tests with at least one of the two reference implementations (CPP/Java). In the 
case of JavaScript, this would imply a complete set of grunt driven tests 
against a Node.js server (adding TBinaryProtocol to the grunt test html files) 
and a "make cross" integration test with CPP or Java (wherein we should add 
tests for TBinaryProtocol and TJSONProtocol as well).


[~radekg] If you can get the full suite of grunt tests (Browser to Node) to 
pass using TBinaryProtocol and the equivalent of the Ant tests to pass (Browser 
to Java) I will help you on the Apache Thrift build/test suite side.

Best,
Randy


> JavaScript: binary protocol implementation
> ------------------------------------------
>
>                 Key: THRIFT-2926
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2926
>             Project: Thrift
>          Issue Type: New Feature
>          Components: JavaScript - Library
>    Affects Versions: 0.9.2
>            Reporter: Radoslaw Gruchalski
>              Labels: features, javascript
>
> I have implemented BinaryProtocol for the JS library. Implementation provided 
> with unit tests. Looking for feedback.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to