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

[Fix] Load sample data in serverless #165157

Merged
merged 67 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
cc8fc96
internal route?
rshen91 Aug 29, 2023
f013a11
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 29, 2023
e3a81cb
errors console in sample data installer
rshen91 Aug 29, 2023
877bc78
Merge remote-tracking branch 'origin/sample-data-obs' into sample-dat…
rshen91 Aug 29, 2023
8685167
Merge branch 'main' into sample-data-obs
rshen91 Aug 29, 2023
8d04ec6
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Aug 29, 2023
dd63d36
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Aug 29, 2023
011f59c
Merge remote-tracking branch 'upstream/main' into sample-data-obs
rshen91 Aug 30, 2023
76d0391
Merge remote-tracking branch 'origin/sample-data-obs' into sample-dat…
rshen91 Aug 30, 2023
b6434bf
remove index settings causing sample index to not be created
rshen91 Aug 30, 2023
3ad6a11
remove other changes in file
rshen91 Aug 30, 2023
1f65979
Merge branch 'main' into sample-data-obs
rshen91 Aug 30, 2023
5219dd7
Merge remote-tracking branch 'upstream/main' into sample-data-obs
rshen91 Aug 30, 2023
2c02b6b
Merge remote-tracking branch 'origin/sample-data-obs' into sample-dat…
rshen91 Aug 30, 2023
4e770b1
fix test
rshen91 Aug 30, 2023
7466f1e
update schema to include stateful index settings
rshen91 Aug 30, 2023
631d9d7
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 30, 2023
92f843d
fix
rshen91 Aug 30, 2023
aa63c80
Merge branch 'main' into sample-data-obs
rshen91 Aug 30, 2023
bcebbe7
update types
rshen91 Aug 30, 2023
54d000d
Merge remote-tracking branch 'origin/sample-data-obs' into sample-dat…
rshen91 Aug 30, 2023
4d94b86
fix
rshen91 Aug 30, 2023
ecfc51e
Merge branch 'main' into sample-data-obs
rshen91 Aug 30, 2023
8a1ba57
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Aug 30, 2023
0df2c52
code review
rshen91 Aug 31, 2023
23deb82
Merge remote-tracking branch 'origin/sample-data-obs' into sample-dat…
rshen91 Aug 31, 2023
db701fd
helper function
rshen91 Aug 31, 2023
960fbbe
Merge branch 'main' into sample-data-obs
rshen91 Aug 31, 2023
1896176
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Aug 31, 2023
b25d148
ignore comment for variable check
rshen91 Aug 31, 2023
b06ab53
Merge branch 'main' into sample-data-obs
rshen91 Aug 31, 2023
02caddf
Merge branch 'main' into sample-data-obs
rshen91 Aug 31, 2023
eb144b6
Merge branch 'main' into sample-data-obs
rshen91 Aug 31, 2023
4d0105c
Merge branch 'main' into sample-data-obs
rshen91 Aug 31, 2023
27a7f1a
Merge branch 'main' into sample-data-obs
rshen91 Aug 31, 2023
37e1cda
Merge branch 'main' into sample-data-obs
rshen91 Sep 1, 2023
2d3da64
Merge remote-tracking branch 'upstream/main' into sample-data-obs
rshen91 Sep 1, 2023
2d4955a
add es lint comment based on other tests
rshen91 Sep 1, 2023
a1d1110
Merge branch 'main' into sample-data-obs
rshen91 Sep 1, 2023
654f3bc
Merge branch 'main' into sample-data-obs
rshen91 Sep 1, 2023
00c5431
Merge branch 'main' into sample-data-obs
rshen91 Sep 1, 2023
ff738f3
Merge remote-tracking branch 'upstream/main' into sample-data-obs
rshen91 Sep 5, 2023
b04981c
Merge remote-tracking branch 'origin/sample-data-obs' into sample-dat…
rshen91 Sep 5, 2023
18574c7
remove settings for index in both state or stateless
rshen91 Sep 5, 2023
101d04b
Merge branch 'main' into sample-data-obs
rshen91 Sep 5, 2023
8b43293
add ftr
rshen91 Sep 5, 2023
59c03aa
Merge branch 'main' into sample-data-obs
rshen91 Sep 5, 2023
2e3df62
Merge remote-tracking branch 'upstream/main' into sample-data-obs
rshen91 Sep 5, 2023
269a7b8
Merge remote-tracking branch 'origin/sample-data-obs' into sample-dat…
rshen91 Sep 5, 2023
7589c87
url path for test
rshen91 Sep 5, 2023
832191b
Merge branch 'main' into sample-data-obs
rshen91 Sep 5, 2023
308094d
use already existing function
rshen91 Sep 5, 2023
c1d6d76
Merge remote-tracking branch 'origin/sample-data-obs' into sample-dat…
rshen91 Sep 5, 2023
2353369
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Sep 5, 2023
f5c4ab6
Merge branch 'main' into sample-data-obs
rshen91 Sep 6, 2023
4a4d4de
Merge branch 'main' into sample-data-obs
rshen91 Sep 6, 2023
bd09d5b
Merge branch 'main' into sample-data-obs
rshen91 Sep 6, 2023
8d8c67f
Merge branch 'main' into sample-data-obs
rshen91 Sep 6, 2023
d3fec32
Merge branch 'main' into sample-data-obs
rshen91 Sep 6, 2023
d9f5ef7
Merge branch 'main' into sample-data-obs
sebelga Sep 7, 2023
8cd062b
Merge branch 'main' into sample-data-obs
sebelga Sep 7, 2023
5fcb860
Merge remote-tracking branch 'upstream/main' into sample-data-obs
rshen91 Sep 7, 2023
a1cb601
move tests to own file
rshen91 Sep 7, 2023
967167b
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Sep 7, 2023
a759617
Merge branch 'main' into sample-data-obs
rshen91 Sep 7, 2023
07104b5
Merge branch 'main' into sample-data-obs
kibanamachine Sep 8, 2023
803a267
remove home from data mgt test suite
rshen91 Sep 8, 2023
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 @@ -159,8 +159,14 @@ describe('SampleDataInstaller', () => {
expect(esClient.asCurrentUser.indices.create).toHaveBeenCalledWith({
index: 'kibana_sample_data_test_single_data_index',
body: {
settings: { index: { number_of_shards: 1, auto_expand_replicas: '0-1' } },
mappings: { properties: { someField: { type: 'keyword' } } },
mappings: {
properties: {
someField: { type: 'keyword' },
},
},
settings: {
index: {},
},
},
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ export class SampleDataInstaller {

private async installDataIndex(dataset: SampleDatasetSchema, dataIndex: DataIndexSchema) {
const index = createIndexName(dataset.id, dataIndex.id);

try {
if (dataIndex.isDataStream) {
const request = {
name: index,
body: {
template: {
settings: { number_of_shards: 1, auto_expand_replicas: '0-1' },
mappings: { properties: dataIndex.fields },
},
index_patterns: [index],
Expand All @@ -180,8 +180,6 @@ export class SampleDataInstaller {
settings: {
index: {
...dataIndex.indexSettings,
number_of_shards: 1,
auto_expand_replicas: '0-1',
},
},
mappings: { properties: dataIndex.fields },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { FtrProviderContext } from '../../ftr_provider_context';
const archivePath = 'test/api_integration/fixtures/es_archiver/index_patterns/basic_index';

export default function ({ getService, getPageObjects }: FtrProviderContext) {
const PageObjects = getPageObjects(['settings', 'common', 'header']);
const PageObjects = getPageObjects(['settings', 'common', 'header', 'home']);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this change is not required anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch 803a267 for changes!

const esArchiver = getService('esArchiver');
const supertest = getService('supertest');
const testSubjects = getService('testSubjects');
Expand Down Expand Up @@ -100,5 +100,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await testSubjects.missingOrFail('rollup-tag');
});
});
it('Sample data loads', async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have this test added to a separate test file (e.g. sample_data.ts) next to this file? It is accessed through data views but is not a feature of data views.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a1cb601 for changes thanks!!!

await PageObjects.home.addSampleDataSet('ecommerce');
const ecommerce = await PageObjects.home.isSampleDataSetInstalled('ecommerce');
expect(ecommerce).toBe(true);
});
});
}