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

Support adding plugin a second time for testing purposes #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- [Client_management_design](multi-datasource/client_management_design.md)
- [High_level_design](multi-datasource/high_level_design.md)
- [User_stories](multi-datasource/user_stories.md)
- [Openapi](openapi/README.md)
- Plugins
- [Data_persistence](plugins/data_persistence.md)
- Saved_objects
Expand Down Expand Up @@ -159,6 +160,7 @@
- [Opensearch dashboards.release notes 2.11.1](../release-notes/opensearch-dashboards.release-notes-2.11.1.md)
- [Opensearch dashboards.release notes 2.12.0](../release-notes/opensearch-dashboards.release-notes-2.12.0.md)
- [Opensearch dashboards.release notes 2.13.0](../release-notes/opensearch-dashboards.release-notes-2.13.0.md)
- [Opensearch dashboards.release notes 2.14.0](../release-notes/opensearch-dashboards.release-notes-2.14.0.md)
- [Opensearch dashboards.release notes 2.2.0](../release-notes/opensearch-dashboards.release-notes-2.2.0.md)
- [Opensearch dashboards.release notes 2.2.1](../release-notes/opensearch-dashboards.release-notes-2.2.1.md)
- [Opensearch dashboards.release notes 2.3.0](../release-notes/opensearch-dashboards.release-notes-2.3.0.md)
Expand All @@ -172,6 +174,7 @@
- scripts
- [README](../scripts/README.md)
- [DOCS_README](DOCS_README.md)
- [Theme](theme.md)
- [CHANGELOG](../CHANGELOG.md)
- [CODE_OF_CONDUCT](../CODE_OF_CONDUCT.md)
- [COMMUNICATIONS](../COMMUNICATIONS.md)
Expand Down
66 changes: 33 additions & 33 deletions src/core/server/http/http_server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ test('valid params', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -202,7 +202,7 @@ test('invalid params', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -237,7 +237,7 @@ test('valid query', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -267,7 +267,7 @@ test('invalid query', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -302,7 +302,7 @@ test('valid body', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -340,7 +340,7 @@ test('valid body with validate function', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -383,7 +383,7 @@ test('not inline validation - specifying params', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -426,7 +426,7 @@ test('not inline validation - specifying validation handler', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -476,7 +476,7 @@ test('not inline handler - OpenSearchDashboardsRequest', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -525,7 +525,7 @@ test('not inline handler - RequestHandler', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -559,7 +559,7 @@ test('invalid body', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -594,7 +594,7 @@ test('handles putting', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -625,7 +625,7 @@ test('handles deleting', async () => {
);

const { registerRouter, server: innerServer } = await server.setup(config);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();

Expand Down Expand Up @@ -655,7 +655,7 @@ describe('with `basepath: /bar` and `rewriteBasePath: false`', () => {
);

const { registerRouter, server: innerServer } = await server.setup(configWithBasePath);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
innerServerListener = innerServer.listener;
Expand Down Expand Up @@ -710,7 +710,7 @@ describe('with `basepath: /bar` and `rewriteBasePath: true`', () => {
);

const { registerRouter, server: innerServer } = await server.setup(configWithBasePath);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
innerServerListener = innerServer.listener;
Expand Down Expand Up @@ -757,7 +757,7 @@ test('with defined `redirectHttpFromPort`', async () => {
router.get({ path: '/', validate: false }, (context, req, res) => res.ok({ body: 'value:/' }));

const { registerRouter } = await server.setup(configWithSSL);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
});
Expand Down Expand Up @@ -790,7 +790,7 @@ test('allows attaching metadata to attach meta-data tag strings to a route', asy
router.get({ path: '/without-tags', validate: false }, (context, req, res) =>
res.ok({ body: { tags: req.route.options.tags } })
);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
await supertest(innerServer.listener).get('/with-tags').expect(200, { tags });
Expand All @@ -803,7 +803,7 @@ test('exposes route details of incoming request to a route handler', async () =>

const router = new Router('', logger, enhanceWithContext);
router.get({ path: '/', validate: false }, (context, req, res) => res.ok({ body: req.route }));
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
await supertest(innerServer.listener)
Expand All @@ -830,7 +830,7 @@ describe('conditional compression', () => {
headers: { 'Content-Type': 'text/html; charset=UTF-8' },
};
router.get({ path: '/', validate: false }, (_context, _req, res) => res.ok(largeRequest));
registerRouter(router);
registerRouter(Symbol(), router);
await server.start();
return innerServer.listener;
}
Expand Down Expand Up @@ -908,7 +908,7 @@ describe('conditional compression', () => {
router.get({ path: '/', validate: false }, (context, req, res) =>
res.ok({ body: req.route })
);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
const response = await supertest(innerServer.listener)
Expand All @@ -927,7 +927,7 @@ describe('conditional compression', () => {
router.get({ path: '/', validate: false }, (context, req, res) =>
res.ok({ body: req.route })
);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
const response = await supertest(innerServer.listener).get('/').expect(200);
Expand Down Expand Up @@ -957,7 +957,7 @@ test('exposes route details of incoming request to a route handler (POST + paylo
},
(context, req, res) => res.ok({ body: req.route })
);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
await supertest(innerServer.listener)
Expand Down Expand Up @@ -996,7 +996,7 @@ describe('body options', () => {
},
(context, req, res) => res.ok({ body: req.route })
);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
await supertest(innerServer.listener).post('/').send({ test: 1 }).expect(415, {
Expand All @@ -1018,7 +1018,7 @@ describe('body options', () => {
},
(context, req, res) => res.ok({ body: req.route })
);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
await supertest(innerServer.listener).post('/').send({ test: 1 }).expect(413, {
Expand Down Expand Up @@ -1048,7 +1048,7 @@ describe('body options', () => {
}
}
);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
await supertest(innerServer.listener).post('/').send({ test: 1 }).expect(200, {
Expand Down Expand Up @@ -1087,7 +1087,7 @@ describe('timeout options', () => {
}
}
);
registerRouter(router);
registerRouter(Symbol(), router);
await server.start();
await supertest(innerServer.listener)
.post('/')
Expand Down Expand Up @@ -1125,7 +1125,7 @@ describe('timeout options', () => {
}
}
);
registerRouter(router);
registerRouter(Symbol(), router);
await server.start();
await supertest(innerServer.listener)
.delete('/')
Expand Down Expand Up @@ -1162,7 +1162,7 @@ describe('timeout options', () => {
}
}
);
registerRouter(router);
registerRouter(Symbol(), router);
await server.start();
await supertest(innerServer.listener)
.put('/')
Expand Down Expand Up @@ -1199,7 +1199,7 @@ describe('timeout options', () => {
}
}
);
registerRouter(router);
registerRouter(Symbol(), router);
await server.start();
await supertest(innerServer.listener)
.patch('/')
Expand Down Expand Up @@ -1232,7 +1232,7 @@ describe('timeout options', () => {
});
}
);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
await supertest(innerServer.listener)
Expand Down Expand Up @@ -1266,7 +1266,7 @@ describe('timeout options', () => {
});
}
);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
await supertest(innerServer.listener)
Expand Down Expand Up @@ -1300,7 +1300,7 @@ describe('timeout options', () => {
}
);

registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
});
Expand All @@ -1325,7 +1325,7 @@ test('should return a stream in the body', async () => {
}
}
);
registerRouter(router);
registerRouter(Symbol(), router);

await server.start();
await supertest(innerServer.listener).put('/').send({ test: 1 }).expect(200, {
Expand Down
Loading
Loading