Skip to content

Commit 0f2c127

Browse files
authored
Merge pull request #91 from Infisical/PLATFRM-125-e2e-test-poc
improvement: add e2e tests poc
2 parents 0d23cca + 7fa0723 commit 0f2c127

File tree

14 files changed

+11903
-0
lines changed

14 files changed

+11903
-0
lines changed

e2e/Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.PHONY: filter-api generate-client clean
2+
3+
# Variables
4+
API_JSON := api.json
5+
ALLOWED_ENDPOINTS := allowed-endpoints.json
6+
FILTERED_API_JSON := api-filtered.json
7+
OPENAPI_CFG := openapi-cfg.yaml
8+
9+
# Filter API JSON to only include allowed endpoints
10+
filter-api:
11+
@echo "Filtering API JSON using allowed endpoints..."
12+
@jq --slurpfile allowed $(ALLOWED_ENDPOINTS) \
13+
'.paths |= with_entries(select(.key as $$k | $$allowed[0] | index($$k)))' \
14+
$(API_JSON) > $(FILTERED_API_JSON)
15+
@echo "Filtered API JSON written to $(FILTERED_API_JSON)"
16+
17+
# Generate OpenAPI client using oapi-codegen
18+
generate-client: filter-api
19+
@echo "Generating OpenAPI client..."
20+
@go tool oapi-codegen -config $(OPENAPI_CFG) $(FILTERED_API_JSON)
21+
@echo "Client generated successfully"
22+
23+
# Clean generated files
24+
clean:
25+
@echo "Cleaning generated files..."
26+
@rm -f $(FILTERED_API_JSON)
27+
@echo "Clean complete"

e2e/allowed-endpoints.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
"/api/v1/admin/signup",
3+
"/api/v3/auth/select-organization",
4+
"/api/v1/auth/token",
5+
"/api/v1/identities",
6+
"/api/v1/auth/token-auth/identities/{identityId}",
7+
"/api/v1/auth/token-auth/identities/{identityId}/tokens",
8+
"/api/v1/relays",
9+
"/api/v1/projects"
10+
]

0 commit comments

Comments
 (0)