rethinkdb / rethinkdb-java

Official RethinkDB Java client
https://rethinkdb.com/api/java/
Apache License 2.0
21 stars 10 forks source link

Fix tests failing #28

Open NotJustAnna opened 4 years ago

NotJustAnna commented 4 years ago

This issue tracks the failing generated tests.

MathLogicLogic

Appears to happen because of outdated polyglot tests? The error happens because Python.

r.expr(r.expr(True) & r.expr(False) == r.expr(False) | r.expr(True)) seems to be related to a Python-specific behaviour.

Gets translated just fine to r.expr(r.expr(true).and(r.expr(false)).eq(r.expr(false).or(r.expr(true)))) and the test fails because it compiles correctly.

MathLogicBit

Appears to happen because of outdated polyglot tests?

r.expr(-1).bit_sal(54) is evaluated and the result is written as a Double. Jackson will parse it as Double and it'll live as a Double.

A quick fix should be as easy as casting all numbers to double before asserting equality, because Python. I don't know if it's as good as it's easy, though.

Replacing 54 with 53 and recalculating the value should make the test pass.

MutationInsert

The error happens because Python.

'a'*500 is valid in python but invalid in Java.

Polyglot translates to r.mul("a", 500L), which is invalid to RethinkDB.

Fix needs to deal with python scripts, see #11

MetaGrant/ChangefeedsNow

Either badly generated, or polyglot tests are outdated.

ChangefeedsNow is so bad that the generated test was removed from git tree. (It blocks all tests for 2 minutes)

NotJustAnna commented 4 years ago

Tests were deleted by #30, but can be generated by running genTestJava task. Starting now, PRs which break tests (or generates broken ones) won't be accepted.

gabor-boros commented 4 years ago

@adriantodt What do you think about adding this info to the readme or somewhere and closing this issue? :blush: