Coder Social home page Coder Social logo

Comments (13)

juzerali avatar juzerali commented on June 15, 2024

Seems you have already converted all of them. Need any more help?

from solr-node-client.

lbdremy avatar lbdremy commented on June 15, 2024

Hi @juzerali ,

Yes a few things are still missing including few files already created with a mention //TODO:

  • core-query-test.js
  • dismax-query-test.js
  • facet-query-test.js
  • group-query-test.js
  • mlt-query-test.js

These tests should cover all features exposed by Solr in their category even if there are not yet implemented in the current version of this client.
Next week-end I will have some time to continue this task in the same time feel completely free to code some of these tests :). Just let me know which tests you want to write and there are yours.

In the branch v0.3.x, I added a little roadmap in the README.md, an overview of what I would like in v0.3.0 when releasing. The most important thing being a complete support of the features in Solr 4. :)

from solr-node-client.

juzerali avatar juzerali commented on June 15, 2024

Sticking with assert instead of should? Describe pattern fits well with should.

from solr-node-client.

lbdremy avatar lbdremy commented on June 15, 2024

I don't really know the pros and cons between these two styles but I find should really verbose without giving really good value since I already describe what should be expected globally in the it call. I find assert really straightforward compare to should and also assert is native in node, nice thing too is chai adds some flavors to this api. From my point of view assert is as readable as should without a chainable language ( assert.isNotString(x) <=> x.should.not.be.a.('string')). That's mainly the reasons why I stick with assert.

from solr-node-client.

juzerali avatar juzerali commented on June 15, 2024

I am a novice nodejs developer, so I would take things really slowly. I started writing group-query-test. I have written one test to understand certain ground rules. So far I have understood.

  • We are essentially checking against responseHeader that Solr returns
  • No need to insert data into Solr to check
  • Always check sassert before checking other results.

Can you please take a look at my first test and approve so that I can start writing other tests in similar fashion.

from solr-node-client.

marc-portier avatar marc-portier commented on June 15, 2024

/me (being sorry for pushing the wrong button)

from solr-node-client.

marc-portier avatar marc-portier commented on June 15, 2024

I've merged the old patch from @juzerali and tried to get the tests running.

I'm doing this in the branch: https://github.com/marc-portier/solr-node-client/tree/v0.3.x-patch39

The relevant commits are:
1| marc-portier@16a1819

2| marc-portier@a2f764a

3| marc-portier@7274bcf

current status is that tests succeed when running separately, but fail when running in one go.

Error comes up in the test/group-query-test.js and suddenly holds weird echo's to group.facet statements? Looks like the client has some memory of the old request lingering in the new one?

  1. Client#createQuery #group(options), callback) should create a group query:
  Uncaught AssertionError: expected { Object (group.format, group.ngroups, ...) } to deeply equal { Object (group.format, group.ngroups, ...) }
  + expected - actual

   {
     "group": "true",
     "group.cache.percent": "50",
  +  "group.facet": "true",
     "group.field": "title_t",
     "group.format": "simple",
  +  "group.func": "test",
     "group.limit": "15",
     "group.main": "true",
     "group.ngroups": "true",
     "group.offset": "8",
     "group.sort": "score desc",
     "group.truncate": "true",
  +  "rows": "11",
  +  "start": "1",
     "wt": "json"
   }

  at Function.assert.deepEqual (/home/mpo/projects/solr-node-client.git/node_modules/chai/lib/chai/interface/assert.js:205:32)
  at /home/mpo/projects/solr-node-client.git/test/group-query-test.js:60:12
  at IncomingMessage.<anonymous> (/home/mpo/projects/solr-node-client.git/lib/solr.js:669:31)
  at IncomingMessage.EventEmitter.emit (events.js:117:20)
  at _stream_readable.js:912:16
  at process._tickCallback (node.js:415:13)

from solr-node-client.

marc-portier avatar marc-portier commented on June 15, 2024

My mistake: for some reason the group-query-test fails in this branch: also when ran individually.
Hadn't ran it individually before.

group-query-test was new and merged in from the previous pullreq #46
That file just didn't give a conflict so I forgot about it, so sorry for all this noise.

Will adapt our expectations to this test as well.

from solr-node-client.

marc-portier avatar marc-portier commented on June 15, 2024

@lbdremy I think I have this one covered with this set of patches:
https://github.com/marc-portier/solr-node-client/compare/marc-portier:v0.3.x-patch85...v0.3.x-patch39?expand=1 (diff calculated versus the earlier patch for #85 since it continuous from the configurable tests introduced there)

This includes:

  • the suggested fix for #89
  • the merge of the work from @juzerali
  • extra tests for the core-query-test

I'll be waiting for #85 to land before presenting the pull-req for this.

from solr-node-client.

lbdremy avatar lbdremy commented on June 15, 2024

Alright that's great progress! :) we need to push a bit to get a better coverage, the current coverage report is https://rawgit.com/lbdremy/ca8304efdf3695d25767/raw/5f346ae0eb4cbc3cccdd883b95ff73971355af03/coverage.html

from solr-node-client.

marc-portier avatar marc-portier commented on June 15, 2024

Not too bad... Maybe best approach is to create separate issues for the tests we still need then? And close this off in v0.3.x ?

from solr-node-client.

lbdremy avatar lbdremy commented on June 15, 2024

Yep that's a great idea. I can create the issues tonight, I will add the label test to them.

from solr-node-client.

lbdremy avatar lbdremy commented on June 15, 2024

The coverage is around 80% using mocha and chai, individual issues for missing tests are in the tracker, so closing this.

from solr-node-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.