Commit 0729e511cd77652c7cb2d1500c5b7d1d7ee2cbbd

Authored by Andrew Kane
1 parent a761fb2d
Exists in test_language

Test languages on Travis

test/ci/install_elasticsearch.sh
@@ -21,3 +21,9 @@ fi @@ -21,3 +21,9 @@ fi
21 cd $CACHE_DIR 21 cd $CACHE_DIR
22 bin/elasticsearch -d 22 bin/elasticsearch -d
23 for i in {1..12}; do wget -O- -v http://127.0.0.1:9200/ && break || sleep 5; done 23 for i in {1..12}; do wget -O- -v http://127.0.0.1:9200/ && break || sleep 5; done
  24 +
  25 +bin/elasticsearch-plugin install analysis-kuromoji
  26 +bin/elasticsearch-plugin install analysis-nori
  27 +bin/elasticsearch-plugin install analysis-smartcn
  28 +bin/elasticsearch-plugin install analysis-stempel
  29 +bin/elasticsearch-plugin install analysis-ukrainian
test/language_test.rb
@@ -2,12 +2,14 @@ require_relative "test_helper" @@ -2,12 +2,14 @@ require_relative "test_helper"
2 2
3 class LanguageTest < Minitest::Test 3 class LanguageTest < Minitest::Test
4 def setup 4 def setup
5 - skip unless ENV["TEST_LANGUAGE"] 5 + skip "Requires plugin" unless ci? || ENV["TEST_LANGUAGE"]
6 6
7 Song.destroy_all 7 Song.destroy_all
8 end 8 end
9 9
10 def test_chinese 10 def test_chinese
  11 + skip if ci?
  12 +
11 # requires https://github.com/medcl/elasticsearch-analysis-ik 13 # requires https://github.com/medcl/elasticsearch-analysis-ik
12 with_options(Song, language: "chinese") do 14 with_options(Song, language: "chinese") do
13 store_names ["中华人民共和国国歌"], Song 15 store_names ["中华人民共和国国歌"], Song
@@ -38,6 +40,8 @@ class LanguageTest &lt; Minitest::Test @@ -38,6 +40,8 @@ class LanguageTest &lt; Minitest::Test
38 end 40 end
39 41
40 def test_korean 42 def test_korean
  43 + skip if ci?
  44 +
41 # requires https://github.com/open-korean-text/elasticsearch-analysis-openkoreantext 45 # requires https://github.com/open-korean-text/elasticsearch-analysis-openkoreantext
42 with_options(Song, language: "korean") do 46 with_options(Song, language: "korean") do
43 store_names ["한국어를 처리하는 예시입니닼ㅋㅋ"], Song 47 store_names ["한국어를 처리하는 예시입니닼ㅋㅋ"], Song
@@ -74,6 +78,8 @@ class LanguageTest &lt; Minitest::Test @@ -74,6 +78,8 @@ class LanguageTest &lt; Minitest::Test
74 end 78 end
75 79
76 def test_vietnamese 80 def test_vietnamese
  81 + skip if ci?
  82 +
77 # requires https://github.com/duydo/elasticsearch-analysis-vietnamese 83 # requires https://github.com/duydo/elasticsearch-analysis-vietnamese
78 with_options(Song, language: "vietnamese") do 84 with_options(Song, language: "vietnamese") do
79 store_names ["công nghệ thông tin Việt Nam"], Song 85 store_names ["công nghệ thông tin Việt Nam"], Song
test/test_helper.rb
@@ -141,4 +141,8 @@ class Minitest::Test @@ -141,4 +141,8 @@ class Minitest::Test
141 def default_model 141 def default_model
142 Product 142 Product
143 end 143 end
  144 +
  145 + def ci?
  146 + ENV["CI"]
  147 + end
144 end 148 end