Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
875c6ca
docs: check every redirect and use public names on the VS Code page
slayerjain Nov 19, 2026
0171bf4
docs: say what OSS keploy does with Redis and a skipped test's end
slayerjain Nov 19, 2026
d540980
docs: add a keploy.yml and keploy.lock guide to the Universal Mocker
slayerjain Nov 19, 2026
61520a1
docs: rewrite the Python quickstart from a real Keploy 3.9.3 run
slayerjain Nov 19, 2026
b36080d
docs: add a Node.js (Jest) quickstart from a real Keploy 3.9.3 run
slayerjain Nov 19, 2026
d6a2344
docs: add a Java (JUnit, Maven) quickstart from a real Keploy 3.9.3 run
slayerjain Nov 19, 2026
231b447
docs: add a Playwright quickstart from a real Keploy 3.9.3 run
slayerjain Nov 19, 2026
6e5c8c1
docs: keep the Playwright quickstart's /health file out of git
slayerjain Nov 19, 2026
9a2dd2c
docs: add a Docker Compose quickstart from a real Keploy 3.9.3 run
slayerjain Nov 19, 2026
b48ef73
docs: say what a clone installs before its replay passes
slayerjain Nov 20, 2026
a17fa8a
ci: check that every page of the base branch keeps its URL
slayerjain Nov 20, 2026
4b9db34
ci: skip the base build when a pull request closes
slayerjain Nov 20, 2026
cf6d3c9
docs: list the macOS dependencies of Keploy 3.9.4
slayerjain Nov 20, 2026
0437dad
docs: show the quickstarts' output from Keploy 3.9.4
slayerjain Nov 20, 2026
172dd1e
docs: show the lock guide's keploy.lock from Keploy 3.9.4
slayerjain Nov 20, 2026
9d54f68
docs: say SQS records as plain HTTPS on macOS, not as raw bytes
slayerjain Nov 20, 2026
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
24 changes: 23 additions & 1 deletion .github/workflows/build_and_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,30 @@ jobs:
- name: Verify every docs link the UI Capture SDK ships
run: yarn verify-ui-capture-sdk-links

# A page moved or deleted with no redirect is not in src/redirects.js,
# so build the branch this PR goes into, set up the same way: the next
# step checks that every page in its sitemap still has its URL here.
# A closed pull request has no change left to protect, so that run
# skips the base build and checks src/redirects.js only.
- name: Build the base branch
if: github.event.action != 'closed'
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
git worktree add --detach "$RUNNER_TEMP/base" "$BASE_SHA"
cd "$RUNNER_TEMP/base"
yarn install --frozen-lockfile
yarn build

- name: Verify every moved docs URL still leads to its page
run: yarn verify-moved-urls
env:
EVENT_ACTION: ${{ github.event.action }}
run: |
if [ "$EVENT_ACTION" = closed ]; then
node scripts/verify-moved-urls.js build
else
node scripts/verify-moved-urls.js build "$RUNNER_TEMP/base/build"
fi

