mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
Upgrade Node.js to version 14 (#83425)
This commit is contained in:
parent
e1944342af
commit
fb48e903d5
22 changed files with 116 additions and 75 deletions
|
@ -1,7 +1,7 @@
|
||||||
# NOTE: This Dockerfile is ONLY used to run certain tasks in CI. It is not used to run Kibana or as a distributable.
|
# NOTE: This Dockerfile is ONLY used to run certain tasks in CI. It is not used to run Kibana or as a distributable.
|
||||||
# If you're looking for the Kibana Docker image distributable, please see: src/dev/build/tasks/os_packages/docker_generator/templates/dockerfile.template.ts
|
# If you're looking for the Kibana Docker image distributable, please see: src/dev/build/tasks/os_packages/docker_generator/templates/dockerfile.template.ts
|
||||||
|
|
||||||
ARG NODE_VERSION=12.19.1
|
ARG NODE_VERSION=14.15.1
|
||||||
|
|
||||||
FROM node:${NODE_VERSION} AS base
|
FROM node:${NODE_VERSION} AS base
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
12.19.1
|
14.15.1
|
||||||
|
|
2
.nvmrc
2
.nvmrc
|
@ -1 +1 @@
|
||||||
12.19.1
|
14.15.1
|
||||||
|
|
12
package.json
12
package.json
|
@ -81,7 +81,7 @@
|
||||||
"**/@types/hapi__boom": "^7.4.1",
|
"**/@types/hapi__boom": "^7.4.1",
|
||||||
"**/@types/hapi__hapi": "^18.2.6",
|
"**/@types/hapi__hapi": "^18.2.6",
|
||||||
"**/@types/hapi__mimos": "4.1.0",
|
"**/@types/hapi__mimos": "4.1.0",
|
||||||
"**/@types/node": "12.19.4",
|
"**/@types/node": "14.14.7",
|
||||||
"**/cross-fetch/node-fetch": "^2.6.1",
|
"**/cross-fetch/node-fetch": "^2.6.1",
|
||||||
"**/deepmerge": "^4.2.2",
|
"**/deepmerge": "^4.2.2",
|
||||||
"**/fast-deep-equal": "^3.1.1",
|
"**/fast-deep-equal": "^3.1.1",
|
||||||
|
@ -98,7 +98,7 @@
|
||||||
"**/typescript": "4.1.2"
|
"**/typescript": "4.1.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "12.19.1",
|
"node": "14.15.1",
|
||||||
"yarn": "^1.21.1"
|
"yarn": "^1.21.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
"@elastic/ems-client": "7.11.0",
|
"@elastic/ems-client": "7.11.0",
|
||||||
"@elastic/eui": "30.2.0",
|
"@elastic/eui": "30.2.0",
|
||||||
"@elastic/filesaver": "1.1.2",
|
"@elastic/filesaver": "1.1.2",
|
||||||
"@elastic/good": "8.1.1-kibana2",
|
"@elastic/good": "^9.0.1-kibana3",
|
||||||
"@elastic/node-crypto": "1.2.1",
|
"@elastic/node-crypto": "1.2.1",
|
||||||
"@elastic/numeral": "^2.5.0",
|
"@elastic/numeral": "^2.5.0",
|
||||||
"@elastic/request-crypto": "1.1.4",
|
"@elastic/request-crypto": "1.1.4",
|
||||||
|
@ -496,7 +496,7 @@
|
||||||
"@types/mustache": "^0.8.31",
|
"@types/mustache": "^0.8.31",
|
||||||
"@types/ncp": "^2.0.1",
|
"@types/ncp": "^2.0.1",
|
||||||
"@types/nock": "^10.0.3",
|
"@types/nock": "^10.0.3",
|
||||||
"@types/node": "12.19.4",
|
"@types/node": "14.14.7",
|
||||||
"@types/node-fetch": "^2.5.7",
|
"@types/node-fetch": "^2.5.7",
|
||||||
"@types/node-forge": "^0.9.5",
|
"@types/node-forge": "^0.9.5",
|
||||||
"@types/nodemailer": "^6.4.0",
|
"@types/nodemailer": "^6.4.0",
|
||||||
|
@ -722,7 +722,7 @@
|
||||||
"less": "npm:@elastic/less@2.7.3-kibana",
|
"less": "npm:@elastic/less@2.7.3-kibana",
|
||||||
"license-checker": "^16.0.0",
|
"license-checker": "^16.0.0",
|
||||||
"listr": "^0.14.1",
|
"listr": "^0.14.1",
|
||||||
"lmdb-store": "^0.8.15",
|
"lmdb-store": "^0.9.0",
|
||||||
"load-grunt-config": "^3.0.1",
|
"load-grunt-config": "^3.0.1",
|
||||||
"loader-utils": "^1.2.3",
|
"loader-utils": "^1.2.3",
|
||||||
"log-symbols": "^2.2.0",
|
"log-symbols": "^2.2.0",
|
||||||
|
@ -805,7 +805,7 @@
|
||||||
"sass-resources-loader": "^2.0.1",
|
"sass-resources-loader": "^2.0.1",
|
||||||
"selenium-webdriver": "^4.0.0-alpha.7",
|
"selenium-webdriver": "^4.0.0-alpha.7",
|
||||||
"serve-static": "1.14.1",
|
"serve-static": "1.14.1",
|
||||||
"shelljs": "^0.8.3",
|
"shelljs": "^0.8.4",
|
||||||
"simple-git": "1.116.0",
|
"simple-git": "1.116.0",
|
||||||
"sinon": "^7.4.2",
|
"sinon": "^7.4.2",
|
||||||
"spawn-sync": "^1.0.15",
|
"spawn-sync": "^1.0.15",
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @ts-expect-error missing typedef
|
// @ts-expect-error missing typedef
|
||||||
import good from '@elastic/good';
|
import { plugin as good } from '@elastic/good';
|
||||||
import { Server } from '@hapi/hapi';
|
import { Server } from '@hapi/hapi';
|
||||||
import { LegacyLoggingConfig } from './schema';
|
import { LegacyLoggingConfig } from './schema';
|
||||||
import { getLoggingConfiguration } from './get_logging_config';
|
import { getLoggingConfiguration } from './get_logging_config';
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@babel/proposal-class-properties",
|
"@babel/proposal-class-properties",
|
||||||
"@babel/proposal-object-rest-spread"
|
"@babel/proposal-object-rest-spread",
|
||||||
|
"@babel/proposal-optional-chaining"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
* tries to mock out simple versions of the Mocha types
|
* tries to mock out simple versions of the Mocha types
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import EventEmitter from 'events';
|
import { EventEmitter } from 'events';
|
||||||
|
|
||||||
export interface Suite {
|
export interface Suite {
|
||||||
suites: Suite[];
|
suites: Suite[];
|
||||||
|
|
|
@ -70,7 +70,7 @@ describe('reduceStream', () => {
|
||||||
const errorStub = jest.fn();
|
const errorStub = jest.fn();
|
||||||
reduce$.on('data', dataStub);
|
reduce$.on('data', dataStub);
|
||||||
reduce$.on('error', errorStub);
|
reduce$.on('error', errorStub);
|
||||||
const endEvent = promiseFromEvent('end', reduce$);
|
const closeEvent = promiseFromEvent('close', reduce$);
|
||||||
|
|
||||||
reduce$.write(1);
|
reduce$.write(1);
|
||||||
reduce$.write(2);
|
reduce$.write(2);
|
||||||
|
@ -79,7 +79,7 @@ describe('reduceStream', () => {
|
||||||
reduce$.write(1000);
|
reduce$.write(1000);
|
||||||
reduce$.end();
|
reduce$.end();
|
||||||
|
|
||||||
await endEvent;
|
await closeEvent;
|
||||||
expect(reducer).toHaveBeenCalledTimes(3);
|
expect(reducer).toHaveBeenCalledTimes(3);
|
||||||
expect(dataStub).toHaveBeenCalledTimes(0);
|
expect(dataStub).toHaveBeenCalledTimes(0);
|
||||||
expect(errorStub).toHaveBeenCalledTimes(1);
|
expect(errorStub).toHaveBeenCalledTimes(1);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
/* eslint-env jest */
|
/* eslint-env jest */
|
||||||
|
|
||||||
// eslint-disable-next-line max-classes-per-file
|
// eslint-disable-next-line max-classes-per-file
|
||||||
import EventEmitter from 'events';
|
import { EventEmitter } from 'events';
|
||||||
import { assign, random } from 'lodash';
|
import { assign, random } from 'lodash';
|
||||||
import { delay } from 'bluebird';
|
import { delay } from 'bluebird';
|
||||||
|
|
||||||
|
|
19
src/cli/repl/__snapshots__/repl.test.js.snap
generated
19
src/cli/repl/__snapshots__/repl.test.js.snap
generated
|
@ -1,17 +1,22 @@
|
||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`repl it allows print depth to be specified 1`] = `"{ [32m'0'[39m: { [32m'1'[39m: { [32m'2'[39m: [36m[Object][39m } }, whoops: [36m[Circular][39m }"`;
|
exports[`repl it allows print depth to be specified 1`] = `
|
||||||
|
"[36m<ref *1>[39m {
|
||||||
|
[32m'0'[39m: { [32m'1'[39m: { [32m'2'[39m: [36m[Object][39m } },
|
||||||
|
whoops: [36m[Circular *1][39m
|
||||||
|
}"
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`repl it colorizes raw values 1`] = `"{ meaning: [33m42[39m }"`;
|
exports[`repl it colorizes raw values 1`] = `"{ meaning: [33m42[39m }"`;
|
||||||
|
|
||||||
exports[`repl it handles deep and recursive objects 1`] = `
|
exports[`repl it handles deep and recursive objects 1`] = `
|
||||||
"{
|
"[36m<ref *1>[39m {
|
||||||
[32m'0'[39m: {
|
[32m'0'[39m: {
|
||||||
[32m'1'[39m: {
|
[32m'1'[39m: {
|
||||||
[32m'2'[39m: { [32m'3'[39m: { [32m'4'[39m: { [32m'5'[39m: [36m[Object][39m } } }
|
[32m'2'[39m: { [32m'3'[39m: { [32m'4'[39m: { [32m'5'[39m: [36m[Object][39m } } }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
whoops: [36m[Circular][39m
|
whoops: [36m[Circular *1][39m
|
||||||
}"
|
}"
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
@ -51,13 +56,13 @@ Array [
|
||||||
Array [
|
Array [
|
||||||
"Promise Rejected:
|
"Promise Rejected:
|
||||||
",
|
",
|
||||||
"{
|
"[36m<ref *1>[39m {
|
||||||
[32m'0'[39m: {
|
[32m'0'[39m: {
|
||||||
[32m'1'[39m: {
|
[32m'1'[39m: {
|
||||||
[32m'2'[39m: { [32m'3'[39m: { [32m'4'[39m: { [32m'5'[39m: [36m[Object][39m } } }
|
[32m'2'[39m: { [32m'3'[39m: { [32m'4'[39m: { [32m'5'[39m: [36m[Object][39m } } }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
whoops: [36m[Circular][39m
|
whoops: [36m[Circular *1][39m
|
||||||
}",
|
}",
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
@ -71,13 +76,13 @@ Array [
|
||||||
Array [
|
Array [
|
||||||
"Promise Resolved:
|
"Promise Resolved:
|
||||||
",
|
",
|
||||||
"{
|
"[36m<ref *1>[39m {
|
||||||
[32m'0'[39m: {
|
[32m'0'[39m: {
|
||||||
[32m'1'[39m: {
|
[32m'1'[39m: {
|
||||||
[32m'2'[39m: { [32m'3'[39m: { [32m'4'[39m: { [32m'5'[39m: [36m[Object][39m } } }
|
[32m'2'[39m: { [32m'3'[39m: { [32m'4'[39m: { [32m'5'[39m: [36m[Object][39m } } }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
whoops: [36m[Circular][39m
|
whoops: [36m[Circular *1][39m
|
||||||
}",
|
}",
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
|
|
@ -200,7 +200,7 @@ export class Sha256 {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
digest(encoding: string): string {
|
digest(encoding: BufferEncoding): string {
|
||||||
// Suppose the length of the message M, in bits, is l
|
// Suppose the length of the message M, in bits, is l
|
||||||
const l = this._len * 8;
|
const l = this._len * 8;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import { TransportRequestParams, RequestBody } from '@elastic/elasticsearch/lib/
|
||||||
|
|
||||||
import { parseClientOptionsMock, ClientMock } from './configure_client.test.mocks';
|
import { parseClientOptionsMock, ClientMock } from './configure_client.test.mocks';
|
||||||
import { loggingSystemMock } from '../../logging/logging_system.mock';
|
import { loggingSystemMock } from '../../logging/logging_system.mock';
|
||||||
import EventEmitter from 'events';
|
import { EventEmitter } from 'events';
|
||||||
import type { ElasticsearchClientConfig } from './client_config';
|
import type { ElasticsearchClientConfig } from './client_config';
|
||||||
import { configureClient } from './configure_client';
|
import { configureClient } from './configure_client';
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,7 @@ describe('ProcessMetricsCollector', () => {
|
||||||
heapTotal,
|
heapTotal,
|
||||||
heapUsed,
|
heapUsed,
|
||||||
external: 0,
|
external: 0,
|
||||||
|
arrayBuffers: 0,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
jest.spyOn(v8, 'getHeapStatistics').mockImplementation(
|
jest.spyOn(v8, 'getHeapStatistics').mockImplementation(
|
||||||
|
|
|
@ -47,12 +47,12 @@ const packages: Package[] = [
|
||||||
extractMethod: 'gunzip',
|
extractMethod: 'gunzip',
|
||||||
archives: {
|
archives: {
|
||||||
'darwin-x64': {
|
'darwin-x64': {
|
||||||
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/darwin-x64-72.gz',
|
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/darwin-x64-83.gz',
|
||||||
sha256: '983106049bb86e21b7f823144b2b83e3f1408217401879b3cde0312c803512c9',
|
sha256: 'b45cd8296fd6eb2a091399c20111af43093ba30c99ed9e5d969278f5ff69ba8f',
|
||||||
},
|
},
|
||||||
'linux-x64': {
|
'linux-x64': {
|
||||||
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/linux-x64-72.gz',
|
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/linux-x64-83.gz',
|
||||||
sha256: '8b6692037f7b0df24dabc9c9b039038d1c3a3110f62121616b406c482169710a',
|
sha256: '1bbc3f90f0ba105772b37c04e3a718f69544b4df01dda00435c2b8e50b2ad0d9',
|
||||||
},
|
},
|
||||||
|
|
||||||
// ARM build is currently done manually as Github Actions used in upstream project
|
// ARM build is currently done manually as Github Actions used in upstream project
|
||||||
|
@ -62,16 +62,16 @@ const packages: Package[] = [
|
||||||
// * checkout the node-re2 project,
|
// * checkout the node-re2 project,
|
||||||
// * install Node using the same minor used by Kibana
|
// * install Node using the same minor used by Kibana
|
||||||
// * npm install, which will also create a build
|
// * npm install, which will also create a build
|
||||||
// * gzip -c build/Release/re2.node > linux-arm64-72.gz
|
// * gzip -c build/Release/re2.node > linux-arm64-83.gz
|
||||||
// * upload to kibana-ci-proxy-cache bucket
|
// * upload to kibana-ci-proxy-cache bucket
|
||||||
'linux-arm64': {
|
'linux-arm64': {
|
||||||
url:
|
url:
|
||||||
'https://storage.googleapis.com/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.15.4/linux-arm64-72.gz',
|
'https://storage.googleapis.com/kibana-ci-proxy-cache/node-re2/uhop/node-re2/releases/download/1.15.4/linux-arm64-83.gz',
|
||||||
sha256: '5942353ec9cf46a39199818d474f7af137cfbb1bc5727047fe22f31f36602a7e',
|
sha256: '4eb524ca9a79dea9c07342e487fbe91591166fdbc022ae987104840df948a4e9',
|
||||||
},
|
},
|
||||||
'win32-x64': {
|
'win32-x64': {
|
||||||
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/win32-x64-72.gz',
|
url: 'https://github.com/uhop/node-re2/releases/download/1.15.4/win32-x64-83.gz',
|
||||||
sha256: '0a6991e693577160c3e9a3f196bd2518368c52d920af331a1a183313e0175604',
|
sha256: 'efe939d3cda1d64ee3ee3e60a20613b95166d55632e702c670763ea7e69fca06',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,6 +27,9 @@ export function replaceUrlQuery(
|
||||||
queryReplacer: (query: ParsedQuery) => ParsedQuery
|
queryReplacer: (query: ParsedQuery) => ParsedQuery
|
||||||
) {
|
) {
|
||||||
const url = parseUrl(rawUrl);
|
const url = parseUrl(rawUrl);
|
||||||
|
// @ts-expect-error `queryReplacer` expects key/value pairs with values of type `string | string[] | null`,
|
||||||
|
// however `@types/node` says that `url.query` has values of type `string | string[] | undefined`.
|
||||||
|
// After investigating this, it seems that no matter what the values will be of type `string | string[]`
|
||||||
const newQuery = queryReplacer(url.query || {});
|
const newQuery = queryReplacer(url.query || {});
|
||||||
const searchQueryString = stringify(urlUtils.encodeQuery(newQuery), {
|
const searchQueryString = stringify(urlUtils.encodeQuery(newQuery), {
|
||||||
sort: false,
|
sort: false,
|
||||||
|
@ -45,6 +48,9 @@ export function replaceUrlHashQuery(
|
||||||
) {
|
) {
|
||||||
const url = parseUrl(rawUrl);
|
const url = parseUrl(rawUrl);
|
||||||
const hash = parseUrlHash(rawUrl);
|
const hash = parseUrlHash(rawUrl);
|
||||||
|
// @ts-expect-error `queryReplacer` expects key/value pairs with values of type `string | string[] | null`,
|
||||||
|
// however `@types/node` says that `url.query` has values of type `string | string[] | undefined`.
|
||||||
|
// After investigating this, it seems that no matter what the values will be of type `string | string[]`
|
||||||
const newQuery = queryReplacer(hash?.query || {});
|
const newQuery = queryReplacer(hash?.query || {});
|
||||||
const searchQueryString = stringify(urlUtils.encodeQuery(newQuery), {
|
const searchQueryString = stringify(urlUtils.encodeQuery(newQuery), {
|
||||||
sort: false,
|
sort: false,
|
||||||
|
|
|
@ -252,10 +252,16 @@ export function getRelativeToHistoryPath(absoluteUrl: string, history: History):
|
||||||
|
|
||||||
return formatUrl({
|
return formatUrl({
|
||||||
pathname: stripBasename(parsedUrl.pathname ?? null),
|
pathname: stripBasename(parsedUrl.pathname ?? null),
|
||||||
|
// @ts-expect-error `urlUtils.encodeQuery` expects key/value pairs with values of type `string | string[] | null`,
|
||||||
|
// however `@types/node` says that `url.query` has values of type `string | string[] | undefined`.
|
||||||
|
// After investigating this, it seems that no matter what the values will be of type `string | string[]`
|
||||||
search: stringify(urlUtils.encodeQuery(parsedUrl.query), { sort: false, encode: false }),
|
search: stringify(urlUtils.encodeQuery(parsedUrl.query), { sort: false, encode: false }),
|
||||||
hash: parsedHash
|
hash: parsedHash
|
||||||
? formatUrl({
|
? formatUrl({
|
||||||
pathname: parsedHash.pathname,
|
pathname: parsedHash.pathname,
|
||||||
|
// @ts-expect-error `urlUtils.encodeQuery` expects key/value pairs with values of type `string | string[] | null`,
|
||||||
|
// however `@types/node` says that `url.query` has values of type `string | string[] | undefined`.
|
||||||
|
// After investigating this, it seems that no matter what the values will be of type `string | string[]`
|
||||||
search: stringify(urlUtils.encodeQuery(parsedHash.query), { sort: false, encode: false }),
|
search: stringify(urlUtils.encodeQuery(parsedHash.query), { sort: false, encode: false }),
|
||||||
})
|
})
|
||||||
: parsedUrl.hash,
|
: parsedUrl.hash,
|
||||||
|
|
|
@ -222,6 +222,7 @@ export class LoginPage extends Component<Props, State> {
|
||||||
http={this.props.http}
|
http={this.props.http}
|
||||||
notifications={this.props.notifications}
|
notifications={this.props.notifications}
|
||||||
selector={selector}
|
selector={selector}
|
||||||
|
// @ts-expect-error Map.get is ok with getting `undefined`
|
||||||
infoMessage={infoMessageMap.get(query[LOGOUT_REASON_QUERY_STRING_PARAMETER]?.toString())}
|
infoMessage={infoMessageMap.get(query[LOGOUT_REASON_QUERY_STRING_PARAMETER]?.toString())}
|
||||||
loginAssistanceMessage={this.props.loginAssistanceMessage}
|
loginAssistanceMessage={this.props.loginAssistanceMessage}
|
||||||
loginHelp={loginHelp}
|
loginHelp={loginHelp}
|
||||||
|
|
|
@ -118,7 +118,10 @@ const normalizeTrustedAppsPageLocation = (
|
||||||
* @param query
|
* @param query
|
||||||
* @param key
|
* @param key
|
||||||
*/
|
*/
|
||||||
export const extractFirstParamValue = (query: querystring.ParsedUrlQuery, key: string): string => {
|
export const extractFirstParamValue = (
|
||||||
|
query: querystring.ParsedUrlQuery,
|
||||||
|
key: string
|
||||||
|
): string | undefined => {
|
||||||
const value = query[key];
|
const value = query[key];
|
||||||
|
|
||||||
return Array.isArray(value) ? value[value.length - 1] : value;
|
return Array.isArray(value) ? value[value.length - 1] : value;
|
||||||
|
|
|
@ -186,7 +186,7 @@ export const uiQueryParams: (
|
||||||
typeof query[key] === 'string'
|
typeof query[key] === 'string'
|
||||||
? (query[key] as string)
|
? (query[key] as string)
|
||||||
: Array.isArray(query[key])
|
: Array.isArray(query[key])
|
||||||
? (query[key][query[key].length - 1] as string)
|
? (query[key] as string[])[(query[key] as string[]).length - 1]
|
||||||
: undefined;
|
: undefined;
|
||||||
|
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
|
|
|
@ -39,7 +39,7 @@ export const getReadables = (dataPath: string): Promise<Readable> =>
|
||||||
const readable = fs.createReadStream(dataPath, { encoding: 'utf-8' });
|
const readable = fs.createReadStream(dataPath, { encoding: 'utf-8' });
|
||||||
|
|
||||||
readable.on('data', (stream) => {
|
readable.on('data', (stream) => {
|
||||||
contents.push(stream);
|
contents.push(stream as string);
|
||||||
});
|
});
|
||||||
|
|
||||||
readable.on('end', () => {
|
readable.on('end', () => {
|
||||||
|
|
|
@ -4,13 +4,10 @@
|
||||||
* you may not use this file except in compliance with the Elastic License.
|
* you may not use this file except in compliance with the Elastic License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { promisify } from 'bluebird';
|
import { promises as fs } from 'fs';
|
||||||
import fs from 'fs';
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { comparePngs } from '../../../../../../../test/functional/services/lib/compare_pngs';
|
import { comparePngs } from '../../../../../../../test/functional/services/lib/compare_pngs';
|
||||||
|
|
||||||
const mkdirAsync = promisify<void, fs.PathLike, { recursive: boolean }>(fs.mkdir);
|
|
||||||
|
|
||||||
export async function checkIfPngsMatch(
|
export async function checkIfPngsMatch(
|
||||||
actualpngPath: string,
|
actualpngPath: string,
|
||||||
baselinepngPath: string,
|
baselinepngPath: string,
|
||||||
|
@ -23,8 +20,8 @@ export async function checkIfPngsMatch(
|
||||||
const sessionDirectoryPath = path.resolve(screenshotsDirectory, 'session');
|
const sessionDirectoryPath = path.resolve(screenshotsDirectory, 'session');
|
||||||
const failureDirectoryPath = path.resolve(screenshotsDirectory, 'failure');
|
const failureDirectoryPath = path.resolve(screenshotsDirectory, 'failure');
|
||||||
|
|
||||||
await mkdirAsync(sessionDirectoryPath, { recursive: true });
|
await fs.mkdir(sessionDirectoryPath, { recursive: true });
|
||||||
await mkdirAsync(failureDirectoryPath, { recursive: true });
|
await fs.mkdir(failureDirectoryPath, { recursive: true });
|
||||||
|
|
||||||
const actualpngFileName = path.basename(actualpngPath, '.png');
|
const actualpngFileName = path.basename(actualpngPath, '.png');
|
||||||
const baselinepngFileName = path.basename(baselinepngPath, '.png');
|
const baselinepngFileName = path.basename(baselinepngPath, '.png');
|
||||||
|
@ -39,14 +36,14 @@ export async function checkIfPngsMatch(
|
||||||
// don't want to start causing failures for other devs working on OS's which are lacking snapshots. We have
|
// don't want to start causing failures for other devs working on OS's which are lacking snapshots. We have
|
||||||
// mac and linux covered which is better than nothing for now.
|
// mac and linux covered which is better than nothing for now.
|
||||||
try {
|
try {
|
||||||
log.debug(`writeFileSync: ${baselineCopyPath}`);
|
log.debug(`writeFile: ${baselineCopyPath}`);
|
||||||
fs.writeFileSync(baselineCopyPath, fs.readFileSync(baselinepngPath));
|
await fs.writeFile(baselineCopyPath, await fs.readFile(baselinepngPath));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
log.error(`No baseline png found at ${baselinepngPath}`);
|
log.error(`No baseline png found at ${baselinepngPath}`);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
log.debug(`writeFileSync: ${actualCopyPath}`);
|
log.debug(`writeFile: ${actualCopyPath}`);
|
||||||
fs.writeFileSync(actualCopyPath, fs.readFileSync(actualpngPath));
|
await fs.writeFile(actualCopyPath, await fs.readFile(actualpngPath));
|
||||||
|
|
||||||
let diffTotal = 0;
|
let diffTotal = 0;
|
||||||
|
|
||||||
|
|
79
yarn.lock
79
yarn.lock
|
@ -1489,15 +1489,14 @@
|
||||||
async-retry "^1.2.3"
|
async-retry "^1.2.3"
|
||||||
strip-ansi "^5.2.0"
|
strip-ansi "^5.2.0"
|
||||||
|
|
||||||
"@elastic/good@8.1.1-kibana2":
|
"@elastic/good@^9.0.1-kibana3":
|
||||||
version "8.1.1-kibana2"
|
version "9.0.1-kibana3"
|
||||||
resolved "https://registry.yarnpkg.com/@elastic/good/-/good-8.1.1-kibana2.tgz#3ba7413da9fae4c67f128f3e9b1dc28f24523c7a"
|
resolved "https://registry.yarnpkg.com/@elastic/good/-/good-9.0.1-kibana3.tgz#a70c2b30cbb4f44d1cf4a464562e0680322eac9b"
|
||||||
integrity sha512-2AYmQMBjmh2896FePnnGr9nwoqRxZ6bTjregDRI0CB9r4sIpIzG6J7oMa0GztdDMlrk5CslX1g9SN5EihddPlw==
|
integrity sha512-UtPKr0TmlkL1abJfO7eEVUTqXWzLKjMkz+65FvxU/Ub9kMAr4No8wHLRfDHFzBkWoDIbDWygwld011WzUnea1Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
hoek "5.x.x"
|
"@hapi/hoek" "9.x.x"
|
||||||
joi "13.x.x"
|
"@hapi/oppsy" "3.x.x"
|
||||||
oppsy "2.x.x"
|
"@hapi/validate" "1.x.x"
|
||||||
pumpify "1.3.x"
|
|
||||||
|
|
||||||
"@elastic/makelogs@^6.0.0":
|
"@elastic/makelogs@^6.0.0":
|
||||||
version "6.0.0"
|
version "6.0.0"
|
||||||
|
@ -1847,7 +1846,7 @@
|
||||||
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.5.1.tgz#fde96064ca446dec8c55a8c2f130957b070c6e06"
|
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.5.1.tgz#fde96064ca446dec8c55a8c2f130957b070c6e06"
|
||||||
integrity sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow==
|
integrity sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow==
|
||||||
|
|
||||||
"@hapi/hoek@^9.0.0":
|
"@hapi/hoek@9.x.x", "@hapi/hoek@^9.0.0":
|
||||||
version "9.1.0"
|
version "9.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.1.0.tgz#6c9eafc78c1529248f8f4d92b0799a712b6052c6"
|
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.1.0.tgz#6c9eafc78c1529248f8f4d92b0799a712b6052c6"
|
||||||
integrity sha512-i9YbZPN3QgfighY/1X1Pu118VUz2Fmmhd6b2n0/O8YVgGGfw0FbUYoA97k7FkpGJ+pLCFEDLUmAPPV4D1kpeFw==
|
integrity sha512-i9YbZPN3QgfighY/1X1Pu118VUz2Fmmhd6b2n0/O8YVgGGfw0FbUYoA97k7FkpGJ+pLCFEDLUmAPPV4D1kpeFw==
|
||||||
|
@ -1912,6 +1911,13 @@
|
||||||
"@hapi/hoek" "8.x.x"
|
"@hapi/hoek" "8.x.x"
|
||||||
"@hapi/vise" "3.x.x"
|
"@hapi/vise" "3.x.x"
|
||||||
|
|
||||||
|
"@hapi/oppsy@3.x.x":
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@hapi/oppsy/-/oppsy-3.0.0.tgz#1ae397e200e86d0aa41055f103238ed8652947ca"
|
||||||
|
integrity sha512-0kfUEAqIi21GzFVK2snMO07znMEBiXb+/pOx1dmgOO9TuvFstcfmHU5i56aDfiFP2DM5WzQCU2UWc2gK1lMDhQ==
|
||||||
|
dependencies:
|
||||||
|
"@hapi/hoek" "9.x.x"
|
||||||
|
|
||||||
"@hapi/pez@^4.1.2":
|
"@hapi/pez@^4.1.2":
|
||||||
version "4.1.2"
|
version "4.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/@hapi/pez/-/pez-4.1.2.tgz#14984d0c31fed348f10c962968a21d9761f55503"
|
resolved "https://registry.yarnpkg.com/@hapi/pez/-/pez-4.1.2.tgz#14984d0c31fed348f10c962968a21d9761f55503"
|
||||||
|
@ -2002,6 +2008,14 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
"@hapi/hoek" "^9.0.0"
|
"@hapi/hoek" "^9.0.0"
|
||||||
|
|
||||||
|
"@hapi/validate@1.x.x":
|
||||||
|
version "1.1.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@hapi/validate/-/validate-1.1.3.tgz#f750a07283929e09b51aa16be34affb44e1931ad"
|
||||||
|
integrity sha512-/XMR0N0wjw0Twzq2pQOzPBZlDzkekGcoCtzO314BpIEsbXdYGthQUbxgkGDf4nhk1+IPDAsXqWjMohRQYO06UA==
|
||||||
|
dependencies:
|
||||||
|
"@hapi/hoek" "^9.0.0"
|
||||||
|
"@hapi/topo" "^5.0.0"
|
||||||
|
|
||||||
"@hapi/vise@3.x.x":
|
"@hapi/vise@3.x.x":
|
||||||
version "3.1.1"
|
version "3.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/@hapi/vise/-/vise-3.1.1.tgz#dfc88f2ac90682f48bdc1b3f9b8f1eab4eabe0c8"
|
resolved "https://registry.yarnpkg.com/@hapi/vise/-/vise-3.1.1.tgz#dfc88f2ac90682f48bdc1b3f9b8f1eab4eabe0c8"
|
||||||
|
@ -5262,10 +5276,10 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
"@types/node@*", "@types/node@12.19.4", "@types/node@8.10.54", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^12.0.2":
|
"@types/node@*", "@types/node@14.14.7", "@types/node@8.10.54", "@types/node@>= 8", "@types/node@>=8.9.0", "@types/node@^12.0.2":
|
||||||
version "12.19.4"
|
version "14.14.7"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.19.4.tgz#cdfbb62e26c7435ed9aab9c941393cc3598e9b46"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.7.tgz#8ea1e8f8eae2430cf440564b98c6dfce1ec5945d"
|
||||||
integrity sha512-o3oj1bETk8kBwzz1WlO6JWL/AfAA3Vm6J1B3C9CsdxHYp7XgPiH7OEXPUbZTndHlRaIElrANkQfe6ZmfJb3H2w==
|
integrity sha512-Zw1vhUSQZYw+7u5dAwNbIA9TuTotpzY/OF7sJM9FqPOF3SPjKnxrjoTktXDZgUjybf4cWVBP7O8wvKdSaGHweg==
|
||||||
|
|
||||||
"@types/nodemailer@^6.4.0":
|
"@types/nodemailer@^6.4.0":
|
||||||
version "6.4.0"
|
version "6.4.0"
|
||||||
|
@ -18818,14 +18832,14 @@ lmdb-store-0.9@0.7.3:
|
||||||
node-gyp-build "^4.2.3"
|
node-gyp-build "^4.2.3"
|
||||||
weak-lru-cache "^0.3.9"
|
weak-lru-cache "^0.3.9"
|
||||||
|
|
||||||
lmdb-store@^0.8.15:
|
lmdb-store@^0.9.0:
|
||||||
version "0.8.15"
|
version "0.9.0"
|
||||||
resolved "https://registry.yarnpkg.com/lmdb-store/-/lmdb-store-0.8.15.tgz#4efb0341c2df505dd6f3a7f26f834f0a142a80a2"
|
resolved "https://registry.yarnpkg.com/lmdb-store/-/lmdb-store-0.9.0.tgz#9a07735baaabcb8a46ee08c58ce1d578b69bdc12"
|
||||||
integrity sha512-4Q0WZh2FmcJC6esZRUWMfkCmNiz0WU9cOgrxt97ZMTnVfHyOdZhtrt0oOF5EQPfetxxJf/BorKY28aX92R6G6g==
|
integrity sha512-5yxZ/s2J4w5mq3II5w2i4EiAAT+RvGZ3dtiWPYQDV/F8BpwqZOi7QmHdwawf15stvXv9P92Rm7t2WPbjOV9Xkg==
|
||||||
dependencies:
|
dependencies:
|
||||||
fs-extra "^9.0.1"
|
fs-extra "^9.0.1"
|
||||||
lmdb-store-0.9 "0.7.3"
|
lmdb-store-0.9 "0.7.3"
|
||||||
msgpackr "^0.5.4"
|
msgpackr "^0.6.0"
|
||||||
nan "^2.14.1"
|
nan "^2.14.1"
|
||||||
node-gyp-build "^4.2.3"
|
node-gyp-build "^4.2.3"
|
||||||
weak-lru-cache "^0.3.9"
|
weak-lru-cache "^0.3.9"
|
||||||
|
@ -20344,21 +20358,28 @@ ms@2.1.1, ms@^2.0.0, ms@^2.1.1:
|
||||||
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
|
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
|
||||||
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
|
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
|
||||||
|
|
||||||
msgpackr-extract@^0.3.5:
|
msgpackr-extract@^0.3.5, msgpackr-extract@^0.3.6:
|
||||||
version "0.3.5"
|
version "0.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/msgpackr-extract/-/msgpackr-extract-0.3.5.tgz#0f206da058bd3dad0f8605d324de001a8f4de967"
|
resolved "https://registry.yarnpkg.com/msgpackr-extract/-/msgpackr-extract-0.3.6.tgz#f20c0a278e44377471b1fa2a3a75a32c87693755"
|
||||||
integrity sha512-zHhstybu+m/j3H6CVBMcILVIzATK6dWRGtlePJjsnSAj8kLT5joMa9i0v21Uc80BPNDcwFsnG/dz2318tfI81w==
|
integrity sha512-ASUrKn0MEFp2onn+xUBQhCNR6+RzzQAcs6p0RqKQ9sfqOZjzQ21a+ASyzgh+QAJrKcWBiZLN6L4+iXKPJV6pXg==
|
||||||
dependencies:
|
dependencies:
|
||||||
nan "^2.14.1"
|
nan "^2.14.1"
|
||||||
node-gyp-build "^4.2.3"
|
node-gyp-build "^4.2.3"
|
||||||
|
|
||||||
msgpackr@^0.5.3, msgpackr@^0.5.4:
|
msgpackr@^0.5.3:
|
||||||
version "0.5.4"
|
version "0.5.4"
|
||||||
resolved "https://registry.yarnpkg.com/msgpackr/-/msgpackr-0.5.4.tgz#c21c03d5e132d2e54d0b9ced02a75b1f48413380"
|
resolved "https://registry.yarnpkg.com/msgpackr/-/msgpackr-0.5.4.tgz#c21c03d5e132d2e54d0b9ced02a75b1f48413380"
|
||||||
integrity sha512-ILEWtIWwd5ESWHKoVjJ4GP7JWkpuAUJ20qi2j2qEC6twecBmK4E6YG3QW847OpmvdAhMJGq2LoDJRn/kNERTeQ==
|
integrity sha512-ILEWtIWwd5ESWHKoVjJ4GP7JWkpuAUJ20qi2j2qEC6twecBmK4E6YG3QW847OpmvdAhMJGq2LoDJRn/kNERTeQ==
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
msgpackr-extract "^0.3.5"
|
msgpackr-extract "^0.3.5"
|
||||||
|
|
||||||
|
msgpackr@^0.6.0:
|
||||||
|
version "0.6.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/msgpackr/-/msgpackr-0.6.0.tgz#57f75f80247ed3bcb937b7b5b0c7ef48123bee80"
|
||||||
|
integrity sha512-GF+hXvh1mn9f43ndEigmyTwomeJ/5OQWaxJTMeFrXouGTCYvzEtnF7Bd1DTCxOHXO85BeWFgUVA7Ev61R2KkVw==
|
||||||
|
optionalDependencies:
|
||||||
|
msgpackr-extract "^0.3.6"
|
||||||
|
|
||||||
multicast-dns-service-types@^1.1.0:
|
multicast-dns-service-types@^1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901"
|
resolved "https://registry.yarnpkg.com/multicast-dns-service-types/-/multicast-dns-service-types-1.1.0.tgz#899f11d9686e5e05cb91b35d5f0e63b773cfc901"
|
||||||
|
@ -21311,7 +21332,7 @@ opn@^5.5.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
is-wsl "^1.1.0"
|
is-wsl "^1.1.0"
|
||||||
|
|
||||||
oppsy@2.x.x, oppsy@^2.0.0:
|
oppsy@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/oppsy/-/oppsy-2.0.0.tgz#3a194517adc24c3c61cdc56f35f4537e93a35e34"
|
resolved "https://registry.yarnpkg.com/oppsy/-/oppsy-2.0.0.tgz#3a194517adc24c3c61cdc56f35f4537e93a35e34"
|
||||||
integrity sha1-OhlFF63CTDxhzcVvNfRTfpOjXjQ=
|
integrity sha1-OhlFF63CTDxhzcVvNfRTfpOjXjQ=
|
||||||
|
@ -22732,7 +22753,7 @@ pump@^3.0.0:
|
||||||
end-of-stream "^1.1.0"
|
end-of-stream "^1.1.0"
|
||||||
once "^1.3.1"
|
once "^1.3.1"
|
||||||
|
|
||||||
pumpify@1.3.x, pumpify@^1.3.3, pumpify@^1.3.5:
|
pumpify@^1.3.3, pumpify@^1.3.5:
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.3.6.tgz#00d40e5ded0a3bf1e0788b1c0cf426a42882ab64"
|
resolved "https://registry.yarnpkg.com/pumpify/-/pumpify-1.3.6.tgz#00d40e5ded0a3bf1e0788b1c0cf426a42882ab64"
|
||||||
integrity sha512-BurGAcvezsINL5US9T9wGHHcLNrG6MCp//ECtxron3vcR+Rfx5Anqq7HbZXNJvFQli8FGVsWCAvywEJFV5Hx/Q==
|
integrity sha512-BurGAcvezsINL5US9T9wGHHcLNrG6MCp//ECtxron3vcR+Rfx5Anqq7HbZXNJvFQli8FGVsWCAvywEJFV5Hx/Q==
|
||||||
|
@ -25422,10 +25443,10 @@ shelljs@^0.6.0:
|
||||||
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.6.1.tgz#ec6211bed1920442088fe0f70b2837232ed2c8a8"
|
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.6.1.tgz#ec6211bed1920442088fe0f70b2837232ed2c8a8"
|
||||||
integrity sha1-7GIRvtGSBEIIj+D3Cyg3Iy7SyKg=
|
integrity sha1-7GIRvtGSBEIIj+D3Cyg3Iy7SyKg=
|
||||||
|
|
||||||
shelljs@^0.8.3:
|
shelljs@^0.8.3, shelljs@^0.8.4:
|
||||||
version "0.8.3"
|
version "0.8.4"
|
||||||
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097"
|
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.4.tgz#de7684feeb767f8716b326078a8a00875890e3c2"
|
||||||
integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==
|
integrity sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
glob "^7.0.0"
|
glob "^7.0.0"
|
||||||
interpret "^1.0.0"
|
interpret "^1.0.0"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue