hanyoud / android-daisy-epub-reader

Automatically exported from code.google.com/p/android-daisy-epub-reader
1 stars 0 forks source link

NewStory: Run the daisy-engine tests successfully in travis-ci #78

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
We have managed to get DaisyReader and daisy-engine to build successfully in 
travis-ci. 

Several junit tests currently fail in the travis-ci environment for 
daisy-engine. We want these tests to be run and for them to run cleanly. This 
story will be used to track our progress and learnings. Once we get these tests 
to run cleanly we will investigate running the application tests in the CI 
environment.

Useful links:
https://github.com/embarkmobile/android-maven-example/blob/master/wait_for_emula
tor will be useful when we want to run the application tests.
https://code.google.com/p/android-daisy-epub-reader/issues/detail?id=76 The 
initial story for evaluating travis-ci

I will add more links in updates to this story. 

Original issue reported on code.google.com by julianharty on 16 Aug 2013 at 11:13

GoogleCodeExporter commented 8 years ago
Work so far:
- Created a separate github project for daisy-engine and configured a travis-ci 
build https://travis-ci.org/julianharty/daisy-engine 
- Experimented with different JDKs, including OracleJDK7 and OpenJDK6 - 
problems still exist.
- Added diagnostic information to tests and source of code related to the 
initial failures. More to do.
- Changed the ant build.xml file to run all the tests even when some fail, 
otherwise travis-ci stops running the junit tests in a file once the first one 
fails. Note: currently ant does not report a failure after running the tests so 
travis-ci incorrectly reports the build as successful. It _is_ successful in 
running all the tests and therefore we can see which tests fail. However we 
ultimately want good quality tests to run cleanly and currently this isn't 
happening...

Original comment by julianharty on 16 Aug 2013 at 11:18

GoogleCodeExporter commented 8 years ago
There are still a couple of tweaks left to do, however the tests now run 
without error as a separate daisy-engine project on travis-ci. The main cause 
seems to be related to differences in the behaviour of the SAX Xerces parser in 
and Java 7 and in OpenJDK 6. The daisy-reader code looked for values using 
getLocalName(...) however that returns an empty string with newer versions of 
the parser. The name is available using getQName(...) in the newer 
implementations of the parser. We may still be bitten by parsing problems in 
future, however at least the current implementation passes all the unit tests. 
I used TDD to implement equivalent changes to daisy-reader code in the main 
codebase. The tests for the main codebase also run cleanly in travis-ci

Original comment by julianharty on 21 Aug 2013 at 8:13

GoogleCodeExporter commented 8 years ago
Here is a key explanation, with sample code, of how getLocalName(...) and 
getQName(...) differ: 
http://stackoverflow.com/questions/6429634/differences-between-a-local-name-and-
qualified-name-in-a-xml-attribute This also refers to 
http://www.w3.org/TR/REC-xml-names/

Original comment by julianharty on 23 Aug 2013 at 7:38