Skip to content

Commit

Permalink
feat: add api7 3.2.14 e2e (api7#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 authored Jul 9, 2024
1 parent a338d09 commit 3832197
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ jobs:

api7:
runs-on: ubuntu-latest
strategy:
matrix:
version: [3.2.13.0, 3.2.14.0]
env:
BACKEND_API7_DOWNLOAD_URL: https://run.api7.ai/api7-ee/api7-ee-v3.2.13.0.tar.gz
BACKEND_API7_DOWNLOAD_URL: https://run.api7.ai/api7-ee/api7-ee-v${{ matrix.version }}.tar.gz
BACKEND_API7_LICENSE: ${{ secrets.BACKEND_API7_LICENSE }}
steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 11 additions & 0 deletions libs/backend-api7/e2e/support/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import { Listr, SilentRenderer } from 'listr2';
import { BackendAPI7 } from '../../src';

export const runTask = async (tasks: Listr, ctx = {}) => {
// add sync delay
if (Array.isArray(tasks.task)) {
const delayedTasks = tasks.task.reduce((pv, cv) => {
pv.push(cv, {
task: async () => new Promise((resolve) => setTimeout(resolve, 20)),
});
return pv;
}, []);
tasks = new Listr(delayedTasks, { concurrent: false });
}

//@ts-expect-error just ignore
tasks.renderer = new SilentRenderer();
await tasks.run(ctx);
Expand Down
3 changes: 3 additions & 0 deletions libs/backend-api7/e2e/sync-and-dump-1.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ describe('Sync and Dump - 1', () => {

it('Dump', async () => {
const result = (await dumpConfiguration(backend)) as ADCSDK.Configuration;
result.services = result.services.sort((a, b) =>
a.name.localeCompare(b.name),
);
expect(result.services).toHaveLength(2);
expect(result.services[0]).toMatchObject(service1);
expect(result.services[1]).toMatchObject(service2);
Expand Down
3 changes: 3 additions & 0 deletions libs/backend-api7/e2e/sync-and-dump-2.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ describe('Sync and Dump - 2', () => {
],
});

dump.services = dump.services.sort((a, b) =>
a.name.localeCompare(b.name),
);
expect(dump.services[0]).toMatchObject({
name: 'service1',
description: 'service1 description',
Expand Down

0 comments on commit 3832197

Please sign in to comment.