[Backport 8.2] Fix integration test (#1690)

Co-authored-by: Tomas Della Vedova <delvedor@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2022-05-06 15:18:21 +02:00
committed by GitHub
parent bda15ca3ca
commit b159d474b0
4 changed files with 52 additions and 2 deletions

View File

@ -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.

View File

@ -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",

View File

@ -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'],
@ -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.
@ -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': ['*'],
@ -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.

View File

@ -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()