Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Native and GSL Implementations #196

Merged
merged 1 commit into from
May 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,38 @@ on:

jobs:
ci:
name: "Run Tests (${{ matrix.label }})"
name: "Run Tests (Ruby ${{ matrix.ruby_version }}, GSL: ${{ matrix.gsl }})"
runs-on: "ubuntu-latest"
env:
# See https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby#matrix-of-gemfiles
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
strategy:
fail-fast: false
matrix:
ruby_version: ["2.7", "3.0", "3.1", "jruby-9.3.4.0"]
gsl: [true, false]
# We use `include` to assign the correct Gemfile for each ruby_version
include:
- label: Ruby 2.7
ruby_version: "2.7"
- ruby_version: "2.7"
gemfile: Gemfile
- label: Ruby 3.0
ruby_version: "3.0"
- ruby_version: "3.0"
gemfile: Gemfile
- label: Ruby 3.1
ruby_version: "3.1"
- ruby_version: "3.1"
gemfile: Gemfile
- label: JRuby 9.3.4.0
ruby_version: "jruby-9.3.4.0"
- ruby_version: "jruby-9.3.4.0"
gemfile: Gemfile-jruby
exclude:
# Ruby 3.0 does not work with the latest released gsl gem
# https://github.com/SciRuby/rb-gsl/issues/67
- ruby_version: "3.0"
gsl: true
# Ruby 3.1 does not work with the latest released gsl gem
# https://github.com/SciRuby/rb-gsl/issues/67
- ruby_version: "3.1"
gsl: true
# jruby-9.3.4.0 doesn't easily build the gsl gem on a GitHub worker. Skipping for now.
- ruby_version: "jruby-9.3.4.0"
gsl: true
steps:
- name: Checkout Repository
uses: actions/checkout@v3
Expand All @@ -43,8 +54,12 @@ jobs:
with:
ruby-version: ${{ matrix.ruby_version }}
bundler-cache: true
- name: Install GSL Gem
if: ${{ matrix.gsl }}
run: gem install gsl
- name: Run Minitest based tests
run: script/test

services:
redis:
image: redis
Expand Down
4 changes: 2 additions & 2 deletions test/lsi/lsi_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_cached_content_node_option
end

def test_clears_cached_content_node_cache
return unless $GSL
skip "transposed_search_vector is only used by GSL implementation" unless $GSL

lsi = ClassifierReborn::LSI.new(cache_node_vectors: true)
lsi.add_item @str1, 'Dog'
Expand Down Expand Up @@ -192,7 +192,7 @@ def test_keyword_search
end

def test_invalid_searching_when_using_gsl
return unless $GSL
skip "Only GSL currently raises invalid search error" unless $GSL

lsi = ClassifierReborn::LSI.new
lsi.add_item @str1, 'Dog'
Expand Down