-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add historical performance benchmarking (#1432)
- Loading branch information
Showing
7 changed files
with
89 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
node-version: 20 | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
|
@@ -35,7 +35,7 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
node-version: 20 | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
|
@@ -56,7 +56,7 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
node-version: 20 | ||
cache: 'npm' | ||
- name: Coverage Report | ||
uses: artiomtr/[email protected] | ||
|
@@ -72,7 +72,7 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
node-version: 20 | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
|
@@ -86,7 +86,7 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
node-version: 20 | ||
cache: 'npm' | ||
- name: Install dependencies | ||
run: npm ci | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
api-definitions | ||
node_modules | ||
package-lock.json | ||
test-command.txt | ||
benchmark_check.md | ||
benchmark_check.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Historical versions benchmark | ||
|
||
This directory is for automated benchmark testing of the existing versions of **Redocly CLI**. | ||
After releasing a new version, please add its reference to the `dependencies` section of the [package.json](./package.json) file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail # Fail on script errors | ||
|
||
# Clone the repo with test openapi files: | ||
git clone https://github.com/Rebilly/api-definitions.git | ||
|
||
# Store the command into a text file: | ||
echo hyperfine -i --warmup 3 $(cat package.json | jq '.dependencies' | jq 'keys' | jq 'map("'\''node node_modules/" + . + "/bin/cli.js lint api-definitions/openapi/openapi.yaml'\''")' | jq 'join(" ")' | xargs) --export-markdown benchmark_check.md --export-json benchmark_check.json > test-command.txt | ||
|
||
# Put the command in the test section of the package.json: | ||
cat package.json | jq ".scripts.test = \"$(cat test-command.txt)\"" > package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "benchmark", | ||
"version": "1.0.0", | ||
"description": "Test benchmark for Redocly CLI", | ||
"scripts": { | ||
"make-test": "bash make-test-command.sh" | ||
}, | ||
"dependencies": { | ||
"cli-100": "npm:@redocly/[email protected]", | ||
"cli-110": "npm:@redocly/[email protected]", | ||
"cli-120": "npm:@redocly/[email protected]", | ||
"cli-130": "npm:@redocly/[email protected]", | ||
"cli-140": "npm:@redocly/[email protected]", | ||
"cli-150": "npm:@redocly/[email protected]", | ||
"cli-160": "npm:@redocly/[email protected]", | ||
"cli-170": "npm:@redocly/[email protected]", | ||
"cli-180": "npm:@redocly/[email protected]", | ||
"cli-190": "npm:@redocly/[email protected]", | ||
"cli-next": "file:../redocly-cli.tgz" | ||
} | ||
} |
d01b16f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coverage report
Test suite run success
710 tests passing in 101 suites.
Report generated by 🧪jest coverage report action from d01b16f