Skip to content

Commit

Permalink
Merge branch 'master' into bug/ccr-watcher-license-messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cjcenizal committed Apr 15, 2021
2 parents 5701904 + 2bb97f2 commit 0706a25
Show file tree
Hide file tree
Showing 453 changed files with 10,032 additions and 8,320 deletions.
72 changes: 69 additions & 3 deletions docs/developer/contributing/interpreting-ci-failures.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Clicking the link next to the check in the conversation tab of a pull request wi

To view the results of a job execution in Jenkins, either click the link in the comment left by `@elasticmachine` or search for the `kibana-ci` check in the list at the bottom of the PR. This link will take you to the top-level page for the specific job execution that failed.

image::images/job_view.png[]
image::images/job_view.png[Jenkins job view showing a test failure]

1. *Git Changes:* the list of commits that were in this build which weren't in the previous build. For Pull Requests this list is calculated by comparing against the most recent Pull Request which was tested, it is not limited to build for this specific Pull Request, so it's not very useful.
2. *Test Results:* A link to the test results screen, and shortcuts to the failed tests. Functional tests capture and store the log output from each specific test, and make it visible at these links. For other test runners only the error message is visible and log output must be tracked down in the *Pipeline Steps*.
Expand All @@ -29,6 +29,72 @@ image::images/job_view.png[]

To view the logs for a failed specific ciGroup, jest, type checkers, linters, etc., click on the *Pipeline Steps* link in from the Job page.

image::images/pipeline_steps_view.png[]
image::images/pipeline_steps_view.png[Jenkins pipeline steps screenshot]

Scroll down the page until you find a failed step *(1)*, and then look up a few lines for the `Branch:` step to see which specific job this is. If this is the job you're looking for click the little terminal icon next to the failed step *(1)* to view the logs for that specific step in the Pipeline.
Scroll down the page until you find a failed step *(1)*, and then look up a few lines for the `Branch:` step to see which specific job this is. If this is the job you're looking for click the little terminal icon next to the failed step *(1)* to view the logs for that specific step in the Pipeline.

[discrete]
=== Debugging Functional UI Test Failures

The logs in Pipeline Steps contain `Info` level logging. To debug Functional UI tests it's usually helpful to see the debug logging. You can go to the list of all tests including failures (1), or directly to the failures (2).

image::images/test_results.png[Jenkisn build screenshot]

Looking at the failure, we first look at the Error and stack trace. In the example below, this test failed to find an element within the timeout;
`Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="createSpace"])`

We know the test file from the stack trace was on line 50 of `test/accessibility/apps/spaces.ts` (this test and the stack trace context is kibana/x-pack/ so the file is https://github.com/elastic/kibana/blob/master/x-pack/test/accessibility/apps/spaces.ts#L50).
The function to click on the element was called from a page object method in `test/functional/page_objects/space_selector_page.ts` https://github.com/elastic/kibana/blob/master/x-pack/test/functional/page_objects/space_selector_page.ts#L58


[00:03:36] │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="createSpace"])
[00:03:36] │ Wait timed out after 10020ms
[00:03:36] │ info Taking screenshot "/dev/shm/workspace/parallel/24/kibana/x-pack/test/functional/screenshots/failure/Kibana spaces page meets a11y validations a11y test for click on create space page.png"
[00:03:37] │ info Current URL is: http://localhost:61241/app/home#/
[00:03:37] │ info Saving page source to: /dev/shm/workspace/parallel/24/kibana/x-pack/test/functional/failure_debug/html/Kibana spaces page meets a11y validations a11y test for click on create space page.html
[00:03:37] └- ✖ fail: Kibana spaces page meets a11y validations a11y test for click on create space page
[00:03:37] │ Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="createSpace"])
[00:03:37] │ Wait timed out after 10020ms
[00:03:37] │ at /dev/shm/workspace/parallel/24/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
[00:03:37] │ at runMicrotasks (<anonymous>)
[00:03:37] │ at processTicksAndRejections (internal/process/task_queues.js:93:5)
[00:03:37] │ at onFailure (/dev/shm/workspace/parallel/24/kibana/test/common/services/retry/retry_for_success.ts:17:9)
[00:03:37] │ at retryForSuccess (/dev/shm/workspace/parallel/24/kibana/test/common/services/retry/retry_for_success.ts:57:13)
[00:03:37] │ at Retry.try (/dev/shm/workspace/parallel/24/kibana/test/common/services/retry/retry.ts:32:14)
[00:03:37] │ at Proxy.clickByCssSelector (/dev/shm/workspace/parallel/24/kibana/test/functional/services/common/find.ts:420:7)
[00:03:37] │ at TestSubjects.click (/dev/shm/workspace/parallel/24/kibana/test/functional/services/common/test_subjects.ts:109:7)
[00:03:37] │ at SpaceSelectorPage.clickCreateSpace (test/functional/page_objects/space_selector_page.ts:59:7)
[00:03:37] │ at Context.<anonymous> (test/accessibility/apps/spaces.ts:50:7)
[00:03:37] │ at Object.apply (/dev/shm/workspace/parallel/24/kibana/node_modules/@kbn/test/src/functional_test_runner/lib/mocha/wrap_function.js:73:16)


