Skip to content

Commit

Permalink
chore(NA): merge and solve conflicts with master
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic committed Jun 30, 2021
2 parents 9ccd07d + bed5b6d commit 9666834
Show file tree
Hide file tree
Showing 246 changed files with 5,680 additions and 4,035 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pip3 install --user ansible

```
# Build distributions
node scripts/build --all-platforms --debug --no-oss
node scripts/build --all-platforms --debug

cd test/package

Expand Down
1 change: 1 addition & 0 deletions docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ yarn kbn watch-bazel
- @kbn/std
- @kbn/storybook
- @kbn/telemetry-utils
- @kbn/test
- @kbn/test-subj-selector
- @kbn/tinymath
- @kbn/ui-framework
Expand Down
14 changes: 7 additions & 7 deletions docs/settings/reporting-settings.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ security is enabled, <<xpack-security-encryptionKey, `xpack.security.encryptionK
[cols="2*<"]
|===
| `xpack.reporting.queue.pollInterval`
| Specify the {ref}/common-options.html#time-units[time] that the reporting poller waits between polling the index for any
| Specify the {time-units}[time] that the reporting poller waits between polling the index for any
pending Reporting jobs. Can be specified as number of milliseconds. Defaults to `3s`.

| [[xpack-reporting-q-timeout]] `xpack.reporting.queue.timeout` {ess-icon}
| {ref}/common-options.html#time-units[How long] each worker has to produce a report. If your machine is slow or under heavy
| {time-units}[How long] each worker has to produce a report. If your machine is slow or under heavy
load, you might need to increase this timeout. If a Reporting job execution goes over this time limit, the job is marked as a
failure and no download will be available. Can be specified as number of milliseconds.
Defaults to `2m`.
Expand All @@ -134,14 +134,14 @@ a| `xpack.reporting.capture.timeouts`

a| `xpack.reporting.capture.timeouts`
`.waitForElements` {ess-icon}
| Specify the {ref}/common-options.html#time-units[time] to allow the Reporting browser to wait for all visualization panels
| Specify the {time-units}[time] to allow the Reporting browser to wait for all visualization panels
to load on the page. If the time is exceeded, a screenshot is captured showing the current page, and the download link shows
a warning message. Can be specified as number of milliseconds.
Defaults to `30s`.

a| `xpack.reporting.capture.timeouts`
`.renderComplete` {ess-icon}
| Specify the {ref}/common-options.html#time-units[time] to allow the Reporting browser to wait for all visualizations to
| Specify the {time-units}[time] to allow the Reporting browser to wait for all visualizations to
fetch and render the data. If the time is exceeded, a screenshot is captured showing the current page, and the download link shows a
warning message. Can be specified as number of milliseconds.
Defaults to `30s`.
Expand All @@ -163,7 +163,7 @@ available, but there will likely be errors in the visualizations in the report.
job, as many times as this setting. Defaults to `3`.

| `xpack.reporting.capture.loadDelay`
| Specify the {ref}/common-options.html#time-units[amount of time] before taking a screenshot when visualizations are not evented.
| Specify the {time-units}[amount of time] before taking a screenshot when visualizations are not evented.
All visualizations that ship with {kib} are evented, so this setting should not have much effect. If you are seeing empty images
instead of visualizations, try increasing this value.
Defaults to `3s`.
Expand Down Expand Up @@ -212,7 +212,7 @@ a| `xpack.reporting.capture.browser`
[cols="2*<"]
|===
| [[xpack-reporting-csv]] `xpack.reporting.csv.maxSizeBytes` {ess-icon}
| The maximum {ref}/common-options.html#byte-units[byte size] of a CSV file before being truncated. This setting exists to
| The maximum {byte-units}[byte size] of a CSV file before being truncated. This setting exists to
prevent large exports from causing performance and storage issues. Can be specified as number of bytes.
Defaults to `10mb`.
|===
Expand All @@ -239,7 +239,7 @@ For information about {kib} memory limits, see <<production, using {kib} in a pr
Defaults to `500`.

