Skip to content

Commit

Permalink
Revert "Re-apply link fix and update test"
Browse files Browse the repository at this point in the history
This reverts commit f2ec20d.

Signed-off-by: Simeon Widdis <sawiddis@amazon.com>
  • Loading branch information
Swiddis committed Aug 2, 2023
1 parent f2ec20d commit 93388d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"description": "Nginx HTTP server collector",
"license": "Apache-2.0",
"type": "logs",
"link": "https://www.nginx.com/",
"author": "OpenSearch",
"sourceUrl": "https://github.com/opensearch-project/dashboards-observability/tree/main/server/adaptors/integrations/__data__/repository/nginx/info",
"statics": {
Expand Down
20 changes: 4 additions & 16 deletions server/adaptors/integrations/__test__/local_repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,12 @@
import { Repository } from '../repository/repository';
import { Integration } from '../repository/integration';
import path from 'path';
import * as fs from 'fs/promises';

describe('The local repository', () => {
it('Should only contain valid integration directories or files.', async () => {
const directory = path.join(__dirname, '../__data__/repository');
const folders = await fs.readdir(directory);
await Promise.all(
folders.map(async (folder) => {
const integPath = path.join(directory, folder);
if (!(await fs.lstat(integPath)).isDirectory()) {
// If it's not a directory (e.g. a README), skip it
return Promise.resolve(null);
}
// Otherwise, all directories must be integrations
const integ = new Integration(integPath);
await expect(integ.check()).resolves.toBe(true);
})
);
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 () => {
Expand Down

0 comments on commit 93388d6

Please sign in to comment.