But we don't know _why_ the test didn't find the element. It could be that its not on the right page, or that the element has changed.

Just above the `✖ fail:` line, there is a line `info Taking screenshot ...` which tells us the name of the screenshot to look for in the *Google Cloud Storage (GCS) Upload Report:*

Clicking the `[Download]` link for that png shows this image:

image::images/a11y_screenshot.png[Kibana spaces page meets a11y validations a11y test for click on create space page.png]

If we use a running Kibana instance and inspect elements, we find that the `createSpace` data-test-subj attribute is on this button in the Spaces page in Stack Management:

image::images/inspect_element.png[Kibana screenshot of Spaces page with developer tools open]

We know the test was not on the correct page to find the element to click. We see in the debug log the repeated attempts to find the element. If we scroll to the start of those repeated attempts, we see that the first thing the test did was this attempt to click on the `createSpace` element.


[00:01:30] └-> a11y test for manage spaces menu from top nav on Kibana home
[00:01:30] └-> a11y test for manage spaces page
[00:01:30] └-> a11y test for click on create space page
[00:01:30] └-> "before each" hook: global before each for "a11y test for click on create space page"
[00:01:30] │ debg TestSubjects.click(createSpace)


And we can confirm that looking at the test code.

So we need to backtrack further to find where the test opens the Spaces page. It turns out that the test before this one would have navigated to the proper page, but the test is skipped (marked `it.skip` in a PR).

