Skip to content

Commit 62b9cd5

Browse files
committed
Gemfile.lock update
2 parents 2f129dd + 5e3768b commit 62b9cd5

3 files changed

Lines changed: 29 additions & 6 deletions

File tree

Gemfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ GIT
2626

2727
GIT
2828
remote: https://github.com/ncbo/ncbo_annotator.git
29-
revision: e70c9cceedb2e3fc1ce93867de9d0777323f2146
29+
revision: 2d689b10f1be3dc70e890b42c9a62aea8baba5f2
3030
branch: master
3131
specs:
3232
ncbo_annotator (0.0.1)
@@ -37,7 +37,7 @@ GIT
3737

3838
GIT
3939
remote: https://github.com/ncbo/ontologies_linked_data.git
40-
revision: 0083660248b75251857863d08d8b9b8f8aeef343
40+
revision: 4e1a2c81a96585ba7a440bf0e7f533ee2ee3c94c
4141
branch: master
4242
specs:
4343
ontologies_linked_data (0.0.1)
@@ -262,10 +262,10 @@ GEM
262262
http-accept (1.7.0)
263263
http-cookie (1.1.6)
264264
domain_name (~> 0.5)
265-
i18n (1.15.1)
265+
i18n (1.15.2)
266266
concurrent-ruby (~> 1.0)
267267
io-console (0.8.2)
268-
json (2.19.9)
268+
json (2.20.0)
269269
json-canonicalization (1.0.0)
270270
json-ld (3.3.2)
271271
htmlentities (~> 4.3)
@@ -583,9 +583,9 @@ CHECKSUMS
583583
htmlentities (4.4.2) sha256=bbafbdf69f2eca9262be4efef7e43e6a1de54c95eb600f26984f71d2fe96c5c3
584584
http-accept (1.7.0) sha256=c626860682bfbb3b46462f8c39cd470fd7b0584f61b3cc9df5b2e9eb9972a126
585585
http-cookie (1.1.6) sha256=ba4b82be64de61dc281243dac70e3c382c45142f20268ed9276a3670c93feaa9
586-
i18n (1.15.1) sha256=505ec5de1f4e6c8a2cb028ef9700ca495f117911643455721dee5abdca797255
586+
i18n (1.15.2) sha256=00f9eb62412fe593b2a65a97daa75300d37abb8f7202ec748e94b6d46a9dd1b5
587587
io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc
588-
json (2.19.9) sha256=9b9025b7cdddafa38d316eca0b2358488e42d417045c1b90d216a9fefe46b79a
588+
json (2.20.0) sha256=9362bc6e55a952b056abf9167cf053358181c904cb70cd6eee0808ea830fc32b
589589
json-canonicalization (1.0.0) sha256=d4848a8cca7534455c6721f2d9fc9e5e9adca49486864a898810024f67d59446
590590
json-ld (3.3.2) sha256=b9531893bf5bdc01db428e96953845a23adb1097125ce918ae0f97c4a6e1ab27
591591
jwt (3.2.0) sha256=5419b1fe37b1da0982bd07051f573a8b8789ab724c2aa7e785e4784a3ed217d7

lib/ncbo_cron/ontology_rank.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def run
4848
logger.info('Storing rankings in Redis...')
4949
redis.set(ONTOLOGY_RANK_REDIS_FIELD, Marshal.dump(ontology_rank))
5050
logger.info('Rankings successfully stored in Redis')
51+
52+
logger.info('Propagating rankings to Solr term_search...')
53+
updated = LinkedData::Services::RankSolrPropagator.new(logger: logger).propagate
54+
logger.info("Propagated rankings to Solr for #{updated} ontologies")
5155
end
5256

5357
logger.info("Finished generating ontology rankings in #{time.round(3)} seconds")

test/test_ontology_rank.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require_relative 'test_case'
2+
require 'stringio'
3+
4+
class TestOntologyRankPropagation < TestCase
5+
def test_run_propagates_rank_to_solr_after_redis_write
6+
rank_job = NcboCron::Models::OntologyRank.new(Logger.new(StringIO.new))
7+
8+
# Isolate from analytics/UMLS and Redis: stub the computation and the store.
9+
rank_job.stubs(:rank_ontologies).returns({ 'BRO' => { bioportalScore: 0.5, umlsScore: 0.0 } })
10+
fake_redis = mock('redis')
11+
fake_redis.stubs(:set)
12+
Redis.stubs(:new).returns(fake_redis)
13+
14+
# The propagation step must run exactly once.
15+
LinkedData::Services::RankSolrPropagator.any_instance.expects(:propagate).once.returns(1)
16+
17+
rank_job.run
18+
end
19+
end

0 commit comments

Comments
 (0)