Skip to content

Fix integration test #1689

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

Merged
merged 12 commits into from
May 6, 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Elasticsearch Node.js client

[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://clients-ci.elastic.co/buildStatus/icon?job=elastic%2Belasticsearch-js%2Bmain)](https://clients-ci.elastic.co/view/Javascript/job/elastic+elasticsearch-js+main/) [![Node CI](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml/badge.svg)](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml) [![codecov](https://codecov.io/gh/elastic/elasticsearch-js/branch/master/graph/badge.svg)](https://codecov.io/gh/elastic/elasticsearch-js) [![NPM downloads](https://img.shields.io/npm/dm/@elastic/elasticsearch.svg?style=flat)](https://www.npmjs.com/package/@elastic/elasticsearch)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/) [![Build Status](https://clients-ci.elastic.co/buildStatus/icon?job=elastic%2Belasticsearch-js%2Bmain)](https://clients-ci.elastic.co/view/JavaScript/job/elastic+elasticsearch-js+main/) [![Node CI](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml/badge.svg)](https://github.com/elastic/elasticsearch-js/actions/workflows/nodejs.yml) [![codecov](https://codecov.io/gh/elastic/elasticsearch-js/branch/master/graph/badge.svg)](https://codecov.io/gh/elastic/elasticsearch-js) [![NPM downloads](https://img.shields.io/npm/dm/@elastic/elasticsearch.svg?style=flat)](https://www.npmjs.com/package/@elastic/elasticsearch)

The official Node.js client for Elasticsearch.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"ms": "^2.1.3",
"node-abort-controller": "^3.0.1",
"node-fetch": "^2.6.7",
"ora": "^6.1.0",
"ora": "^5.4.1",
"proxy": "^1.0.2",
"rimraf": "^3.0.2",
"semver": "^7.3.7",
Expand Down
11 changes: 11 additions & 0 deletions test/integration/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ const MAX_FILE_TIME = 1000 * 30
const MAX_TEST_TIME = 1000 * 3

const freeSkips = {
// not supported yet
'/free/cluster.desired_nodes/10_basic.yml': ['*'],
'/free/health/30_feature.yml': ['*'],
'/free/health/40_useractions.yml': ['*'],
// the v8 client never sends the scroll_id in querystgring,
// the way the test is structured causes a security exception
'free/scroll/10_basic.yml': ['Body params override query string'],
Expand All @@ -63,13 +67,17 @@ const freeSkips = {
// the expected error is returning a 503,
// which triggers a retry and the node to be marked as dead
'search.aggregation/240_max_buckets.yml': ['*'],
// long values and json do not play nicely together
'search.aggregation/40_range.yml': ['Min and max long range bounds'],
// the yaml runner assumes that null means "does not exists",
// while null is a valid json value, so the check will fail
'search/320_disallow_queries.yml': ['Test disallow expensive queries'],
'free/tsdb/90_unsupported_operations.yml': ['noop update']
}
const platinumBlackList = {
'api_key/10_basic.yml': ['Test get api key'],
'api_key/20_query.yml': ['*'],
'api_key/11_invalidation.yml': ['Test invalidate api key by realm name'],
'analytics/histogram.yml': ['Histogram requires values in increasing order'],
// this two test cases are broken, we should
// return on those in the future.
Expand Down Expand Up @@ -107,6 +115,7 @@ const platinumBlackList = {
// Investigate why is failing
'ml/inference_crud.yml': ['*'],
'ml/categorization_agg.yml': ['Test categorization aggregation with poor settings'],
'ml/filter_crud.yml': ['*'],
// investigate why this is failing
'monitoring/bulk/10_basic.yml': ['*'],
'monitoring/bulk/20_privileges.yml': ['*'],
Expand All @@ -119,6 +128,8 @@ const platinumBlackList = {
'service_accounts/10_basic.yml': ['*'],
// we are setting two certificates in the docker config
'ssl/10_basic.yml': ['*'],
'token/10_basic.yml': ['*'],
'token/11_invalidation.yml': ['*'],
// very likely, the index template has not been loaded yet.
// we should run a indices.existsTemplate, but the name of the
// template may vary during time.
Expand Down
39 changes: 39 additions & 0 deletions test/integration/test-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,45 @@ function build (opts = {}) {
client, 'tasks.cancel',
tasks.map(id => ({ task_id: id }))
)

// cleanup ml
const jobsList = await client.ml.getJobs()
const jobsIds = jobsList.jobs.map(j => j.job_id)
await helper.runInParallel(
client, 'ml.deleteJob',
jobsIds.map(j => ({ job_id: j, force: true }))
)

const dataFrame = await client.ml.getDataFrameAnalytics()
const dataFrameIds = dataFrame.data_frame_analytics.map(d => d.id)
await helper.runInParallel(
client, 'ml.deleteDataFrameAnalytics',
dataFrameIds.map(d => ({ id: d, force: true }))
)

const calendars = await client.ml.getCalendars()
const calendarsId = calendars.calendars.map(c => c.calendar_id)
await helper.runInParallel(
client, 'ml.deleteCalendar',
calendarsId.map(c => ({ calendar_id: c }))
)

const training = await client.ml.getTrainedModels()
const trainingId = training.trained_model_configs
.filter(t => t.created_by !== '_xpack')
.map(t => t.model_id)
await helper.runInParallel(
client, 'ml.deleteTrainedModel',
trainingId.map(t => ({ model_id: t, force: true }))
)

// cleanup transforms
const transforms = await client.transform.getTransform()
const transformsId = transforms.transforms.map(t => t.id)
await helper.runInParallel(
client, 'transform.deleteTransform',
transformsId.map(t => ({ transform_id: t, force: true }))
)
}

const shutdownNodes = await client.shutdown.getNode()
Expand Down