i dont know why im manually freeing stuff. ohh i know why. because i copypastad
This commit is contained in:
12
Makefile
12
Makefile
@@ -1,4 +1,4 @@
|
||||
.PHONY: all build release run test clean fmt help install
|
||||
.PHONY: all build release run test clean fmt help install sdk_test
|
||||
|
||||
# Project configuration
|
||||
PROJECT_NAME := jormundb
|
||||
@@ -16,6 +16,8 @@ CXX := g++
|
||||
AR := ar
|
||||
CXXFLAGS := -O2 -fPIC -std=c++20 $(INCLUDE_PATH)
|
||||
|
||||
# name of the docker compose file for the python tests
|
||||
SDK_TEST_COMPOSE := docker-compose-python-sdk-test.yaml
|
||||
|
||||
# RocksDB and compression libraries
|
||||
ROCKSDB_LIBS := -lrocksdb -lstdc++ -lsnappy -llz4 -lzstd -lz -lbz2
|
||||
@@ -174,6 +176,13 @@ aws-test: run &
|
||||
--table-name TestTable
|
||||
@echo "\n$(GREEN)✓ AWS CLI test complete$(NC)"
|
||||
|
||||
# Python SDK integration tests (requires JormunDB running on localhost)
|
||||
sdk_test:
|
||||
@echo "$(BLUE)Running Python SDK tests against localhost:$(PORT)...$(NC)"
|
||||
@docker compose -f $(SDK_TEST_COMPOSE) down --remove-orphans 2>/dev/null || true
|
||||
@JORMUN_PORT=$(PORT) docker compose -f $(SDK_TEST_COMPOSE) run --rm --build sdk-test
|
||||
@docker compose -f $(SDK_TEST_COMPOSE) down --remove-orphans 2>/dev/null || true
|
||||
|
||||
# Development workflow
|
||||
dev: clean build run
|
||||
|
||||
@@ -199,6 +208,7 @@ help:
|
||||
@echo "$(GREEN)Test Commands:$(NC)"
|
||||
@echo " make test - Run unit tests"
|
||||
@echo " make aws-test - Test with AWS CLI commands"
|
||||
@echo " make sdk_test - Run Python SDK integration tests (requires running server)"
|
||||
@echo ""
|
||||
@echo "$(GREEN)Utility Commands:$(NC)"
|
||||
@echo " make fmt - Format source code"
|
||||
|
||||
5
TODO.md
5
TODO.md
@@ -60,9 +60,10 @@ Goal: "aws cli works reliably for CreateTable/ListTables/PutItem/GetItem/DeleteI
|
||||
- TLV decode failure cases (corrupt bytes)
|
||||
|
||||
### 7) Secondary indexes
|
||||
- [ ] Global Secondary Indexes (GSI)
|
||||
- [x] Global Secondary Indexes (GSI)
|
||||
- [ ] Local Secondary Indexes (LSI)
|
||||
- [ ] Index backfill + write-path maintenance
|
||||
- [ ] Index backfill (existing data when GSI added to populated table)
|
||||
- [x] Write-path maintenance (GSI)
|
||||
|
||||
### 8) Performance / ops
|
||||
- [ ] Connection reuse / keep-alive tuning
|
||||
|
||||
14
docker-compose-python-sdk-test.yaml
Normal file
14
docker-compose-python-sdk-test.yaml
Normal file
@@ -0,0 +1,14 @@
|
||||
services:
|
||||
sdk-test:
|
||||
image: python:3.12-slim
|
||||
network_mode: host
|
||||
working_dir: /tests
|
||||
volumes:
|
||||
- ./tests/sdk:/tests
|
||||
environment:
|
||||
- JORMUN_ENDPOINT=http://localhost:${JORMUN_PORT:-8002}
|
||||
- AWS_ACCESS_KEY_ID=local
|
||||
- AWS_SECRET_ACCESS_KEY=local
|
||||
- AWS_DEFAULT_REGION=us-east-1
|
||||
command: >
|
||||
sh -c "pip install --quiet boto3 && python test_sdk.py"
|
||||
@@ -96,7 +96,6 @@ evaluate_condition_expression :: proc(
|
||||
}
|
||||
defer {
|
||||
filter_node_destroy(filter_node)
|
||||
free(filter_node)
|
||||
}
|
||||
|
||||
// If there is no existing item, build an empty item for evaluation.
|
||||
|
||||
@@ -160,15 +160,12 @@ filter_node_destroy :: proc(node: ^Filter_Node) {
|
||||
|
||||
if node.left != nil {
|
||||
filter_node_destroy(node.left)
|
||||
free(node.left)
|
||||
}
|
||||
if node.right != nil {
|
||||
filter_node_destroy(node.right)
|
||||
free(node.right)
|
||||
}
|
||||
if node.child != nil {
|
||||
filter_node_destroy(node.child)
|
||||
free(node.child)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +205,6 @@ parse_or_expr :: proc(
|
||||
right, right_ok := parse_and_expr(t, names, values)
|
||||
if !right_ok {
|
||||
filter_node_destroy(left)
|
||||
free(left)
|
||||
return nil, false
|
||||
}
|
||||
|
||||
@@ -248,7 +244,6 @@ parse_and_expr :: proc(
|
||||
right, right_ok := parse_not_expr(t, names, values)
|
||||
if !right_ok {
|
||||
filter_node_destroy(left)
|
||||
free(left)
|
||||
return nil, false
|
||||
}
|
||||
|
||||
@@ -312,7 +307,6 @@ parse_primary_expr :: proc(
|
||||
rparen, rp_ok := next_token(t)
|
||||
if !rp_ok || rparen != ")" {
|
||||
filter_node_destroy(inner)
|
||||
free(inner)
|
||||
return nil, false
|
||||
}
|
||||
return inner, true
|
||||
|
||||
@@ -244,7 +244,6 @@ transact_write_items :: proc(
|
||||
}
|
||||
defer {
|
||||
filter_node_destroy(filter_node)
|
||||
free(filter_node)
|
||||
}
|
||||
|
||||
eval_item: Item
|
||||
|
||||
Reference in New Issue
Block a user