Skip to content

Commit 3e45e3b

Browse files
committed
tests: fix e2e network
1 parent a78e27b commit 3e45e3b

File tree

21 files changed

+127
-113
lines changed

21 files changed

+127
-113
lines changed

.github/workflows/tests.yaml

Lines changed: 52 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -22,60 +22,57 @@ jobs:
2222
cache: 'npm'
2323
- name: Install dependencies
2424
run: npm ci
25-
# - name: Typecheck
26-
# run: npm run typecheck
27-
# - name: Unit Tests
28-
# run: npm run unit
25+
- name: Typecheck
26+
run: npm run typecheck
27+
- name: Unit Tests
28+
run: npm run unit
2929
- name: E2E Tests
30-
run: |
31-
for (( i = 0; i < 50; i++ )); do
32-
npx jest __tests__/respect/workflow-success-actions/workflow-success-actions.test.ts __tests__/respect/workflow-failure-actions/workflow-failure-actions.test.ts
33-
done
30+
run: npm run e2e
3431

35-
# cli-package-test:
36-
# runs-on: ubuntu-latest
37-
# steps:
38-
# - uses: actions/checkout@v3
39-
# - uses: actions/setup-node@v3
40-
# with:
41-
# node-version: 20
42-
# cache: 'npm'
43-
# - name: Install dependencies
44-
# run: npm ci
45-
# - name: Prepare CLI and Core packages
46-
# run: npm run pack:prepare
47-
# - name: Install CLI Package
48-
# run: npm install -g redocly-cli.tgz
49-
# - name: Redocly version
50-
# run: redocly --version
51-
# - name: Definition test
52-
# run: redocly lint packages/core/src/benchmark/benches/rebilly.yaml --format=stylish
53-
#
54-
# coverage-report:
55-
# runs-on: ubuntu-latest
56-
# steps:
57-
# - uses: actions/checkout@v3
58-
# - uses: actions/setup-node@v3
59-
# with:
60-
# node-version: 20
61-
# cache: 'npm'
62-
# - name: Coverage Report
63-
# uses: artiomtr/[email protected]
64-
# continue-on-error: true
65-
# with:
66-
# skip-step: none
67-
# annotations: none
68-
# test-script: npm run jest
69-
#
70-
# code-style-check:
71-
# runs-on: ubuntu-latest
72-
# steps:
73-
# - uses: actions/checkout@v3
74-
# - uses: actions/setup-node@v3
75-
# with:
76-
# node-version: 20
77-
# cache: 'npm'
78-
# - name: Install dependencies
79-
# run: npm ci
80-
# - run: npm run eslint
81-
# - run: npm run prettier:check
32+
cli-package-test:
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v3
36+
- uses: actions/setup-node@v3
37+
with:
38+
node-version: 20
39+
cache: 'npm'
40+
- name: Install dependencies
41+
run: npm ci
42+
- name: Prepare CLI and Core packages
43+
run: npm run pack:prepare
44+
- name: Install CLI Package
45+
run: npm install -g redocly-cli.tgz
46+
- name: Redocly version
47+
run: redocly --version
48+
- name: Definition test
49+
run: redocly lint packages/core/src/benchmark/benches/rebilly.yaml --format=stylish
50+
51+
coverage-report:
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v3
55+
- uses: actions/setup-node@v3
56+
with:
57+
node-version: 20
58+
cache: 'npm'
59+
- name: Coverage Report
60+
uses: artiomtr/[email protected]
61+
continue-on-error: true
62+
with:
63+
skip-step: none
64+
annotations: none
65+
test-script: npm run jest
66+
67+
code-style-check:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v3
71+
- uses: actions/setup-node@v3
72+
with:
73+
node-version: 20
74+
cache: 'npm'
75+
- name: Install dependencies
76+
run: npm ci
77+
- run: npm run eslint
78+
- run: npm run prettier:check
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { join } from 'path';
2-
import { getCommandOutput, getParams } from '../utils';
2+
import { getParams } from '../utils';
3+
import { getCommandOutput } from '../../helpers';
34

45
test('should send in request and proceed case-insensitive headers in runtime expressions', () => {
56
const indexEntryPoint = join(process.cwd(), 'packages/cli/lib/index.js');
67
const fixturesPath = join(__dirname, 'case-insensitive-headers.arazzo.yaml');
78
const args = getParams(indexEntryPoint, ['respect', fixturesPath]);
89

9-
const result = getCommandOutput(args);
10+
const result = getCommandOutput(args, process.cwd());
1011
expect(result).toMatchSnapshot();
1112
});

__tests__/respect/cat-fact-api/cat-fact-api.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { join } from 'path';
2-
import { getParams, getCommandOutput, cleanColors } from '../utils';
2+
import { getParams, cleanColors, getCommandOutput } from '../utils';
33

