Skip to content

Commit

Permalink
fix ct issues for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
achyutjhunjhunwala committed Oct 24, 2024
1 parent 3192cc7 commit 2e79d84
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 182 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const logsNginxMappings = (dataset: string): MappingTypeMapping => ({
properties: {
dataset: {
type: 'constant_keyword',
value: 'nginx.access',
value: dataset,
},
namespace: {
type: 'constant_keyword',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
);

const currentFieldLimitValue = await currentFieldLimitInput.getAttribute('value');
const currentFieldLimit = parseInt(currentFieldLimitValue, 10);
const currentFieldLimit = parseInt(currentFieldLimitValue as string, 10);
const currentFieldLimitDisabledStatus = await currentFieldLimitInput.getAttribute(
'disabled'
);
Expand All @@ -759,7 +759,7 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid
);

const newFieldLimitValue = await newFieldLimitInput.getAttribute('value');
const newFieldLimit = parseInt(newFieldLimitValue, 10);
const newFieldLimit = parseInt(newFieldLimitValue as string, 10);

// Should be 30% more the current limit
const newLimit = Math.round(currentFieldLimit * 1.3);
Expand Down Expand Up @@ -841,7 +841,7 @@ export default function ({ getService, getPageObjects }: DatasetQualityFtrProvid

// Should point to the component template page
expect(
ctLinkURL.endsWith(
ctLinkURL?.endsWith(
`/data/index_management/component_templates/${encodeURIComponent(
componentTemplateName
)}`
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/functional/page_objects/dataset_quality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ export function DatasetQualityPageObject({ getPageObjects, getService }: FtrProv
dataset,
namespace = 'default',
}: {
type: string;
type?: string;
dataset: string;
namespace: string;
namespace?: string;
}) {
return `.ds-${type}-${dataset}-${namespace}-${getCurrentDateFormatted()}`;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const logsNginxMappings = (dataset: string): MappingTypeMapping => ({
properties: {
dataset: {
type: 'constant_keyword',
value: 'nginx.access',
value: dataset,
},
namespace: {
type: 'constant_keyword',
Expand Down Expand Up @@ -175,175 +175,3 @@ export const logsNginxMappings = (dataset: string): MappingTypeMapping => ({
},
},
});

const properties = {
'@timestamp': {
type: 'date',
ignore_malformed: false,
},
cloud: {
properties: {
image: {
properties: {
id: {
type: 'keyword',
ignore_above: 1024,
},
},
},
},
},
data_stream: {
properties: {
dataset: {
type: 'constant_keyword',
value: 'nginx.access',
},
namespace: {
type: 'constant_keyword',
value: 'default',
},
type: {
type: 'constant_keyword',
value: 'logs',
},
},
},
ecs: {
properties: {
version: {
type: 'keyword',
ignore_above: 1024,
},
},
},
error: {
properties: {
message: {
type: 'match_only_text',
},
},
},
event: {
properties: {
agent_id_status: {
type: 'keyword',
ignore_above: 1024,
},
dataset: {
type: 'constant_keyword',
value: 'nginx.access',
},
ingested: {
type: 'date',
format: 'strict_date_time_no_millis||strict_date_optional_time||epoch_millis',
ignore_malformed: false,
},
module: {
type: 'constant_keyword',
value: 'nginx',
},
original: {
type: 'keyword',
index: false,
doc_values: false,
},
},
},
host: {
properties: {
containerized: {
type: 'boolean',
},
name: {
type: 'keyword',
fields: {
text: {
type: 'match_only_text',
},
},
},
os: {
properties: {
build: {
type: 'keyword',
ignore_above: 1024,
},
codename: {
type: 'keyword',
ignore_above: 1024,
},
},
},
},
},
input: {
properties: {
type: {
type: 'keyword',
ignore_above: 1024,
},
},
},
log: {
properties: {
level: {
type: 'keyword',
ignore_above: 1024,
},
offset: {
type: 'long',
},
},
},
network: {
properties: {
bytes: {
type: 'long',
},
},
},
nginx: {
properties: {
access: {
properties: {
remote_ip_list: {
type: 'keyword',
ignore_above: 1024,
},
},
},
},
},
service: {
properties: {
name: {
type: 'keyword',
fields: {
text: {
type: 'match_only_text',
},
},
},
},
},
test_field: {
type: 'keyword',
ignore_above: 1024,
},
tls: {
properties: {
established: {
type: 'boolean',
},
},
},
trace: {
properties: {
id: {
type: 'keyword',
ignore_above: 1024,
},
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);

const currentFieldLimitValue = await currentFieldLimitInput.getAttribute('value');
const currentFieldLimit = parseInt(currentFieldLimitValue, 10);
const currentFieldLimit = parseInt(currentFieldLimitValue as string, 10);
const currentFieldLimitDisabledStatus = await currentFieldLimitInput.getAttribute(
'disabled'
);
Expand All @@ -760,7 +760,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);

const newFieldLimitValue = await newFieldLimitInput.getAttribute('value');
const newFieldLimit = parseInt(newFieldLimitValue, 10);
const newFieldLimit = parseInt(newFieldLimitValue as string, 10);

// Should be 30% more the current limit
const newLimit = Math.round(currentFieldLimit * 1.3);
Expand Down Expand Up @@ -864,7 +864,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {

// Should point to the component template page
expect(
ctLinkURL.endsWith(
ctLinkURL?.endsWith(
`/data/index_management/component_templates/${encodeURIComponent(
componentTemplateName
)}`
Expand Down

0 comments on commit 2e79d84

Please sign in to comment.