Skip to content

Commit

Permalink
chore(CI): test multiple type names
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Nov 26, 2019
1 parent 0bda195 commit a3f1106
Show file tree
Hide file tree
Showing 15 changed files with 199 additions and 159 deletions.
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ dist: bionic
notifications:
email: false
node_js:
- 8
- 10
- 12
matrix:
fast_finish: true
env:
matrix:
- ES_VERSION=5.6.12 JDK_VERSION=oraclejdk8
- ES_VERSION=5.6.12 JDK_VERSION=oraclejdk11
- ES_VERSION=6.8.4 JDK_VERSION=oraclejdk8
- ES_VERSION=6.8.4 JDK_VERSION=oraclejdk11
- ES_VERSION=5.6.12 ES_TYPE=doc JDK_VERSION=oraclejdk8
- ES_VERSION=5.6.12 ES_TYPE=doc JDK_VERSION=oraclejdk11
- ES_VERSION=6.8.4 ES_TYPE=doc JDK_VERSION=oraclejdk8
- ES_VERSION=6.8.4 ES_TYPE=doc JDK_VERSION=oraclejdk11
- ES_VERSION=6.8.4 ES_TYPE=_doc JDK_VERSION=oraclejdk8
- ES_VERSION=6.8.4 ES_TYPE=_doc JDK_VERSION=oraclejdk11
jdk:
- oraclejdk8
- oraclejdk11
Expand Down
45 changes: 25 additions & 20 deletions integration/address_matching.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// validate analyzer is behaving as expected

var tape = require('tape'),
elastictest = require('elastictest'),
schema = require('../schema'),
punctuation = require('../punctuation');
const elastictest = require('elastictest');
const schema = require('../schema');
const config = require('pelias-config').generate();

module.exports.tests = {};