# Deploys this PR's build with main.yml's deploy script into a local S3,
# then replays the weeks after it: no asset a live or open page still
Expand Down
30 changes: 5 additions & 25 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {themes as prismThemes} from "prism-react-renderer";
const path = require("path");
const remarkFaqSchema = require("./src/remark/remarkFaqSchema");
const {siteGraph} = require("./src/schema/siteEntities");
const redirects = require("./src/redirects");
const fs = require("fs");
const remarkImageSize = require("./src/remark/remarkImageSize");
import {visit} from "unist-util-visit";
Expand Down Expand Up @@ -213,31 +214,10 @@ s.parentNode.insertBefore(b, s);})(window.lintrk);`,
};
},
"docusaurus-tailwindcss-loader",
// Old URLs that published packages still link to. The site is served from
// S3, which does not read static/_redirects, so each of these is a page the
// build writes that sends the browser on to the doc that replaced it. The
// build fails if a `to` page does not exist.
[
"@docusaurus/plugin-client-redirects",
{
redirects: [
// The README of @keploy/capture-sdk 3.0.1, on npm. Its other link,
// /ui-capture/install-sdk/, is a page of its own.
// scripts/verify-ui-capture-sdk-links.js keeps every link the SDK
// ships resolvable.
{from: "/ui-capture/overview/", to: "/running-keploy/ui-capture/"},
// Pages that moved into the Universal Mocker section.
{
from: "/running-keploy/mock-quickstart/",
to: "/universal-mocker/mock-quickstart/",
},
{
from: "/running-keploy/mock-your-tests/",
to: "/universal-mocker/mock-your-tests/",
},
],
},
],
// Old URLs and the pages that replaced them: see src/redirects.js, where
// a moved page's old URL is added. scripts/verify-moved-urls.js checks
// each one in the built site.
["@docusaurus/plugin-client-redirects", {redirects}],
[
"docusaurus-plugin-llms",
{
Expand Down
154 changes: 120 additions & 34 deletions scripts/verify-moved-urls.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
// Asserts every docs URL that moved still leads to its page in the built
// site. A moved page's old URL lives on in bookmarks, search results, blog
// posts and other sites' links, so it must keep working for good: a client
// redirect in docusaurus.config.js (plugin-client-redirects) sends it on.
// Docusaurus's own broken-link check cannot see this, because nothing on the
// site links to an old URL any more.
// redirect (plugin-client-redirects) sends it on. Docusaurus's own
// broken-link check cannot see this, because nothing on the site links to an
// old URL any more.
//
// For each move below, the build must hold:
// - a redirect page at the old URL whose target is the new URL, and
// - a real page (not another redirect) at the new URL.
// The list of moves is src/redirects.js, the same list docusaurus.config.js
// gives the plugin, so a redirect added there is checked here too. For each
// one, the build must hold:
// - a redirect page at each old URL whose target is the new URL,
// - a real page (not another redirect) at the new URL, and
// - when the new URL names a #fragment, an element with that id on the page.
//
// When a page moves, add its old and new URL below in the same change.
// A page moved or deleted with no redirect listed is not in that list. So,
// given a base build (the branch the change goes into, built the same way),
// every page in the base build's sitemap must still lead to a page here: the
// page itself, or a redirect to a real page.
//
// Usage: node scripts/verify-moved-urls.js <build dir>
// Usage: node scripts/verify-moved-urls.js <build dir> [<base build dir>]
const fs = require("fs");
const path = require("path");

const BASE_URL = "/docs/";
const REDIRECTS = require("../src/redirects");

const MOVES = [
// Into the Universal Mocker section.
{
from: "/running-keploy/mock-quickstart/",
to: "/universal-mocker/mock-quickstart/",
},
{
from: "/running-keploy/mock-your-tests/",
to: "/universal-mocker/mock-your-tests/",
},
];
const BASE_URL = "/docs/";

// The page plugin-client-redirects writes at an old URL.
const REDIRECT_RE = /<meta http-equiv="refresh" content="0; url=([^"]+)">/;

const buildDir = process.argv[2];
const baseDir = process.argv[3];
if (!buildDir) {
console.error("usage: node scripts/verify-moved-urls.js <build dir>");
console.error(
"usage: node scripts/verify-moved-urls.js <build dir> [<base build dir>]"
);
process.exit(2);
}

Expand All @@ -50,39 +49,69 @@ function readPage(url) {
}
}

// The text as a RegExp that matches only itself (a "." in #v1.2 is a dot).
const escapeRe = (text) => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");

// An element with that id, its quotes kept or dropped by the minifier.
const hasId = (html, id) => {
const re = escapeRe(id);
return new RegExp(`\\sid=(?:"${re}"|${re}[\\s>])`).test(html);
};

// A redirect target as the browser lands on it. plugin-client-redirects drops
// the slash before a #fragment (/x#y for /x/#y), and keploy.io answers a path
// without its trailing slash with a redirect to the path with it, so both are
// one page.
function canon(url) {
const [p, f] = url.split("#");
return (p.endsWith("/") ? p : p + "/") + (f === undefined ? "" : "#" + f);
}

// Each old URL with the URL it moved to. The plugin takes one `from` or a list.
const moves = [];
for (const {from, to} of REDIRECTS) {
for (const f of [].concat(from)) moves.push({from: f, to});
}

const failures = [];
for (const {from, to} of MOVES) {
if (moves.length === 0) {
failures.push(
`src/redirects.js lists no redirects: the check would pass on nothing.`
);
}
for (const {from, to} of moves) {
const [toPath, fragment = ""] = to.split("#");
const old = readPage(from);
if (old === null) {
failures.push(
`${from}: no page at the old URL (${pageFile(from)}). Add a redirect ` +
`from it to ${to} in docusaurus.config.js's plugin-client-redirects.`
`${from}: no page at the old URL (${pageFile(from)}). Does ` +
`docusaurus.config.js still give src/redirects.js to ` +
`plugin-client-redirects?`
);
continue;
}
const m = old.match(REDIRECT_RE);
if (!m) {
failures.push(
`${from}: the old URL holds a page, not a redirect to ${to}. A page ` +
`moved back there? Then remove this move from ${__filename}.`
`moved back there? Then remove its redirect from src/redirects.js.`
);
continue;
}
if (m[1] !== BASE_URL + to.replace(/^\//, "")) {
const want = BASE_URL + to.replace(/^\//, "");
if (canon(m[1]) !== canon(want)) {
failures.push(
`${from}: redirects to ${m[1]}, not to ${BASE_URL}${to.replace(
/^\//,
""
)}. Point its redirect at the page's current URL.`
`${from}: redirects to ${m[1]}, not to ${want}. Point its redirect ` +
`at the page's current URL.`
);
continue;
}
const target = readPage(to);
const target = readPage(toPath);
if (target === null) {
failures.push(
`${from}: redirects to ${to}, but no page is built there ` +
`(${pageFile(to)}). The page moved again? Point the redirect, and ` +
`this entry, at its current URL.`
`(${pageFile(toPath)}). The page moved again? Point its redirect in ` +
`src/redirects.js at its current URL.`
);
continue;
}
Expand All @@ -91,6 +120,58 @@ for (const {from, to} of MOVES) {
`${from}: redirects to ${to}, which is itself a redirect. Point it at ` +
`the page's current URL, so a reader takes one hop.`
);
continue;
}
if (fragment && !hasId(target, fragment)) {
failures.push(
`${from}: redirects to ${to}, but ${pageFile(toPath)} has no ` +
`id="${fragment}". The heading was renamed? Point the redirect at ` +
`its current anchor.`
);
}
}

// Every page of the base build, by its URL under BASE_URL.
let basePages = [];
if (baseDir) {
const sitemap = path.join(baseDir, "sitemap.xml");
const xml = fs.readFileSync(sitemap, "utf8");
basePages = [...xml.matchAll(/<loc>([^<]+)<\/loc>/g)].map(
(m) => new URL(m[1]).pathname
);
if (basePages.length === 0) {
failures.push(
`${sitemap} lists no pages: the check would pass on nothing.`
);
}
}
for (const loc of basePages) {
if (!loc.startsWith(BASE_URL)) {
failures.push(`${loc}: the base sitemap lists a page outside ${BASE_URL}.`);
continue;
}
const url = "/" + loc.slice(BASE_URL.length);
const page = readPage(url);
if (page === null) {
failures.push(
`${url}: the base build has this page and this build has nothing ` +
`there. Moved or deleted? Add a redirect from it to the page that ` +
`replaces it in src/redirects.js.`
);
continue;
}
const m = page.match(REDIRECT_RE);
if (!m) continue;
const to = m[1].split("#")[0];
const target = to.startsWith(BASE_URL)
? readPage("/" + to.slice(BASE_URL.length))
: null;
if (target === null || REDIRECT_RE.test(target)) {
failures.push(
`${url}: the base build has this page, and here it redirects to ` +
`${m[1]}, which is not a page. Point its redirect in ` +
`src/redirects.js at the page that replaces it.`
);
}
}

Expand All @@ -99,4 +180,9 @@ if (failures.length > 0) {
for (const f of failures) console.error(`- ${f}`);
process.exit(1);
}
console.log(`All ${MOVES.length} moved URLs redirect to their pages.`);
console.log(`All ${moves.length} moved URLs redirect to their pages.`);
if (baseDir) {
console.log(
`All ${basePages.length} pages of the base build still lead to a page.`
);
}
2 changes: 1 addition & 1 deletion scripts/verify-ui-capture-sdk-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// refused verb's entry links its section there:
// https://keploy.io/docs/ui-capture/refusals#<verb>.
// - The SDK's README links pages. When a page a published version links to
// moves, a client redirect in docusaurus.config.js keeps the old URL
// moves, a client redirect in src/redirects.js keeps the old URL
// working; it must lead to a page that exists here, anchor included.
//
// When the SDK or the tools gain a code, a refused verb or a README link,
Expand Down
27 changes: 27 additions & 0 deletions src/redirects.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Old docs URLs and the pages that replaced them. Bookmarks, search results,
// blog posts, other sites and published packages still link to an old URL, so
// it must keep working for good. The site is served from S3, which does not
// read static/_redirects, so @docusaurus/plugin-client-redirects (in
// docusaurus.config.js) writes a page at each `from` that sends the browser on
// to its `to`. The build fails if a `to` page does not exist.
//
// When a page moves, add its old and new URL here in the same change.
// scripts/verify-moved-urls.js reads this list and checks, in the built site,
// that each `from` redirects to its `to` in one hop, and that the `to` page
// (and its #fragment, when it names one) is there.
module.exports = [
// The README of @keploy/capture-sdk 3.0.1, on npm. Its other link,
// /ui-capture/install-sdk/, is a page of its own.
// scripts/verify-ui-capture-sdk-links.js keeps every link the SDK ships
// resolvable.
{from: "/ui-capture/overview/", to: "/running-keploy/ui-capture/"},
// Pages that moved into the Universal Mocker section.
{
from: "/running-keploy/mock-quickstart/",
to: "/universal-mocker/mock-quickstart/",
},
{
from: "/running-keploy/mock-your-tests/",
to: "/universal-mocker/mock-your-tests/",
},
];
12 changes: 6 additions & 6 deletions versioned_docs/version-4.0.0/running-keploy/utg-vsc-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Version 3.1.0 replaces the 3.0.0 panel. Setting Keploy up, recording and replayi
code --install-extension keploy.keployio
```

2. Select the **Keploy** icon in the Activity Bar. The **Set up** checklist shows each step: CLI installed, signed in, project set up by your agent (or, offered beside it, your running app recorded with T1), tests recorded, replay green, the files staged, CI wired and teammates invited. Select a step that isn't done to run the command that moves it on.
2. Select the **Keploy** icon in the Activity Bar. The **Set up** checklist shows each step: CLI installed, signed in, project set up by your agent (or, offered beside it, your running app recorded for [Integration Testing](/docs/server/install/)), tests recorded, replay green, the files staged, CI wired and teammates invited. Select a step that isn't done to run the command that moves it on.

For a guided tour, run **Welcome: Open Walkthrough** from the Command Palette and choose **Get started with Keploy**.

Expand Down Expand Up @@ -123,11 +123,11 @@ For any other project, such as a Python or Java one, a test command that runs se

Select **Teammates invited** in the checklist, or run **Keploy: Invite teammates**. It opens the Keploy app's [Add User](https://app.keploy.io/settings/users/add-user) page, where an admin adds them. A teammate who clones the repository signs in with `keploy login` and runs `KEPLOY_PROVEN=1 keploy mock replay`: the replay reads the committed `keploy.yml` and `keploy.lock` and downloads the recordings the lock pins.

## Record your running app (T1)
## Record your running app (Integration Testing)

No tests to record? Keploy can record the API calls your app serves instead. Select **No tests to record? Record your running app (T1)** in the checklist, or run **Keploy: Record my running app (T1)**. It asks for the command that starts your app, such as `go run .` or `npm start` on Linux, and runs `keploy record -c "<command>"` in a terminal of its own. Send your app the requests you want as tests, then press Ctrl+C: the recording goes to `keploy/test-set-<n>`. **Keploy: Replay my app's recording as tests (T1)** runs `keploy test -c "<command>" -t <sets>`, naming every `keploy/test-set-<n>` folder, which starts your app again and replays those requests against it as tests. The terminal stays open with keploy's exit code until you press Enter.
No tests to record? Keploy's Integration Testing can record the API calls your app serves instead. Select **No tests to record? Record your running app** in the checklist, or run **Keploy: Record my running app**. It asks for the command that starts your app, such as `go run .` or `npm start` on Linux, and runs `keploy record -c "<command>"` in a terminal of its own. Send your app the requests you want as tests, then press Ctrl+C: the recording goes to `keploy/test-set-<n>`. **Keploy: Replay my app's recording as tests** runs `keploy test -c "<command>" -t <sets>`, naming every `keploy/test-set-<n>` folder, which starts your app again and replays those requests against it as tests. The terminal stays open with keploy's exit code until you press Enter.

On macOS, give the command that runs your app itself, such as its built binary or `node server.js`, not a launcher such as `npm start` or a wrapper script: macOS drops Keploy's interception when a protected system binary runs. For a Go app, build it and give its binary, such as `./app` after `go build -o app .` (add `app` to `.gitignore`, or build it outside the repository, so the binary stays out of your commits). On macOS, the extension's record also skips the replay that `keploy record` runs when it stops (it passes `--disableAutoReplay`): in this release, that replay takes about 90 seconds for each test whose request called another service. The recording is saved, and **Keploy: Replay my app's recording as tests (T1)** runs it as tests.
On macOS, give the command that runs your app itself, such as its built binary or `node server.js`, not a launcher such as `npm start` or a wrapper script: macOS drops Keploy's interception when a protected system binary runs. For a Go app, build it and give its binary, such as `./app` after `go build -o app .` (add `app` to `.gitignore`, or build it outside the repository, so the binary stays out of your commits). On macOS, the extension's record also skips the replay that `keploy record` runs when it stops (it passes `--disableAutoReplay`): in this release, that replay takes about 90 seconds for each test whose request called another service. The recording is saved, and **Keploy: Replay my app's recording as tests** runs it as tests.

On Linux, Keploy needs root to capture your app's traffic, so the CLI asks for your password (`sudo`) in that terminal; on a Mac it needs no admin rights. These runs don't set `KEPLOY_PROVEN`. [Record and replay your app](/docs/server/install/) shows the same steps in a terminal.

Expand Down Expand Up @@ -199,8 +199,8 @@ On Linux, if the CLI doesn't run at all, check your glibc version with `ldd --ve
| **Keploy: Stage keploy.yml, keploy.lock and the test edits** | Stages the setup's files in Source Control for you to review and commit. |
| **Keploy: Wire CI (GitHub Actions)** | For a Go or Node project, writes `.github/workflows/keploy.yml`, which replays `keploy.lock`. |
| **Keploy: Invite teammates** | Opens the Keploy app's Add User page. |
| **Keploy: Record my running app (T1)** | Asks for the command that starts your app and runs `keploy record -c "<command>"` in a terminal. |
| **Keploy: Replay my app's recording as tests (T1)** | Runs `keploy test -c "<command>"` on the project's T1 test sets in a terminal. |
| **Keploy: Record my running app** | Asks for the command that starts your app and runs `keploy record -c "<command>"` in a terminal. |
| **Keploy: Replay my app's recording as tests** | Runs `keploy test -c "<command>"` on the project's `keploy/test-set-<n>` sets in a terminal. |
| **Keploy: Install or update the CLI** | Installs the CLI, or updates it when it needs updating. |
| **Keploy: Show log** | Opens the extension's log. |

Expand Down
Loading
Loading