Skip to content

Commit 0fbe568

Browse files
joe4devclaude
andcommitted
refactor: rename ls-api to ls-mock
Distinguishes the LocalStack endpoint mock (cmd/ls-mock, bin/ls-mock) from the internal/lsapi package introduced in the previous commit. Updates all references: Makefile, smoke-test.sh, CI workflow, README, .gitignore, and test comments. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 370b682 commit 0fbe568

9 files changed

Lines changed: 21 additions & 21 deletions

File tree

.github/workflows/ls-smoke-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14-
smoke-ls-api:
14+
smoke-ls-mock:
1515
name: RIE ↔ LocalStack API Smoke Test
1616
runs-on: ubuntu-latest
1717
steps:
@@ -23,4 +23,4 @@ jobs:
2323
go-version-file: go.mod
2424

2525
- name: Run smoke test
26-
run: make -C cmd/ls-api smoke-test
26+
run: make -C cmd/ls-mock smoke-test

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/build
33
/bin
44
aws-lambda-rie
5-
ls-api
5+
ls-mock
66
*.swp
77
*.iml
88
tags

README-LOCALSTACK.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Refer to [debugging/README.md](./debugging/README.md) for instructions on how to
1818
| `cmd/localstack` | LocalStack customizations |
1919
| ├── `main.go` | Main entrypoint |
2020
| ├── `custom_interop.go` | Custom server interface between the Lambda runtime API and this Go init. Implements the `Server` interface from `lambda/interop/model.go:Server` but forwards most calls to the original implementation in `lambda/rapidcore/server.go` available as `delegate`. |
21-
| `cmd/ls-api` | Mock LocalStack component for smoke testing |
22-
| ├── [`README.md`](./cmd/ls-api/README.md) | Instructions for LS API<->RIE smoke testing |
21+
| `cmd/ls-mock` | Mock LocalStack component for smoke testing |
22+
| ├── [`README.md`](./cmd/ls-mock/README.md) | Instructions for LS API<->RIE smoke testing |
2323
| `debugging/` | Debug and test this Go init with LocalStack |
2424
| ├── [`README.md`](./debugging/README.md) | Instructions for building and debugging with LocalStack |
2525
| `lambda` | Original AWS implementation of the runtime emulator ideally kept untouched |
@@ -43,6 +43,6 @@ Example PR that integrates upstream changes: https://github.com/localstack/lambd
4343

4444
Document all custom changes with the following comment prefix `# LOCALSTACK CHANGES yyyy-mm-dd:`
4545

46-
* Everything in `cmd/localstack`, `cmd/ls-api`, and `.github`
46+
* Everything in `cmd/localstack`, `cmd/ls-mock`, and `.github`
4747
* `Makefile` for debugging and building with Docker
4848
* 2023-10-17: `lambda/rapidcore/server.go` pass request metadata into .Reserve(invoke.ID, invoke.TraceID, invoke.LambdaSegmentID)
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARCH ?= x86_64
55
MOCK_PORT := 48490
66
INTEROP_PORT := 9563
77
RIE_BINARY := $(REPO_ROOT)/bin/aws-lambda-rie-$(ARCH)
8-
LS_API_BIN := $(REPO_ROOT)/bin/ls-api
8+
LS_MOCK_BIN := $(REPO_ROOT)/bin/ls-mock
99

1010
# Common docker flags for start-rie and start-rie-detached.
1111
# Uses deferred assignment (=) so $$LATEST is not expanded until recipe time,
@@ -25,15 +25,15 @@ RIE_DOCKER_OPTS = \
2525
-e _HANDLER=handler.handler \
2626
--entrypoint /var/rapid/init
2727

28-
.PHONY: build-rie build-ls-api start-mock start-rie start-rie-detached success fail smoke-test
28+
.PHONY: build-rie build-ls-mock start-mock start-rie start-rie-detached success fail smoke-test
2929

3030
build-rie: ## Build the RIE Linux binary via Go cross-compilation (works on macOS)
3131
$(MAKE) -C $(REPO_ROOT) ARCH=$(ARCH) compile-lambda-linux
3232

33-
build-ls-api: ## Build the ls-api mock binary
34-
go build -o $(LS_API_BIN) $(THIS_MAKEFILE_DIR)
33+
build-ls-mock: ## Build the ls-mock binary
34+
go build -o $(LS_MOCK_BIN) $(THIS_MAKEFILE_DIR)
3535