| `xpack.reporting.csv.scroll.duration`
| Amount of {ref}/common-options.html#time-units[time] allowed before {kib} cleans the scroll context during a CSV export.
| Amount of {time-units}[time] allowed before {kib} cleans the scroll context during a CSV export.
Defaults to `30s`.

| `xpack.reporting.csv.checkForFormulas`
Expand Down
9 changes: 4 additions & 5 deletions jest.config.integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ module.exports = {
testPathIgnorePatterns: preset.testPathIgnorePatterns.filter(
(pattern) => !pattern.includes('integration_tests')
),
setupFilesAfterEnv: ['<rootDir>/packages/kbn-test/target/jest/setup/after_env.integration.js'],
setupFilesAfterEnv: [
'<rootDir>/node_modules/@kbn/test/target_node/jest/setup/after_env.integration.js',
],
reporters: [
'default',
[
'<rootDir>/packages/kbn-test/target/jest/junit_reporter',
{ reportName: 'Jest Integration Tests' },
],
['@kbn/test/target_node/jest/junit_reporter', { reportName: 'Jest Integration Tests' }],
],
coverageReporters: !!process.env.CI
? [['json', { file: 'jest-integration.json' }]]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@
"@kbn/spec-to-console": "link:bazel-bin/packages/kbn-spec-to-console",
"@kbn/storybook": "link:bazel-bin/packages/kbn-storybook",
"@kbn/telemetry-tools": "link:bazel-bin/packages/kbn-telemetry-tools",
"@kbn/test": "link:packages/kbn-test",
"@kbn/test": "link:bazel-bin/packages/kbn-test",
"@kbn/test-subj-selector": "link:bazel-bin/packages/kbn-test-subj-selector",
"@loaders.gl/polyfills": "^2.3.5",
"@microsoft/api-documenter": "7.7.2",
Expand Down
1 change: 1 addition & 0 deletions packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ filegroup(
"//packages/kbn-std:build",
"//packages/kbn-storybook:build",
"//packages/kbn-telemetry-tools:build",
"//packages/kbn-test:build",
"//packages/kbn-test-subj-selector:build",
"//packages/kbn-tinymath:build",
"//packages/kbn-ui-framework:build",
Expand Down
4 changes: 3 additions & 1 deletion packages/kbn-es-archiver/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ filegroup(

NPM_MODULE_EXTRA_FILES = [
"package.json",
"README.md"
]

SRC_DEPS = [
Expand All @@ -36,6 +35,8 @@ SRC_DEPS = [
"@npm//aggregate-error",
"@npm//bluebird",
"@npm//chance",
"@npm//globby",
"@npm//json-stable-stringify",
"@npm//lodash",
"@npm//sinon",
"@npm//zlib",
Expand All @@ -45,6 +46,7 @@ TYPES_DEPS = [
"@npm//@types/bluebird",
"@npm//@types/chance",
"@npm//@types/jest",
"@npm//@types/json-stable-stringify",
"@npm//@types/lodash",
"@npm//@types/node",
"@npm//@types/sinon",
Expand Down
5 changes: 1 addition & 4 deletions packages/kbn-es-archiver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@
"types": "target/index.d.ts",
"kibana": {
"devOnly": true
},
"dependencies": {
"@kbn/test": "link:../kbn-test"
}
}
}
153 changes: 153 additions & 0 deletions packages/kbn-test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@npm//@babel/cli:index.bzl", "babel")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-test"
PKG_REQUIRE_NAME = "@kbn/test"

SOURCE_FILES = glob(
[
"src/**/*"
],
exclude = [
"**/*.test.*",
"**/*.snap",
"**/__fixture__/**",
"**/__fixtures__/**",
"**/__snapshots__/**",
]
)

SRCS = SOURCE_FILES

filegroup(
name = "srcs",
srcs = SRCS,
)

NPM_MODULE_EXTRA_FILES = [
"jest/package.json",
"jest-preset.js",
"jest.config.js",
"README.md",
"package.json",
]

SRC_DEPS = [
"//packages/kbn-dev-utils",
"//packages/kbn-i18n",
"//packages/kbn-std",
"//packages/kbn-utils",
"@npm//@elastic/elasticsearch",
"@npm//axios",
"@npm//@babel/traverse",
"@npm//chance",
"@npm//del",
"@npm//enzyme",
"@npm//execa",
"@npm//exit-hook",
"@npm//form-data",
"@npm//globby",
"@npm//history",
"@npm//jest",
"@npm//jest-cli",
"@npm//jest-snapshot",
"@npm//@jest/reporters",
"@npm//joi",
"@npm//mustache",
"@npm//parse-link-header",
"@npm//prettier",
"@npm//react-dom",
"@npm//react-redux",
"@npm//react-router-dom",
"@npm//redux",
"@npm//rxjs",
"@npm//strip-ansi",
"@npm//xmlbuilder",
"@npm//xml2js",
]

TYPES_DEPS = [
"@npm//@types/chance",
"@npm//@types/enzyme",
"@npm//@types/history",
"@npm//@types/jest",
"@npm//@types/joi",
"@npm//@types/lodash",
"@npm//@types/mustache",
"@npm//@types/node",
"@npm//@types/parse-link-header",
"@npm//@types/prettier",
"@npm//@types/react-dom",
"@npm//@types/react-redux",
"@npm//@types/react-router-dom",
"@npm//@types/xml2js",
]

DEPS = SRC_DEPS + TYPES_DEPS

babel(
name = "target_node",
data = DEPS + [
":srcs",
"babel.config.js",
],
output_dir = True,
# the following arg paths includes $(execpath) as babel runs on the sandbox root
args = [
"./%s/src" % package_name(),
"--config-file",
"./%s/babel.config.js" % package_name(),
"--out-dir",
"$(@D)",
"--extensions",
".ts,.js,.tsx",
"--quiet"
],
)

ts_config(
name = "tsconfig",
src = "tsconfig.json",
deps = [
"//:tsconfig.base.json",
],
)

ts_project(
name = "tsc",
args = ['--pretty'],
srcs = SRCS,
deps = DEPS,
declaration = True,
declaration_map = True,
declaration_dir = "target_types",
emit_declaration_only = True,
incremental = True,
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)

js_library(
name = PKG_BASE_NAME,
srcs = NPM_MODULE_EXTRA_FILES,
deps = DEPS + [":target_node", ":tsc"],
package_name = PKG_REQUIRE_NAME,
visibility = ["//visibility:public"],
)

pkg_npm(
name = "npm_module",
deps = [
":%s" % PKG_BASE_NAME,
]
)

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
35 changes: 18 additions & 17 deletions packages/kbn-test/jest-preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html

const { resolve } = require('path');

module.exports = {
// The directory where Jest should output its coverage files
coverageDirectory: '<rootDir>/target/kibana-coverage/jest',
Expand All @@ -30,13 +28,16 @@ module.exports = {
moduleNameMapper: {
'@elastic/eui/lib/(.*)?': '<rootDir>/node_modules/@elastic/eui/test-env/$1',
'@elastic/eui$': '<rootDir>/node_modules/@elastic/eui/test-env',
'\\.module.(css|scss)$': '<rootDir>/packages/kbn-test/target/jest/mocks/css_module_mock.js',
'\\.(css|less|scss)$': '<rootDir>/packages/kbn-test/target/jest/mocks/style_mock.js',
'\\.module.(css|scss)$':
'<rootDir>/node_modules/@kbn/test/target_node/jest/mocks/css_module_mock.js',
'\\.(css|less|scss)$': '<rootDir>/node_modules/@kbn/test/target_node/jest/mocks/style_mock.js',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/packages/kbn-test/target/jest/mocks/file_mock.js',
'\\.ace\\.worker.js$': '<rootDir>/packages/kbn-test/target/jest/mocks/worker_module_mock.js',
'\\.editor\\.worker.js$': '<rootDir>/packages/kbn-test/target/jest/mocks/worker_module_mock.js',
'^(!!)?file-loader!': '<rootDir>/packages/kbn-test/target/jest/mocks/file_mock.js',
'<rootDir>/node_modules/@kbn/test/target_node/jest/mocks/file_mock.js',
'\\.ace\\.worker.js$':
'<rootDir>/node_modules/@kbn/test/target_node/jest/mocks/worker_module_mock.js',
'\\.editor\\.worker.js$':
'<rootDir>/node_modules/@kbn/test/target_node/jest/mocks/worker_module_mock.js',
'^(!!)?file-loader!': '<rootDir>/node_modules/@kbn/test/target_node/jest/mocks/file_mock.js',
'^src/core/(.*)': '<rootDir>/src/core/$1',
'^src/plugins/(.*)': '<rootDir>/src/plugins/$1',
},
Expand All @@ -45,20 +46,20 @@ module.exports = {
modulePathIgnorePatterns: ['__fixtures__/', 'target/'],

// Use this configuration option to add custom reporters to Jest
reporters: ['default', resolve(__dirname, './target/jest/junit_reporter')],
reporters: ['default', '@kbn/test/target_node/jest/junit_reporter'],

// The paths to modules that run some code to configure or set up the testing environment before each test
setupFiles: [
'<rootDir>/packages/kbn-test/target/jest/setup/babel_polyfill.js',
'<rootDir>/packages/kbn-test/target/jest/setup/polyfills.js',
'<rootDir>/packages/kbn-test/target/jest/setup/enzyme.js',
'<rootDir>/node_modules/@kbn/test/target_node/jest/setup/babel_polyfill.js',
'<rootDir>/node_modules/@kbn/test/target_node/jest/setup/polyfills.js',
'<rootDir>/node_modules/@kbn/test/target_node/jest/setup/enzyme.js',
],

// A list of paths to modules that run some code to configure or set up the testing framework before each test
setupFilesAfterEnv: [
'<rootDir>/packages/kbn-test/target/jest/setup/setup_test.js',
'<rootDir>/packages/kbn-test/target/jest/setup/mocks.js',
'<rootDir>/packages/kbn-test/target/jest/setup/react_testing_library.js',
'<rootDir>/node_modules/@kbn/test/target_node/jest/setup/setup_test.js',
'<rootDir>/node_modules/@kbn/test/target_node/jest/setup/mocks.js',
'<rootDir>/node_modules/@kbn/test/target_node/jest/setup/react_testing_library.js',
],

// A list of paths to snapshot serializer modules Jest should use for snapshot testing
Expand All @@ -85,7 +86,7 @@ module.exports = {

// A map from regular expressions to paths to transformers
transform: {
'^.+\\.(js|tsx?)$': '<rootDir>/packages/kbn-test/target/jest/babel_transform.js',
'^.+\\.(js|tsx?)$': '<rootDir>/node_modules/@kbn/test/target_node/jest/babel_transform.js',
'^.+\\.txt?$': 'jest-raw-loader',
'^.+\\.html?$': 'jest-raw-loader',
},
Expand All @@ -109,5 +110,5 @@ module.exports = {
],

// A custom resolver to preserve symlinks by default
resolver: '<rootDir>/packages/kbn-test/target/jest/setup/preserve_symlinks_resolver.js',
resolver: '<rootDir>/node_modules/@kbn/test/target_node/jest/setup/preserve_symlinks_resolver.js',
};
4 changes: 2 additions & 2 deletions packages/kbn-test/jest/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"main": "../target/jest",
"types": "../target/types/jest/index.d.ts"
"main": "../target_node/jest",
"types": "../target_types/jest/index.d.ts"
}
Loading

0 comments on commit 9666834

Please sign in to comment.