Skip to content

Commit

Permalink
Re-apply fix for VPC type (#809)
Browse files Browse the repository at this point in the history
* Fix VPC type

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>

* Add a test case

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>

* Re-apply link fix and update test

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>

* Revert "Re-apply link fix and update test"

This reverts commit f2ec20d.

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>

---------

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
  • Loading branch information
Swiddis authored Aug 3, 2023
1 parent 3f6762a commit 0e9e8cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "AWS VPC Flow",
"description": "AWS VPC Flow log collector",
"license": "Apache-2.0",
"type": "logs",
"type": "logs_vpc",
"author": "Haidong Wang",
"sourceUrl": "https://github.com/opensearch-project/dashboards-observability/tree/main/server/adaptors/integrations/__data__/repository/aws_vpc_flow/info",
"statics": {
Expand Down
32 changes: 21 additions & 11 deletions server/adaptors/integrations/__test__/local_repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,26 @@ import { Repository } from '../repository/repository';
import { Integration } from '../repository/integration';
import path from 'path';

describe("The local repository", () => {
it("Should pass shallow validation for all local integrations.", async () => {
let repository: Repository = new Repository(path.join(__dirname, '../__data__/repository'));
let integrations: Integration[] = await repository.getIntegrationList();
await Promise.all(integrations.map(i => expect(i.check()).resolves.toBeTruthy()));
});
describe('The local repository', () => {
it('Should pass shallow validation for all local integrations.', async () => {
const repository: Repository = new Repository(path.join(__dirname, '../__data__/repository'));
const integrations: Integration[] = await repository.getIntegrationList();
await Promise.all(integrations.map((i) => expect(i.check()).resolves.toBeTruthy()));
});

it("Should pass deep validation for all local integrations.", async () => {
let repository: Repository = new Repository(path.join(__dirname, '../__data__/repository'));
let integrations: Integration[] = await repository.getIntegrationList();
await Promise.all(integrations.map(i => expect(i.deepCheck()).resolves.toBeTruthy()));
});
it('Should pass deep validation for all local integrations.', async () => {
const repository: Repository = new Repository(path.join(__dirname, '../__data__/repository'));
const integrations: Integration[] = await repository.getIntegrationList();
await Promise.all(integrations.map((i) => expect(i.deepCheck()).resolves.toBeTruthy()));
});

it('Should not have a type that is not imported in the config', async () => {
const repository: Repository = new Repository(path.join(__dirname, '../__data__/repository'));
const integrations: Integration[] = await repository.getIntegrationList();
for (const integration of integrations) {
const config = await integration.getConfig();
const components = config!.components.map((x) => x.name);
expect(components).toContain(config!.type);
}
});
});

0 comments on commit 0e9e8cd

Please sign in to comment.