8000 chore: reduce testing on definitions by fuxingloh · Pull Request #60 · fuxingloh/chainfile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: reduce testing on definitions #60

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

Merged
merged 2 commits into from
May 22, 2024
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
@@ -1,5 +1,5 @@
import { afterAll, beforeAll, describe, expect, it } from '@jest/globals';
import { KarfiaAgentContainer, KarfiaContainer, KarfiaTestcontainers } from 'karfia-testcontainers';
import { KarfiaContainer, KarfiaTestcontainers } from 'karfia-testcontainers';
import waitForExpect from 'wait-for-expect';

import definition from './bitcoind.json';
Expand Down Expand Up @@ -141,60 +141,3 @@ describe('bitcoind', () => {
});
});
});

describe('karfia-agent', () => {
let agent: KarfiaAgentContainer;

beforeAll(() => {
agent = testcontainers.getKarfiaAgent();
});

it('should get karfia-agent/deployment', async () => {
const result = await agent.getDeployment();
expect(result).toMatchObject({
deploymentId: testcontainers.getDeploymentId(),
definitionId: definition.id,
caip2: definition.caip2,
name: definition.name,
});
});

it('should get karfia-agent/definition', async () => {
const result = await agent.getDefinition();
const expected = {
...definition,
$schema: undefined,
};
delete expected.$schema;
expect(result).toMatchObject(expected);
});

it('should get karfia-agent/probes/startup', async () => {
const response = await agent.probe('startup');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
ok: true,
});
});

it('should get karfia-agent/probes/liveness', async () => {
const response = await agent.probe('liveness');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
ok: true,
});
});

it('should get karfia-agent/probes/readiness', async () => {
const response = await agent.probe('readiness');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
containers: {
bitcoind: {
ok: true,
},
},
ok: true,
});
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterAll, beforeAll, describe, expect, it } from '@jest/globals';
import { KarfiaAgentContainer, KarfiaContainer, KarfiaTestcontainers } from 'karfia-testcontainers';
import { KarfiaContainer, KarfiaTestcontainers } from 'karfia-testcontainers';

import definition from './bitcoind.json';

Expand Down Expand Up @@ -116,60 +116,3 @@ describe('bitcoind', () => {
});
});
});

describe('karfia-agent', () => {
let agent: KarfiaAgentContainer;

beforeAll(() => {
agent = testcontainers.getKarfiaAgent();
});

it('should get karfia-agent/deployment', async () => {
const result = await agent.getDeployment();
expect(result).toMatchObject({
deploymentId: testcontainers.getDeploymentId(),
definitionId: definition.id,
caip2: definition.caip2,
name: definition.name,
});
});

it('should get karfia-agent/definition', async () => {
const result = await agent.getDefinition();
const expected = {
...definition,
$schema: undefined,
};
delete expected.$schema;
expect(result).toMatchObject(expected);
});

it('should get karfia-agent/probes/startup', async () => {
const response = await agent.probe('startup');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
ok: true,
});
});

it('should get karfia-agent/probes/liveness', async () => {
const response = await agent.probe('liveness');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
ok: true,
});
});

it('should get karfia-agent/probes/readiness', async () => {
const response = await agent.probe('readiness');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
containers: {
bitcoind: {
ok: true,
},
},
ok: true,
});
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterAll, beforeAll, describe, expect, it } from '@jest/globals';
import { KarfiaAgentContainer, KarfiaContainer, KarfiaTestcontainers } from 'karfia-testcontainers';
import { KarfiaContainer, KarfiaTestcontainers } from 'karfia-testcontainers';

import definition from './defid-jellyfish.json';

Expand Down Expand Up @@ -57,63 +57,3 @@ describe('defid + whale', () => {
});
});
});

describe('karfia-agent', () => {
let agent: KarfiaAgentContainer;

beforeAll(() => {
agent = testcontainers.getKarfiaAgent();
});

it('should get karfia-agent/deployment', async () => {
const result = await agent.getDeployment();
expect(result).toMatchObject({
deploymentId: testcontainers.getDeploymentId(),
definitionId: definition.id,
caip2: definition.caip2,
name: definition.name,
});
});

it('should get karfia-agent/definition', async () => {
const result = await agent.getDefinition();
const expected = {
...definition,
$schema: undefined,
};
delete expected.$schema;
expect(result).toMatchObject(expected);
});

it('should get karfia-agent/probes/startup', async () => {
const response = await agent.probe('startup');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
ok: true,
});
});

it('should get karfia-agent/probes/liveness', async () => {
const response = await agent.probe('liveness');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
ok: true,
});
});

it('should get karfia-agent/probes/readiness', async () => {
const response = await agent.probe('readiness');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
containers: {
defid: {
ok: true,
},
whale: {
ok: true,
},
},
ok: true,
});
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { afterAll, beforeAll, describe, expect, it } from '@jest/globals';
import { KarfiaAgentContainer, KarfiaContainer, KarfiaTestcontainers } from 'karfia-testcontainers';
import { KarfiaContainer, KarfiaTestcontainers } from 'karfia-testcontainers';

import definition from './defid.json';

Expand Down Expand Up @@ -315,60 +315,3 @@ describe('defid', () => {
});
});
});

describe('karfia-agent', () => {
let agent: KarfiaAgentContainer;

beforeAll(() => {
agent = testcontainers.getKarfiaAgent();
});

it('should get karfia-agent/deployment', async () => {
const result = await agent.getDeployment();
expect(result).toMatchObject({
deploymentId: testcontainers.getDeploymentId(),
definitionId: definition.id,
caip2: definition.caip2,
name: definition.name,
});
});

it('should get karfia-agent/definition', async () => {
const result = await agent.getDefinition();
const expected = {
...definition,
$schema: undefined,
};
delete expected.$schema;
expect(result).toMatchObject(expected);
});

it('should get karfia-agent/probes/startup', async () => {
const response = await agent.probe('startup');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
ok: true,
});
});

it('should get karfia-agent/probes/liveness', async () => {
const response = await agent.probe('liveness');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
ok: true,
});
});

it('should get karfia-agent/probes/readiness', async () => {
const response = await agent.probe('readiness');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
containers: {
defid: {
ok: true,
},
},
ok: true,
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -65,44 +65,8 @@ describe('karfia-agent', () => {
agent = testcontainers.getKarfiaAgent();
});

it('should get karfia-agent/deployment', async () => {
const result = await agent.getDeployment();
expect(result).toMatchObject({
deploymentId: testcontainers.getDeploymentId(),
definitionId: definition.id,
caip2: definition.caip2,
name: definition.name,
});
});

it('should get karfia-agent/definition', async () => {
const result = await agent.getDefinition();
const expected = {
...definition,
$schema: undefined,
};
delete expected.$schema;
expect(result).toMatchObject(expected);
});

it('should get karfia-agent/probes/startup', async () => {
const response = await agent.probe('startup');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
ok: true,
});
});

it('should get karfia-agent/probes/liveness', async () => {
const response = await agent.probe('liveness');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
ok: true,
});
});

it('should get karfia-agent/probes/readiness', async () => {
const response = await agent.probe('readiness');
it('should Probe.Readiness', async () => {
const response = await agent.probe('Readiness');
expect(response.status).toStrictEqual(200);
expect(await response.json()).toMatchObject({
containers: {
Expand Down
Loading
0