36-
start-mock: ## Run the ls-api LocalStack endpoint mock natively (no Docker needed)
36+
start-mock: ## Run the ls-mock LocalStack endpoint mock natively (no Docker needed)
3737
go run $(THIS_MAKEFILE_DIR)
3838

3939
start-rie: build-rie ## Build and run the RIE inside a Docker Python Lambda container
@@ -48,5 +48,5 @@ success: ## Trigger a successful invocation via the mock's /success endpoint
4848
fail: ## Trigger an error invocation via the mock's /fail endpoint
4949
curl -sf http://localhost:$(MOCK_PORT)/fail
5050

51-
smoke-test: build-rie build-ls-api ## Full e2e smoke test: start mock + RIE, verify success + error invocations, cleanup
51+
smoke-test: build-rie build-ls-mock ## Full e2e smoke test: start mock + RIE, verify success + error invocations, cleanup
5252
$(THIS_MAKEFILE_DIR)/smoke-test.sh
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ls-api — LocalStack endpoint mock
1+
# ls-mock — LocalStack endpoint mock
22

33
A lightweight HTTP server that stands in for the LocalStack endpoint when testing the RIE in isolation, without a running LocalStack instance.
44

@@ -60,4 +60,4 @@ To run the full e2e smoke test non-interactively (used in CI):
6060
make smoke-test
6161
```
6262

63-
This builds both the RIE binary and the ls-api mock, starts them, verifies a successful and a failing invocation, then cleans up.
63+
This builds both the RIE binary and the ls-mock mock, starts them, verifies a successful and a failing invocation, then cleans up.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/stretchr/testify/require"
1515
)
1616

17-
// These tests verify the ls-api mock server (cmd/ls-api) — a manual testing tool that
17+
// These tests verify the ls-mock mock server (cmd/ls-mock) — a manual testing tool that
1818
// emulates the LocalStack endpoint locally. They do NOT test the production RIE code.
1919
// For regression tests of the actual LS↔RIE API contract, see cmd/localstack/custom_interop_test.go.
2020

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env bash
2-
# e2e smoke test: starts the ls-api mock and the RIE in Docker, then verifies that
2+
# e2e smoke test: starts the ls-mock mock and the RIE in Docker, then verifies that
33
# both a successful and a failing Lambda invocation complete correctly.
44
# Exits 0 on success, non-zero on failure. Cleans up on exit.
55
set -euo pipefail
@@ -8,9 +8,9 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
88
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
99

1010
MOCK_PORT=48490
11-
LS_API_BIN="$REPO_ROOT/bin/ls-api"
11+
LS_API_BIN="$REPO_ROOT/bin/ls-mock"
1212

13-
LOG_FILE=$(mktemp -t ls-api-smoke.XXXXXX)
13+
LOG_FILE=$(mktemp -t ls-mock-smoke.XXXXXX)
1414
CID_FILE=$(mktemp -t rie-smoke.XXXXXX)
1515

1616
cleanup() {
@@ -41,13 +41,13 @@ wait_for_log() {
4141
echo "--- RIE container logs ---" >&2
4242
docker logs "$cid" 2>&1 >&2 || true
4343
fi
44-
echo "--- ls-api log ---" >&2
44+
echo "--- ls-mock log ---" >&2
4545
cat "$LOG_FILE" >&2
4646
return 1
4747
}
4848

4949
# ---- start mock ----
50-
echo ">>> Starting ls-api mock (port $MOCK_PORT)"
50+
echo ">>> Starting ls-mock mock (port $MOCK_PORT)"
5151
"$LS_API_BIN" > "$LOG_FILE" 2>&1 &
5252
MOCK_PID=$!
5353
for i in $(seq 1 10); do nc -z localhost $MOCK_PORT 2>/dev/null && break || sleep 1; done
@@ -74,5 +74,5 @@ echo ">>> Error invocation received"
7474
echo ""
7575
echo "=== Smoke test passed: success + error invocations verified ==="
7676
echo ""
77-
echo "--- ls-api log ---"
77+
echo "--- ls-mock log ---"
7878
cat "$LOG_FILE"

0 commit comments

Comments
 (0)