Skip to content

Commit 0d3d235

Browse files
authored
Test Native and GSL Implementations (#196)
Merge pull request 196
1 parent 99d13af commit 0d3d235

File tree

2 files changed

+26
-11
lines changed

2 files changed

+26
-11
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,38 @@ on:
1414

1515
jobs:
1616
ci:
17-
name: "Run Tests (${{ matrix.label }})"
17+
name: "Run Tests (Ruby ${{ matrix.ruby_version }}, GSL: ${{ matrix.gsl }})"
1818
runs-on: "ubuntu-latest"
1919
env:
2020
# See https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby#matrix-of-gemfiles
2121
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
2222
strategy:
2323
fail-fast: false
2424
matrix:
25+
ruby_version: ["2.7", "3.0", "3.1", "jruby-9.3.4.0"]
26+
gsl: [true, false]
27+
# We use `include` to assign the correct Gemfile for each ruby_version
2528
include:
26-
- label: Ruby 2.7
27-
ruby_version: "2.7"
29+
- ruby_version: "2.7"
2830
gemfile: Gemfile
29-
- label: Ruby 3.0
30-
ruby_version: "3.0"
31+
- ruby_version: "3.0"
3132
gemfile: Gemfile
32-
- label: Ruby 3.1
33-
ruby_version: "3.1"
33+
- ruby_version: "3.1"
3434
gemfile: Gemfile
35-
- label: JRuby 9.3.4.0
36-
ruby_version: "jruby-9.3.4.0"
35+
- ruby_version: "jruby-9.3.4.0"
3736
gemfile: Gemfile-jruby
37+
exclude:
38+
# Ruby 3.0 does not work with the latest released gsl gem
39+
# https://github.com/SciRuby/rb-gsl/issues/67
40+
- ruby_version: "3.0"
41+
gsl: true
42+
# Ruby 3.1 does not work with the latest released gsl gem
43+
# https://github.com/SciRuby/rb-gsl/issues/67
44+
- ruby_version: "3.1"
45+
gsl: true
46+
# jruby-9.3.4.0 doesn't easily build the gsl gem on a GitHub worker. Skipping for now.
47+
- ruby_version: "jruby-9.3.4.0"
48+
gsl: true
3849
steps:
3950
- name: Checkout Repository
4051
uses: actions/checkout@v3
@@ -43,8 +54,12 @@ jobs:
4354
with:
4455
ruby-version: ${{ matrix.ruby_version }}
4556
bundler-cache: true
57+
- name: Install GSL Gem
58+
if: ${{ matrix.gsl }}
59+
run: gem install gsl
4660
- name: Run Minitest based tests
4761
run: script/test
62+
4863
services:
4964
redis:
5065
image: redis

test/lsi/lsi_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def test_cached_content_node_option
163163
end
164164

165165
def test_clears_cached_content_node_cache
166-
return unless $GSL
166+
skip "transposed_search_vector is only used by GSL implementation" unless $GSL
167167

168168
lsi = ClassifierReborn::LSI.new(cache_node_vectors: true)
169169
lsi.add_item @str1, 'Dog'
@@ -192,7 +192,7 @@ def test_keyword_search
192192
end
193193

194194
def test_invalid_searching_when_using_gsl
195-
return unless $GSL
195+
skip "Only GSL currently raises invalid search error" unless $GSL
196196

197197
lsi = ClassifierReborn::LSI.new
198198
lsi.add_item @str1, 'Dog'

0 commit comments

Comments
 (0)