Expand All @@ -16,7 +15,8 @@ module.exports.tests.functional = function(test, common){
// index some docs
suite.action( function( done ){
suite.client.index({
index: suite.props.index, type: 'doc',
index: suite.props.index,
type: config.schema.typeName,
id: '1', body: { address_parts: {
name: 'Mapzen HQ',
number: 30,
Expand All @@ -28,7 +28,8 @@ module.exports.tests.functional = function(test, common){

suite.action( function( done ){
suite.client.index({
index: suite.props.index, type: 'doc',
index: suite.props.index,
type: config.schema.typeName,
id: '2', body: { address_parts: {
name: 'Fake Venue',
number: 300,
Expand All @@ -40,7 +41,8 @@ module.exports.tests.functional = function(test, common){

suite.action( function( done ){
suite.client.index({
index: suite.props.index, type: 'doc',
index: suite.props.index,
type: config.schema.typeName,
id: '3', body: { address_parts: {
name: 'Mock British Address',
number: 3000,
Expand All @@ -52,7 +54,8 @@ module.exports.tests.functional = function(test, common){

suite.action( function( done ){
suite.client.index({
index: suite.props.index, type: 'doc',
index: suite.props.index,
type: config.schema.typeName,
id: '4', body: { address_parts: {
name: 'Mystery Location',
number: 300,
Expand All @@ -66,7 +69,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { bool: { must: [
{ match: { 'address_parts.number': 30 } }
]}}}
Expand All @@ -81,7 +84,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { bool: { must: [
{ match_phrase: { 'address_parts.street': 'west 26th street' } }
]}}}
Expand All @@ -96,7 +99,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { bool: { must: [
{ match_phrase: { 'address_parts.street': 'W 26th ST' } }
]}}}
Expand All @@ -111,7 +114,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { bool: { must: [
{ match: { 'address_parts.zip': '10010' } }
]}}}
Expand All @@ -126,7 +129,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { bool: { must: [
{ match: { 'address_parts.zip': 'e24dn' } }
]}}}
Expand All @@ -141,7 +144,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { bool: { must: [
{ match: { 'address_parts.zip': '100-10' } }
]}}}
Expand All @@ -156,7 +159,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { bool: { must: [
{ match: { 'address_parts.zip': '10 0 10' } }
]}}}
Expand All @@ -171,7 +174,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { bool: { must: [
{ match: { 'address_parts.zip': 'E2-4DN' } }
]}}}
Expand All @@ -186,7 +189,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { bool: { must: [
{ match: { 'address_parts.zip': 'E2 4DN' } }
]}}}
Expand Down Expand Up @@ -220,7 +223,8 @@ module.exports.tests.venue_vs_address = function(test, common){
// index a venue
suite.action( function( done ){
suite.client.index({
index: suite.props.index, type: 'doc',
index: suite.props.index,
type: config.schema.typeName,
id: '1', body: {
name: { default: 'Union Square' },
phrase: { default: 'Union Square' }
Expand All @@ -234,7 +238,8 @@ module.exports.tests.venue_vs_address = function(test, common){
return function( done ){
let id = i + 100; // id offset
suite.client.index({
index: suite.props.index, type: 'doc',
index: suite.props.index,
type: config.schema.typeName,
id: String(id),
body: {
name: { default: `${id} Union Square` },
Expand All @@ -258,7 +263,7 @@ module.exports.tests.venue_vs_address = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
searchType: 'dfs_query_then_fetch',
size: TOTAL_ADDRESS_DOCS+1,
body: {
Expand Down
16 changes: 8 additions & 8 deletions integration/admin_matching.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// validate analyzer is behaving as expected

var tape = require('tape'),
elastictest = require('elastictest'),
schema = require('../schema'),
punctuation = require('../punctuation');
const elastictest = require('elastictest');
const schema = require('../schema');
const config = require('pelias-config').generate();

module.exports.tests = {};

Expand All @@ -16,7 +15,8 @@ module.exports.tests.functional = function(test, common){
// index a document with all admin values
suite.action( function( done ){
suite.client.index({
index: suite.props.index, type: 'doc',
index: suite.props.index,
type: config.schema.typeName,
id: '1', body: {
parent: {
country: 'Test Country',
Expand Down Expand Up @@ -46,7 +46,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { match: { 'parent.country': 'Test Country' } } }
}, function( err, res ){
t.equal( err, undefined );
Expand All @@ -59,7 +59,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { match: { 'parent.country_a': 'TestCountry' } } }
}, function( err, res ){
t.equal( err, undefined );
Expand All @@ -72,7 +72,7 @@ module.exports.tests.functional = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { match: { 'parent.country_id': '100' } } }
}, function( err, res ){
t.equal( err, undefined );
Expand Down
20 changes: 10 additions & 10 deletions integration/analyzer_peliasPhrase.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// validate analyzer is behaving as expected

var tape = require('tape'),
elastictest = require('elastictest'),
schema = require('../schema'),
punctuation = require('../punctuation');
const elastictest = require('elastictest');
const schema = require('../schema');
const punctuation = require('../punctuation');
const config = require('pelias-config').generate();

module.exports.tests = {};

Expand Down Expand Up @@ -154,7 +154,7 @@ module.exports.tests.slop_query = function(test, common){
suite.action( function( done ){
suite.client.index({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
id: '1',
body: { name: { default: 'Lake Cayuga' }, phrase: { default: 'Lake Cayuga' } }
}, done );
Expand All @@ -164,7 +164,7 @@ module.exports.tests.slop_query = function(test, common){
suite.action( function( done ){
suite.client.index({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
id: '2',
body: { name: { default: 'Cayuga Lake' }, phrase: { default: 'Cayuga Lake' } }
}, done );
Expand All @@ -174,7 +174,7 @@ module.exports.tests.slop_query = function(test, common){
suite.action( function( done ){
suite.client.index({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
id: '3',
body: { name: { default: '7991 Lake Cayuga Dr' }, phrase: { default: '7991 Lake Cayuga Dr' } }
}, done );
Expand Down Expand Up @@ -211,7 +211,7 @@ module.exports.tests.slop_query = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
searchType: 'dfs_query_then_fetch',
body: buildQuery('Lake Cayuga')
}, function( err, res ){
Expand Down Expand Up @@ -249,7 +249,7 @@ module.exports.tests.slop = function(test, common){
suite.action( function( done ){
suite.client.index({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
id: '1',
body: { name: { default: '52 Görlitzer Straße' } }
}, done);
Expand All @@ -262,7 +262,7 @@ module.exports.tests.slop = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
searchType: 'dfs_query_then_fetch',
body: { query: { match_phrase: {
'name.default': {
Expand Down
12 changes: 6 additions & 6 deletions integration/analyzer_peliasQueryFullToken.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// validate analyzer is behaving as expected

var tape = require('tape'),
elastictest = require('elastictest'),
schema = require('../schema'),
punctuation = require('../punctuation');
const elastictest = require('elastictest');
const schema = require('../schema');
const punctuation = require('../punctuation');
const config = require('pelias-config').generate();

module.exports.tests = {};

Expand Down Expand Up @@ -151,7 +151,7 @@ module.exports.tests.slop = function(test, common){
suite.action( function( done ){
suite.client.index({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
id: '1',
body: { name: { default: '52 Görlitzer Straße' } }
}, done);
Expand All @@ -164,7 +164,7 @@ module.exports.tests.slop = function(test, common){
suite.assert( function( done ){
suite.client.search({
index: suite.props.index,
type: 'doc',
type: config.schema.typeName,
body: { query: { match_phrase: {
'name.default': {
'analyzer': 'peliasQueryFullToken',
Expand Down
Loading

0 comments on commit a3f1106

Please sign in to comment.