44
test('cats api test case', () => {
55
const indexEntryPoint = join(process.cwd(), 'packages/cli/lib/index.js');

__tests__/respect/consider-severity-in-next-step-execution/consider-severity-in-next-step-execution.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { getParams, getCommandOutput } from '../utils';
1+
import { getParams } from '../utils';
2+
import { getCommandOutput } from '../../helpers';
23
import { join } from 'path';
34

45
test('should not follow the default behavior to break and return if onFailure omitted with warn severity and continue execution of the next step', () => {
@@ -18,6 +19,6 @@ test('should not follow the default behavior to break and return if onFailure om
1819
'CONTENT_TYPE_CHECK=off',
1920
]);
2021

21-
const result = getCommandOutput(args);
22+
const result = getCommandOutput(args, process.cwd());
2223
expect(result).toMatchSnapshot();
2324
});
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { join } from 'path';
2-
import { getParams, getCommandOutput } from '../utils';
2+
import { getParams } from '../utils';
3+
import { getCommandOutput } from '../../helpers';
34

45
test('free apis test case', () => {
56
const indexEntryPoint = join(process.cwd(), 'packages/cli/lib/index.js');
67
const fixturesPath = join(__dirname, 'free.arazzo.yaml');
78
const args = getParams(indexEntryPoint, ['respect', fixturesPath]);
89

9-
const result = getCommandOutput(args);
10+
const result = getCommandOutput(args, process.cwd());
1011
expect(result).toMatchSnapshot();
1112
});

__tests__/respect/implicit/implicit.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { getParams, getCommandOutput } from '../utils';
1+
import { getParams } from '../utils';
2+
import { getCommandOutput } from '../../helpers';
23
import { join } from 'path';
34

45
test('should implicitly add content type header based on requestBody.content field (the first one) if such does not specified', () => {
@@ -11,6 +12,6 @@ test('should implicitly add content type header based on requestBody.content fie
1112
'--verbose',
1213
]);
1314

14-
const result = getCommandOutput(args);
15+
const result = getCommandOutput(args, process.cwd());
1516
expect(result).toMatchSnapshot();
1617
});

__tests__/respect/inputs-with-cli-and-env/inputs-with-cli-and-env.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { getParams, getCommandOutput } from '../utils';
1+
import { getParams } from '../utils';
2+
import { getCommandOutput } from '../../helpers';
23
import { join } from 'path';
34

45
test('should use inputs from CLI and env', () => {
@@ -14,7 +15,7 @@ test('should use inputs from CLI and env', () => {
1415
'{"username":"John","password":"password"}',
1516
]);
1617

17-
const result = getCommandOutput(args);
18+
const result = getCommandOutput(args, process.cwd());
1819
expect(result).toMatchSnapshot();
1920

2021
delete process.env.AUTH_TOKEN;

__tests__/respect/local-json-server/local-json-server.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { spawn } from 'child_process';
2-
import { getParams, getCommandOutput } from '../utils';
2+
import { getParams } from '../utils';
3+
import { getCommandOutput } from '../../helpers';
34
import { join } from 'path';
45
import * as fs from 'fs';
56

@@ -32,7 +33,7 @@ describe('local-json-server', () => {
3233
const fixturesPath = join(__dirname, 'local-json-server.arazzo.yaml');
3334
const args = getParams(indexEntryPoint, ['respect', fixturesPath]);
3435

35-
const result = getCommandOutput(args);
36+
const result = getCommandOutput(args, process.cwd());
3637
expect(result).toMatchSnapshot();
3738
});
3839
});

__tests__/respect/mask-input-secrets/mask-input-secrets.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { getParams, getCommandOutput } from '../utils';
1+
import { getParams } from '../utils';
2+
import { getCommandOutput } from '../../helpers';
23
import { join } from 'path';
34

45
test('should hide sensitive input values', () => {
@@ -14,7 +15,7 @@ test('should hide sensitive input values', () => {
1415
'{"username":"John","password":"password","secret": {"secretValue":"secretToken"}}',
1516
]);
1617

17-
const result = getCommandOutput(args);
18+
const result = getCommandOutput(args, process.cwd());
1819
expect(result).toMatchSnapshot();
1920

2021
delete process.env.AUTH_TOKEN;
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { getParams, getCommandOutput } from '../utils';
1+
import { getParams } from '../utils';
2+
import { getCommandOutput } from '../../helpers';
23
import { join } from 'path';
34

45
test('should resolve outputs access syntax variations', () => {
56
const indexEntryPoint = join(process.cwd(), 'packages/cli/lib/index.js');
67
const fixturesPath = join(__dirname, 'outputs-access-syntax-variations.arazzo.yaml');
78
const args = getParams(indexEntryPoint, ['respect', fixturesPath, '--verbose']);
89

9-
const result = getCommandOutput(args);
10+
const result = getCommandOutput(args, process.cwd());
1011
expect(result).toMatchSnapshot();
1112
});

0 commit comments

Comments
 (0)