Skip to content
This repository has been archived by the owner on Feb 12, 2020. It is now read-only.

False passes in tests #6

Open
eamelink opened this issue May 12, 2014 · 8 comments
Open

False passes in tests #6

eamelink opened this issue May 12, 2014 · 8 comments

Comments

@eamelink
Copy link
Contributor

It appears that immutable specs are used together with scopes. This gives false positives; scopes always succeed. See this commit for the proof:
87c0d46

With this commit, the tests still pass.

It looks like something changed in newer specs2 versions, which is used for the Play 2.3 branch: https://github.com/Rhinofly/play-elasticsearch-client/tree/play-2.3

This branch does give errors during testing and it looks like they are real errors.

@EECOLOR
Copy link
Contributor

EECOLOR commented May 12, 2014

There is a good chance this is caused by the WithTestIndexWithSimpleAnalysis implementation. The AsResult(t) call should actually be AsResult.effectively(t). Could you check if that solves the problem?

@eamelink
Copy link
Contributor Author

It does. Pushed the change to master, which now fails:

[error] Error: Total 278, Failed 7, Errors 1, Passed 270
[error] Failed tests:
[error]     fly.play.elasticsearch.ElasticSearchQueryTests
[error] Error during tests:
[error]     fly.play.elasticsearch.analysis.AnalysisTests

@eamelink
Copy link
Contributor Author

If @EECOLOR or @nverwer has time to look into this that would be awesome. If not, I'll pick it up this week.

@nverwer
Copy link
Contributor

nverwer commented May 13, 2014

I will try to have a look at it.

@nverwer
Copy link
Contributor

nverwer commented May 16, 2014

Apparently 'effectively' fixes the tests (no idea why). I am now working on fixinf the code, so the tests pass.

@EECOLOR
Copy link
Contributor

EECOLOR commented May 21, 2014

I am not sure if we now both have fixed stuff. I pushed the changes to master. The tests are now completely green in master. There was one tricky bug with enumerations, see: 5dbaf46

That one could cause problems that are virtually undetectable.

@EECOLOR
Copy link
Contributor

EECOLOR commented May 21, 2014

The other tests were quite simple to fix.

188effb
8e3a026

@EECOLOR EECOLOR closed this as completed May 21, 2014
@EECOLOR
Copy link
Contributor

EECOLOR commented May 22, 2014

One effectively was missing. This caused another error:

have a FuzzyLikeThisQuery sub-class
x that does not find documents when searching for an exact match
'2' is not equal to '0' (QueryTests.scala:251)

According to the elasticsearch documentation the fuzziness if set 0..1 should be an exact match. I do not think this is a problem of the library. When I manually search (using sense) with the following query I get the same results:

GET indexname/typename/_search
{
  "query": {
    "fuzzy_like_this" : {
        "fields" : ["test"],
        "like_text" : "tree",
        "fuzziness" : 0
    }
  } 
}

@nverwer can you confirm that this is a problem of elasticsearch?

@EECOLOR EECOLOR reopened this May 22, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants