Skip to content
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

[data views] Reenable MKI test - change data import tool to be serverless compatible #181349

Merged
merged 20 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
069acc1
change data import tool to be serverless compatible
mattkime Apr 22, 2024
26cd68f
remove saved objects from data import
mattkime Apr 22, 2024
ec091cb
fix delete url path
mattkime Apr 23, 2024
154e103
use kibana loader
mattkime Apr 23, 2024
8ce2917
Merge branch 'main' into reenable_mki_test_data_view_creation
mattkime Apr 28, 2024
c6da933
fix serverless functional test
mattkime Apr 28, 2024
0582e99
remove duplicate fn call
mattkime Apr 28, 2024
eb3c9d6
Merge branch 'main' into reenable_mki_test_data_view_creation
mattkime Apr 30, 2024
1a057df
Merge branch 'main' into reenable_mki_test_data_view_creation
mattkime May 2, 2024
c53fb1f
reenable a number of tests for MKI
mattkime May 2, 2024
f0baf38
Merge branch 'main' into reenable_mki_test_data_view_creation
mattkime May 2, 2024
84ede45
fix conflicts test
mattkime May 2, 2024
08145f2
Merge branch 'reenable_mki_test_data_view_creation' of github.com:mat…
mattkime May 2, 2024
a7ed6f6
reenable default data view test
mattkime May 2, 2024
ba8de45
Merge branch 'main' into reenable_mki_test_data_view_creation
mattkime May 2, 2024
d1d7ee8
Merge branch 'main' into reenable_mki_test_data_view_creation
mattkime May 3, 2024
ddf9e02
Merge branch 'main' into reenable_mki_test_data_view_creation
mattkime May 6, 2024
2f73a6f
use same id for different create data view buttons
mattkime May 6, 2024
07abf4e
Merge branch 'reenable_mki_test_data_view_creation' of github.com:mat…
mattkime May 6, 2024
a075389
Merge branch 'main' into reenable_mki_test_data_view_creation
mattkime May 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export const IndexPatternTable = ({
fill={true}
iconType="plusInCircle"
onClick={() => setShowCreateDialog(true)}
data-test-subj="createIndexPatternButton"
data-test-subj="createDataViewButton"
>
<FormattedMessage
id="indexPatternManagement.dataViewTable.createBtn"
Expand Down
13 changes: 1 addition & 12 deletions test/functional/page_objects/settings_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -621,18 +621,7 @@ export class SettingsPageObject extends FtrService {

async clickAddNewIndexPatternButton() {
await this.common.scrollKibanaBodyTop();

// if showing no data view prompt
const noDataView = await this.testSubjects.exists('createDataViewButton');
if (noDataView) {
await this.testSubjects.click('createDataViewButton');
return;
}

const tableView = await this.testSubjects.exists('createIndexPatternButton');
if (tableView) {
await this.testSubjects.click('createIndexPatternButton');
}
await this.testSubjects.click('createDataViewButton');
}

async selectRollupIndexPatternType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default function ({ getService }: FtrProviderContext) {
const svlCommonApi = getService('svlCommonApi');

describe('conflicts', function () {
this.tags('failsOnMKI');
before(() =>
esArchiver.load('test/api_integration/fixtures/es_archiver/index_patterns/conflicts')
);
Expand All @@ -31,7 +30,7 @@ export default function ({ getService }: FtrProviderContext) {
.set(ELASTIC_HTTP_VERSION_HEADER, INITIAL_REST_VERSION_INTERNAL)
// TODO: API requests in Serverless require internal request headers
.set(svlCommonApi.getInternalRequestHeader())
.query({ pattern: 'logs-*' })
.query({ pattern: 'logs-2017.01.*' })
.expect(200)
.then((resp) => {
expect(resp.body).to.eql({
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['settings', 'common', 'header']);

describe('creating and deleting default data view', function describeIndexTests() {
// failsOnMKI, see https://github.com/elastic/kibana/issues/171479
this.tags(['failsOnMKI']);
before(async function () {
// TODO: emptyKibanaIndex fails in Serverless with
// "index_not_found_exception: no such index [.kibana_ingest]",
Expand All @@ -31,7 +29,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await esArchiver.loadIfNeeded(
'x-pack/test_serverless/functional/es_archives/kibana_sample_data_flights_index_pattern'
);
await kibanaServer.importExport.load(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: if this fixes the MKI error, isn't L29 + L42 redundant?
@pheyos wrote in the issue

The root cause is in both cases direct system indices access. AFAICS, this is happening when loading / unloading the archive x-pack/test_serverless/functional/es_archives/kibana_sample_data_flights_index_pattern. This kind of access is not available in MKI and the tests need to be adjusted (e.g. by loading things through kibanaServer.importExport or other APIs).

Since those functions are still here, should it work? will it work when they are removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kertal line 29 is importing regular ES docs while line 32 is importing saved objects. I'll defer to @pheyos as to whether I'm doing this correctly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's correct @mattkime. The other issue was reported quite a while back and I suspect some other things have changed as well in the mean time. I ran the tests against an observability MKI project and they passed.

'test/functional/fixtures/kbn_archiver/kibana_sample_data_flights_index_pattern'
);
await esArchiver.loadIfNeeded('test/functional/fixtures/es_archiver/logstash_functional');

pheyos marked this conversation as resolved.
Show resolved Hide resolved
await kibanaServer.uiSettings.replace({});
// TODO: Navigation to Data View Management is different in Serverless
await PageObjects.common.navigateToApp('management');
Expand All @@ -41,10 +43,13 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
after(async function () {
// TODO: Loading this from `es_archives` in `test_serverless`
// instead since minor modifications were required

await esArchiver.unload(
'x-pack/test_serverless/functional/es_archives/kibana_sample_data_flights_index_pattern'
);

await kibanaServer.importExport.unload(
'test/functional/fixtures/kbn_archiver/kibana_sample_data_flights_index_pattern'
);
await esArchiver.unload('test/functional/fixtures/es_archiver/logstash_functional');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');

describe('edit field', function () {
// failsOnMKI, see https://github.com/elastic/kibana/issues/180568
this.tags(['failsOnMKI']);
before(async function () {
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const es = getService('es');

describe('index pattern filter', function describeIndexTests() {
// https://github.com/elastic/kibana/issues/178733
this.tags('failsOnMKI');
before(async function () {
await kibanaServer.savedObjects.cleanStandardList();
await kibanaServer.uiSettings.replace({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');

describe('runtime fields', function () {
// Bug: https://github.com/elastic/kibana/issues/178939
this.tags('failsOnMKI');
before(async function () {
await browser.setWindowSize(1200, 800);
await kibanaServer.importExport.load('test/functional/fixtures/kbn_archiver/discover');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export default function ({ getPageObject, getService }: FtrProviderContext) {
const svlCommonPage = getPageObject('svlCommonPage');

describe('default dataView', function () {
// Error: expected testSubject(kbnOverviewElasticsearchGettingStarted) to exist
this.tags(['failsOnMKI']);
before(async () => {
await svlCommonPage.login();
await svlSearchNavigation.navigateToLandingPage();
Expand Down