-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ML] Add functional tests for file data visualizer #60413
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
07984b5
Move file input path handling to common_page
pheyos fb33c39
Add data test subjects
pheyos 09b4e66
Add files to import
pheyos baaca89
Add needed service methods
pheyos b1efa95
Add file data visualizer tests
pheyos 904e584
Merge branch 'master' into test_file_upload
pheyos a0d3fef
Fix typo
pheyos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
x-pack/test/functional/apps/machine_learning/data_visualizer/file_data_visualizer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import path from 'path'; | ||
|
||
import { FtrProviderContext } from '../../../ftr_provider_context'; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default function({ getService }: FtrProviderContext) { | ||
const ml = getService('ml'); | ||
|
||
const testDataListPositive = [ | ||
{ | ||
suiteSuffix: 'with an artificial server log', | ||
filePath: path.join(__dirname, 'files_to_import', 'artificial_server_log'), | ||
indexName: 'user-import_1', | ||
createIndexPattern: false, | ||
expected: { | ||
results: { | ||
title: 'artificial_server_log', | ||
}, | ||
}, | ||
}, | ||
]; | ||
|
||
const testDataListNegative = [ | ||
{ | ||
suiteSuffix: 'with a non-log file', | ||
filePath: path.join(__dirname, 'files_to_import', 'not_a_log_file'), | ||
}, | ||
]; | ||
|
||
describe('file based', function() { | ||
this.tags(['smoke', 'mlqa']); | ||
before(async () => { | ||
await ml.securityUI.loginAsMlPowerUser(); | ||
await ml.navigation.navigateToMl(); | ||
}); | ||
|
||
for (const testData of testDataListPositive) { | ||
describe(testData.suiteSuffix, function() { | ||
after(async () => { | ||
await ml.api.deleteIndices(testData.indexName); | ||
}); | ||
|
||
it('loads the data visualizer selector page', async () => { | ||
await ml.navigation.navigateToDataVisualizer(); | ||
}); | ||
|
||
it('loads the file upload page', async () => { | ||
await ml.dataVisualizer.navigateToFileUpload(); | ||
}); | ||
|
||
it('selects a file and loads visualizer results', async () => { | ||
await ml.dataVisualizerFileBased.selectFile(testData.filePath); | ||
}); | ||
|
||
it('displays the components of the file details page', async () => { | ||
await ml.dataVisualizerFileBased.assertFileTitle(testData.expected.results.title); | ||
await ml.dataVisualizerFileBased.assertFileContentPanelExists(); | ||
await ml.dataVisualizerFileBased.assertSummaryPanelExists(); | ||
await ml.dataVisualizerFileBased.assertFileStatsPanelExists(); | ||
}); | ||
|
||
it('loads the import settings page', async () => { | ||
await ml.dataVisualizerFileBased.navigateToFileImport(); | ||
}); | ||
|
||
it('sets the index name', async () => { | ||
await ml.dataVisualizerFileBased.setIndexName(testData.indexName); | ||
}); | ||
|
||
it('sets the create index pattern checkbox', async () => { | ||
await ml.dataVisualizerFileBased.setCreateIndexPatternCheckboxState( | ||
testData.createIndexPattern | ||
); | ||
}); | ||
|
||
it('imports the file', async () => { | ||
await ml.dataVisualizerFileBased.startImportAndWaitForProcessing(); | ||
}); | ||
}); | ||
} | ||
|
||
for (const testData of testDataListNegative) { | ||
describe(testData.suiteSuffix, function() { | ||
it('loads the data visualizer selector page', async () => { | ||
await ml.navigation.navigateToDataVisualizer(); | ||
}); | ||
|
||
it('loads the file upload page', async () => { | ||
await ml.dataVisualizer.navigateToFileUpload(); | ||
}); | ||
|
||
it('selects a file and displays an error', async () => { | ||
await ml.dataVisualizerFileBased.selectFile(testData.filePath, true); | ||
}); | ||
}); | ||
} | ||
}); | ||
} |
19 changes: 19 additions & 0 deletions
19
...st/functional/apps/machine_learning/data_visualizer/files_to_import/artificial_server_log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
2018-01-06 16:56:14.295748 INFO host:'Server A' Incoming connection from ip 123.456.789.0 | ||
2018-01-06 16:56:15.295748 INFO host:'Server A' Incoming connection from ip 123.456.789.1 | ||
2018-01-06 16:56:16.295748 INFO host:'Server A' Incoming connection from ip 123.456.789.2 | ||
2018-01-06 16:56:17.295748 INFO host:'Server A' Incoming connection from ip 123.456.789.3 | ||
2018-01-06 16:56:18.295748 INFO host:'Server B' Incoming connection from ip 123.456.789.0 | ||
2018-01-06 16:56:19.295748 INFO host:'Server B' Incoming connection from ip 123.456.789.2 | ||
2018-01-06 16:56:20.295748 INFO host:'Server B' Incoming connection from ip 123.456.789.3 | ||
2018-01-06 16:56:21.295748 INFO host:'Server B' Incoming connection from ip 123.456.789.4 | ||
2018-01-06 16:56:22.295748 WARN host:'Server A' Disk watermark 80% | ||
2018-01-06 17:16:23.295748 WARN host:'Server A' Disk watermark 90% | ||
2018-01-06 17:36:10.295748 ERROR host:'Server A' Main process crashed | ||
2018-01-06 17:36:14.295748 INFO host:'Server A' Connection from ip 123.456.789.0 closed | ||
2018-01-06 17:36:15.295748 INFO host:'Server A' Connection from ip 123.456.789.1 closed | ||
2018-01-06 17:36:16.295748 INFO host:'Server A' Connection from ip 123.456.789.2 closed | ||
2018-01-06 17:36:17.295748 INFO host:'Server A' Connection from ip 123.456.789.3 closed | ||
2018-01-06 17:46:11.295748 INFO host:'Server B' Some special characters °!"§$%&/()=?`'^²³{[]}\+*~#'-_.:,;µ|<>äöüß | ||
2018-01-06 17:46:12.295748 INFO host:'Server B' Shutting down | ||
|
||
|
8 changes: 8 additions & 0 deletions
8
x-pack/test/functional/apps/machine_learning/data_visualizer/files_to_import/not_a_log_file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
This | ||
is | ||
not | ||
a | ||
log | ||
file | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that ML has too many suites tagged with
smoke
label. Since we only have 1 x-pack worker running Firefox we need to select only "important" tests that gave "smoke" level coverage. Not related directly to PR, just want to point it outThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmlemeshko Due to flakiness on Firefox, all the ML tests have
skipFirefox
set on an outer suite level.