Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into nls/jest-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
smith committed Oct 21, 2021
2 parents ad64f06 + c491d8c commit 695b287
Show file tree
Hide file tree
Showing 591 changed files with 63,000 additions and 53,692 deletions.
8 changes: 1 addition & 7 deletions .buildkite/pipelines/flaky_tests/pipeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ const inputs = [
default: 0,
required: true,
},
{
key: 'ftsr-concurrency',
text: 'Max concurrency per step',
default: 20,
required: true,
},
];

for (let i = 1; i <= OSS_CI_GROUPS; i++) {
Expand All @@ -36,7 +30,7 @@ for (let i = 1; i <= XPACK_CI_GROUPS; i++) {
const pipeline = {
steps: [
{
input: 'Number of Runs',
input: 'Number of Runs - Click Me',
fields: inputs,
},
{
Expand Down
25 changes: 21 additions & 4 deletions .buildkite/pipelines/flaky_tests/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ const overrideCount = parseInt(
execSync(`buildkite-agent meta-data get 'ftsr-override-count'`).toString().trim()
);

const concurrency =
parseInt(execSync(`buildkite-agent meta-data get 'ftsr-concurrency'`).toString().trim()) || 20;
const concurrency = 25;
const initialJobs = 3;

let totalJobs = initialJobs;

const testSuites = [];
for (const key of keys) {
Expand All @@ -21,12 +23,25 @@ for (const key of keys) {
const value =
overrideCount || execSync(`buildkite-agent meta-data get '${key}'`).toString().trim();

const count = value === '' ? defaultCount : parseInt(value);
totalJobs += count;

testSuites.push({
key: key.replace('ftsr-suite/', ''),
count: value === '' ? defaultCount : parseInt(value),
count: count,
});
}

if (totalJobs > 500) {
console.error('+++ Too many tests');
console.error(
`Buildkite builds can only contain 500 steps in total. Found ${totalJobs} in total. Make sure your test runs are less than ${
500 - initialJobs
}`
);
process.exit(1);
}

const steps = [];
const pipeline = {
env: {
Expand All @@ -46,7 +61,7 @@ steps.push({
for (const testSuite of testSuites) {
const TEST_SUITE = testSuite.key;
const RUN_COUNT = testSuite.count;
const UUID = TEST_SUITE + process.env.UUID;
const UUID = process.env.UUID;

const JOB_PARTS = TEST_SUITE.split('/');
const IS_XPACK = JOB_PARTS[0] === 'xpack';
Expand All @@ -65,6 +80,7 @@ for (const testSuite of testSuites) {
parallelism: RUN_COUNT,
concurrency: concurrency,
concurrency_group: UUID,
concurrency_method: 'eager',
});
} else {
steps.push({
Expand All @@ -75,6 +91,7 @@ for (const testSuite of testSuites) {
parallelism: RUN_COUNT,
concurrency: concurrency,
concurrency_group: UUID,
concurrency_method: 'eager',
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Use the <<action-settings, Action configuration settings>> to customize connecto
actionTypeId: .servicenow-sir
config:
apiUrl: https://example.service-now.com/
isLegacy: false
secrets:
username: testuser
password: passwordkeystorevalue
Expand All @@ -45,6 +46,9 @@ Use the <<action-settings, Action configuration settings>> to customize connecto
Config defines information for the connector type.

`apiUrl`:: An address that corresponds to *URL*.
`isLegacy`:: A boolean that indicates if the connector should use the Table API (legacy) or the Import Set API.

Note: If `isLegacy` is set to false the Elastic application should be installed in ServiceNow.

Secrets defines sensitive information for the connector type.

Expand Down
4 changes: 4 additions & 0 deletions docs/management/connectors/action-types/servicenow.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Use the <<action-settings, Action configuration settings>> to customize connecto
actionTypeId: .servicenow
config:
apiUrl: https://example.service-now.com/
isLegacy: false
secrets:
username: testuser
password: passwordkeystorevalue
Expand All @@ -45,6 +46,9 @@ Use the <<action-settings, Action configuration settings>> to customize connecto
Config defines information for the connector type.

`apiUrl`:: An address that corresponds to *URL*.
`isLegacy`:: A boolean that indicates if the connector should use the Table API (legacy) or the Import Set API.

Note: If `isLegacy` is set to false the Elastic application should be installed in ServiceNow.

Secrets defines sensitive information for the connector type.

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@elastic/apm-generator": "link:bazel-bin/packages/elastic-apm-generator",
"@elastic/apm-rum": "^5.9.1",
"@elastic/apm-rum-react": "^1.3.1",
"@elastic/charts": "37.0.0",
"@elastic/charts": "38.0.1",
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.21",
"@elastic/ems-client": "7.16.0",
Expand Down Expand Up @@ -197,7 +197,7 @@
"chroma-js": "^1.4.1",
"classnames": "2.2.6",
"color": "1.0.3",
"commander": "^3.0.2",
"commander": "^4.1.1",
"compare-versions": "3.5.1",
"concat-stream": "1.6.2",
"constate": "^1.3.2",
Expand Down Expand Up @@ -248,6 +248,7 @@
"idx": "^2.5.6",
"immer": "^9.0.6",
"inline-style": "^2.0.0",
"inquirer": "^7.3.3",
"intl": "^1.2.5",
"intl-format-cache": "^2.1.0",
"intl-messageformat": "^2.2.0",
Expand Down Expand Up @@ -288,7 +289,6 @@
"moment-timezone": "^0.5.27",
"monaco-editor": "^0.22.3",
"mustache": "^2.3.2",
"ngreact": "^0.5.1",
"nock": "12.0.3",
"node-fetch": "^2.6.1",
"node-forge": "^0.10.0",
Expand All @@ -297,6 +297,7 @@
"object-hash": "^1.3.1",
"object-path-immutable": "^3.1.1",
"opn": "^5.5.0",
"ora": "^4.0.4",
"p-limit": "^3.0.1",
"p-map": "^4.0.0",
"p-retry": "^4.2.0",
Expand All @@ -309,7 +310,7 @@
"prop-types": "^15.7.2",
"proxy-from-env": "1.0.0",
"puid": "1.0.7",
"puppeteer": "^8.0.0",
"puppeteer": "^10.2.0",
"query-string": "^6.13.2",
"random-word-slugs": "^0.0.5",
"raw-loader": "^3.1.0",
Expand Down Expand Up @@ -720,7 +721,6 @@
"html": "1.0.0",
"html-loader": "^0.5.5",
"http-proxy": "^1.18.1",
"inquirer": "^7.3.3",
"is-glob": "^4.0.1",
"is-path-inside": "^3.0.2",
"istanbul-instrumenter-loader": "^3.0.1",
Expand Down Expand Up @@ -762,9 +762,9 @@
"null-loader": "^3.0.0",
"nyc": "^15.0.1",
"oboe": "^2.1.4",
"ora": "^4.0.4",
"parse-link-header": "^1.0.1",
"pbf": "3.2.1",
"pdf-to-img": "^1.1.1",
"pirates": "^4.0.1",
"pixelmatch": "^5.1.0",
"postcss": "^7.0.32",
Expand Down
2 changes: 2 additions & 0 deletions packages/kbn-es-query/src/filters/build_filters/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export type FilterMeta = {
negate?: boolean;
// controlledBy is there to identify who owns the filter
controlledBy?: string;
// allows grouping of filters
group?: string;
// index and type are optional only because when you create a new filter, there are no defaults
index?: string;
isMultiIndex?: boolean;
Expand Down
189 changes: 189 additions & 0 deletions packages/kbn-monaco/src/xjson/grammar.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import { createParser } from './grammar';

describe('createParser', () => {
let parser: ReturnType<typeof createParser>;

beforeEach(() => {
parser = createParser();
});

test('should create a xjson grammar parser', () => {
expect(createParser()).toBeInstanceOf(Function);
});

test('should return no annotations in case of valid json', () => {
expect(
parser(`
{"menu": {
"id": "file",
"value": "File",
"quotes": "'\\"",
"popup": {
"actions": [
"new",
"open",
"close"
],
"menuitem": [
{"value": "New"},
{"value": "Open"},
{"value": "Close"}
]
}
}}
`)
).toMatchInlineSnapshot(`
Object {
"annotations": Array [],
}
`);
});

test('should support triple quotes', () => {
expect(
parser(`
{"menu": {
"id": """
file
""",
"value": "File"
}}
`)
).toMatchInlineSnapshot(`
Object {
"annotations": Array [],
}
`);
});

test('triple quotes should be correctly closed', () => {
expect(
parser(`
{"menu": {
"id": """"
file
"",
"value": "File"
}}
`)
).toMatchInlineSnapshot(`
Object {
"annotations": Array [
Object {
"at": 36,
"text": "Expected ',' instead of '\\"'",
"type": "error",
},
],
}
`);
});

test('an escaped quote can be appended to the end of triple quotes', () => {
expect(
parser(`
{"menu": {
"id": """
file
\\"""",
"value": "File"
}}
`)
).toMatchInlineSnapshot(`
Object {
"annotations": Array [],
}
`);
});

test('text values should be wrapper into quotes', () => {
expect(
parser(`
{"menu": {
"id": id,
"value": "File"
}}
`)
).toMatchInlineSnapshot(`
Object {
"annotations": Array [
Object {
"at": 36,
"text": "Unexpected 'i'",
"type": "error",
},
],
}
`);
});

test('check for close quotes', () => {
expect(
parser(`
{"menu": {
"id": "id,
"value": "File"
}}
`)
).toMatchInlineSnapshot(`
Object {
"annotations": Array [
Object {
"at": 52,
"text": "Expected ',' instead of 'v'",
"type": "error",
},
],
}
`);
});
test('no duplicate keys', () => {
expect(
parser(`
{"menu": {
"id": "id",
"id": "File"
}}
`)
).toMatchInlineSnapshot(`
Object {
"annotations": Array [
Object {
"at": 53,
"text": "Duplicate key \\"id\\"",
"type": "warning",
},
],
}
`);
});

test('all curly quotes should be closed', () => {
expect(
parser(`
{"menu": {
"id": "id",
"name": "File"
}
`)
).toMatchInlineSnapshot(`
Object {
"annotations": Array [
Object {
"at": 82,
"text": "Expected ',' instead of ''",
"type": "error",
},
],
}
`);
});
});
Loading

0 comments on commit 695b287

Please sign in to comment.