it.skip('a11y test for manage spaces page', async () => {
await PageObjects.spaceSelector.clickManageSpaces();

Perhaps someone skipped the previous tests not realizing that the tests were not independent. A best practice would be for every test to be atomic and not depend on the results of any other test(s). But in UI testing, the setup takes time and we generally need to optimize for groups of tests within a describe block.
4 changes: 3 additions & 1 deletion docs/developer/getting-started/monorepo-packages.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,7 @@ yarn kbn watch-bazel

- @elastic/datemath
- @kbn/apm-utils

- @kbn/config-schema
- @kbn/tinymath
- @kbn/utility-types

Binary file added docs/developer/images/a11y_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/developer/images/inspect_element.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/developer/images/test_results.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 21 additions & 8 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -216,14 +216,27 @@ which also contains the timelion APIs and backend, look at the vis_type_timelion
|<<uiactions-plugin>>
|An API for:
- creating custom functionality (`actions`)
- creating custom user interaction events (`triggers`)
- attaching and detaching `actions` to `triggers`.
- emitting `trigger` events
- executing `actions` attached to a given `trigger`.
- exposing a context menu for the user to choose the appropriate action when there are multiple actions attached to a single trigger.
|UI Actions plugins provides API to manage *triggers* and *actions*.
*Trigger* is an abstract description of user's intent to perform an action
(like user clicking on a value inside chart). It allows us to do runtime
binding between code from different plugins. For, example one such
trigger is when somebody applies filters on dashboard; another one is when
somebody opens a Dashboard panel context menu.
*Actions* are pieces of code that execute in response to a trigger. For example,
to the dashboard filtering trigger multiple actions can be attached. Once a user
filters on the dashboard all possible actions are displayed to the user in a
popup menu and the user has to chose one.
In general this plugin provides:
- Creating custom functionality (actions).
- Creating custom user interaction events (triggers).
- Attaching and detaching actions to triggers.
- Emitting trigger events.
- Executing actions attached to a given trigger.
- Exposing a context menu for the user to choose the appropriate action when there are multiple actions attached to a single trigger.
|{kib-repo}blob/{branch}/src/plugins/url_forwarding/README.md[urlForwarding]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ readonly links: {
};
readonly addData: string;
readonly kibana: string;
readonly upgradeAssistant: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly guide: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [DomainDeprecationDetails](./kibana-plugin-core-public.domaindeprecationdetails.md) &gt; [domainId](./kibana-plugin-core-public.domaindeprecationdetails.domainid.md)

## DomainDeprecationDetails.domainId property

<b>Signature:</b>

```typescript
domainId: string;
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [DomainDeprecationDetails](./kibana-plugin-core-public.domaindeprecationdetails.md)

## DomainDeprecationDetails interface

<b>Signature:</b>

```typescript
export interface DomainDeprecationDetails extends DeprecationsDetails
```
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [domainId](./kibana-plugin-core-public.domaindeprecationdetails.domainid.md) | <code>string</code> | |
1 change: 1 addition & 0 deletions docs/development/core/public/kibana-plugin-core-public.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ The plugin integrates with the core system via lifecycle events: `setup`<!-- -->
| [CoreStart](./kibana-plugin-core-public.corestart.md) | Core services exposed to the <code>Plugin</code> start lifecycle |
| [DeprecationsServiceStart](./kibana-plugin-core-public.deprecationsservicestart.md) | DeprecationsService provides methods to fetch domain deprecation details from the Kibana server. |
| [DocLinksStart](./kibana-plugin-core-public.doclinksstart.md) | |
| [DomainDeprecationDetails](./kibana-plugin-core-public.domaindeprecationdetails.md) | |
| [ErrorToastOptions](./kibana-plugin-core-public.errortoastoptions.md) | Options available for [IToasts](./kibana-plugin-core-public.itoasts.md) error APIs. |
| [FatalErrorInfo](./kibana-plugin-core-public.fatalerrorinfo.md) | Represents the <code>message</code> and <code>stack</code> of a fatal Error |
| [FatalErrorsSetup](./kibana-plugin-core-public.fatalerrorssetup.md) | FatalErrors stop the Kibana Public Core and displays a fatal error screen with details about the Kibana build and the error. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

```typescript
start(core: CoreStart, { fieldFormats, logger }: IndexPatternsServiceStartDeps): {
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../../core/server").SavedObjectsClient, "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "update" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: ElasticsearchClient) => Promise<IndexPatternsCommonService>;
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../../core/server").SavedObjectsClient, "update" | "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: ElasticsearchClient) => Promise<IndexPatternsCommonService>;
};
```

Expand All @@ -22,6 +22,6 @@ start(core: CoreStart, { fieldFormats, logger }: IndexPatternsServiceStartDeps):
<b>Returns:</b>

`{
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../../core/server").SavedObjectsClient, "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "update" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: ElasticsearchClient) => Promise<IndexPatternsCommonService>;
indexPatternsServiceFactory: (savedObjectsClient: Pick<import("../../../../core/server").SavedObjectsClient, "update" | "get" | "delete" | "create" | "bulkCreate" | "checkConflicts" | "find" | "bulkGet" | "resolve" | "addToNamespaces" | "deleteFromNamespaces" | "bulkUpdate" | "removeReferencesTo" | "openPointInTimeForType" | "closePointInTime" | "createPointInTimeFinder" | "errors">, elasticsearchClient: ElasticsearchClient) => Promise<IndexPatternsCommonService>;
}`

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath/npm_module",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.4",
"@elastic/ems-client": "7.12.0",
"@elastic/eui": "31.10.0",
"@elastic/eui": "32.0.4",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "^9.0.1-kibana3",
"@elastic/maki": "6.3.0",
Expand All @@ -127,7 +127,7 @@
"@kbn/apm-config-loader": "link:packages/kbn-apm-config-loader",
"@kbn/apm-utils": "link:bazel-bin/packages/kbn-apm-utils/npm_module",
"@kbn/config": "link:packages/kbn-config",
"@kbn/config-schema": "link:packages/kbn-config-schema",
"@kbn/config-schema": "link:bazel-bin/packages/kbn-config-schema/npm_module",
"@kbn/crypto": "link:packages/kbn-crypto",
"@kbn/i18n": "link:packages/kbn-i18n",
"@kbn/interpreter": "link:packages/kbn-interpreter",
Expand All @@ -138,10 +138,10 @@
"@kbn/server-http-tools": "link:packages/kbn-server-http-tools",
"@kbn/server-route-repository": "link:packages/kbn-server-route-repository",
"@kbn/std": "link:packages/kbn-std",
"@kbn/tinymath": "link:packages/kbn-tinymath",
"@kbn/tinymath": "link:bazel-bin/packages/kbn-tinymath/npm_module",
"@kbn/ui-framework": "link:packages/kbn-ui-framework",
"@kbn/ui-shared-deps": "link:packages/kbn-ui-shared-deps",
"@kbn/utility-types": "link:packages/kbn-utility-types",
"@kbn/utility-types": "link:bazel-bin/packages/kbn-utility-types/npm_module",
"@kbn/utils": "link:packages/kbn-utils",
"@loaders.gl/core": "^2.3.1",
"@loaders.gl/json": "^2.3.1",
Expand Down
5 changes: 4 additions & 1 deletion packages/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ filegroup(
name = "build",
srcs = [
"//packages/elastic-datemath:build",
"//packages/kbn-apm-utils:build"
"//packages/kbn-apm-utils:build",
"//packages/kbn-config-schema:build",
"//packages/kbn-tinymath:build",
"//packages/kbn-utility-types:build",
],
)
1 change: 0 additions & 1 deletion packages/kbn-cli-dev-mode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
},
"dependencies": {
"@kbn/config": "link:../kbn-config",
"@kbn/config-schema": "link:../kbn-config-schema",
"@kbn/logging": "link:../kbn-logging",
"@kbn/server-http-tools": "link:../kbn-server-http-tools",
"@kbn/optimizer": "link:../kbn-optimizer",
Expand Down
86 changes: 86 additions & 0 deletions packages/kbn-config-schema/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
load("@npm//@bazel/typescript:index.bzl", "ts_config", "ts_project")
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")

PKG_BASE_NAME = "kbn-config-schema"
PKG_REQUIRE_NAME = "@kbn/config-schema"

SOURCE_FILES = glob([
"src/**/*.ts",
"types/joi.d.ts"
])

SRCS = SOURCE_FILES

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

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

SRC_DEPS = [
"@npm//joi",
"@npm//lodash",
"@npm//moment",
"@npm//tsd",
"@npm//type-detect",
]

TYPES_DEPS = [
"@npm//@types/jest",
"@npm//@types/joi",
"@npm//@types/lodash",
"@npm//@types/node",
"@npm//@types/type-detect",
]

DEPS = SRC_DEPS + TYPES_DEPS

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,
incremental = True,
out_dir = "target",
source_map = True,
root_dir = "src",
tsconfig = ":tsconfig",
)

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

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

filegroup(
name = "build",
srcs = [
":npm_module",
],
visibility = ["//visibility:public"],
)
10 changes: 3 additions & 7 deletions packages/kbn-config-schema/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"name": "@kbn/config-schema",
"main": "./target/out/index.js",
"types": "./target/types/index.d.ts",
"main": "./target/index.js",
"types": "./target/index.d.ts",
"version": "1.0.0",
"license": "SSPL-1.0 OR Elastic License 2.0",
"private": true,
"scripts": {
"build": "../../node_modules/.bin/tsc",
"kbn:bootstrap": "yarn build"
}
"private": true
}
8 changes: 4 additions & 4 deletions packages/kbn-config-schema/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"incremental": false,
"outDir": "./target/out",
"declarationDir": "./target/types",
"stripInternal": true,
"declaration": true,
"declarationMap": true,
"incremental": true,
"outDir": "target",
"rootDir": "src",
"sourceMap": true,
"sourceRoot": "../../../../../packages/kbn-config-schema/src",
"stripInternal": true,
"types": [
"jest",
"node"
Expand Down
1 change: 0 additions & 1 deletion packages/kbn-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
},
"dependencies": {
"@elastic/safer-lodash-set": "link:../elastic-safer-lodash-set",
"@kbn/config-schema": "link:../kbn-config-schema",
"@kbn/logging": "link:../kbn-logging",
"@kbn/std": "link:../kbn-std"
},
Expand Down
3 changes: 1 addition & 2 deletions packages/kbn-legacy-logging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"kbn:watch": "yarn build --watch"
},
"dependencies": {
"@kbn/utils": "link:../kbn-utils",
"@kbn/config-schema": "link:../kbn-config-schema"
"@kbn/utils": "link:../kbn-utils"
}
}
Loading

0 comments on commit 0706a25

Please sign in to comment.