lab2
Application / Lint (pull_request) Canceled after 0s
Application / Unit tests (pull_request) Canceled after 0s
Application / Docker build (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Vladislav Kunetskiy
2026-10-06 00:19:15 +03:00
parent 51b236a69f
commit 5ea57db639
119 changed files with 9935 additions and 2138 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
set -eu
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
cd "$ROOT_DIR"
mkdir -p evidence/cache
{
echo "# API cache performance experiment"
echo "# generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
env -u HTTP_PROXY -u HTTPS_PROXY -u ALL_PROXY -u http_proxy -u https_proxy -u all_proxy \
NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 \
python3 tests/cache_api_performance.py
} > evidence/cache/api-performance.txt 2>&1
cat evidence/cache/api-performance.txt
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
OUT="$ROOT/evidence/cache"
GO="${GO:-go}"
cd "$ROOT"
mkdir -p "$OUT"
{
echo "# Cache consistency evidence (track 1)"
echo "# generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
echo "# redis: ${TEST_REDIS_HOST:-localhost}:${TEST_REDIS_PORT:-6379} db=${TEST_REDIS_DB:-1}"
echo
"$GO" test -tags=integration -count=1 -v -timeout=5m \
-run 'TestChatRepositorySuite|TestSessionRepositorySuite' \
./internal/storage/redis/...
} | tee "$OUT/consistency.txt"
echo "wrote $OUT/consistency.txt"
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
set -eu
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
cd "$ROOT_DIR"
mkdir -p evidence/cache
{
echo "# Cache latency experiment"
echo "# generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
go version
uname -sm
go test -tags=integration -count=3 -timeout=5m -v \
-run '^TestCacheLatencyExperiment$' ./internal/storage/postgres/...
} > evidence/cache/latency.txt 2>&1
cat evidence/cache/latency.txt
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
set -eu
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
cd "$ROOT_DIR"
mkdir -p evidence/cache
{
echo "# Cache performance experiment"
echo "# generated: $(date -u +%Y-%m-%dT%H:%M:%SZ)"
go version
uname -sm
go test -tags=integration -count=3 -timeout=5m -v \
-run '^TestCachePerformanceExperiment$' ./internal/storage/postgres/...
} > evidence/cache/performance.txt 2>&1
cat evidence/cache/performance.txt
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
set -eu
ROOT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
COMPOSE_BIN=${COMPOSE_BIN:-docker-compose}
cd "$ROOT_DIR"
"$COMPOSE_BIN" -f docker-compose.local.yaml restart postgres redis
"$COMPOSE_BIN" -f docker-compose.local.yaml up -d --wait postgres redis
"$COMPOSE_BIN" -f docker-compose.local.yaml up -d --force-recreate api