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

Nginx Integration Panel Fix: Re-apply link removal #807

Merged
merged 7 commits into from
Aug 3, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"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: 16 additions & 4 deletions server/adaptors/integrations/__test__/local_repository.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,24 @@
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 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 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 deep validation for all local integrations.', async () => {
Expand Down
Loading