# HG changeset patch
# User June Park
# Date 1767928882 28800
# Node ID f7860f491a8c7b965bcf7f4f2405266618e757d2
# Parent 7eb79fd91c7e2c5f44e0e06c104884e949ebb55b
--amend
diff -r 7eb79fd91c7e -r f7860f491a8c .bazelrc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.bazelrc Thu Jan 08 19:21:22 2026 -0800
@@ -0,0 +1,5 @@
+# Auto-select config based on host OS
+common --enable_platform_specific_config
+
+# Suppress duplicate library warnings from openssl BCR module on macOS
+build:macos --linkopt=-Wl,-no_warn_duplicate_libraries
diff -r 7eb79fd91c7e -r f7860f491a8c gara/gara
Binary file gara/gara has changed
diff -r 7eb79fd91c7e -r f7860f491a8c mrjunejune/python_server.py
--- a/mrjunejune/python_server.py Thu Jan 08 19:20:56 2026 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,14 +0,0 @@
-from cffi import FFI
-import os
-
-ffi = FFI()
-ffi.cdef("void start_server(void);")
-
-# Bazel runs binaries from a sandbox, so use runfiles to locate the .so
-import pathlib
-runfiles_dir = pathlib.Path(__file__).parent
-libpath = runfiles_dir / "mrjunejune_server_so.so"
-
-C = ffi.dlopen(str(libpath))
-C.start_server()
-
diff -r 7eb79fd91c7e -r f7860f491a8c mrjunejune/test/BUILD
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mrjunejune/test/BUILD Thu Jan 08 19:21:22 2026 -0800
@@ -0,0 +1,48 @@
+load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
+load("@rules_cc//cc:cc_test.bzl", "cc_test")
+load("//gui_ze:gui_ze.bzl", "move_files_into_dir", "bundle")
+
+# Files needed for test
+filegroup(
+ name = "test_snapshots",
+ srcs = glob(["snapshots/**"]),
+)
+
+filegroup(
+ name = "test_files",
+ srcs = [
+ "shiba.webp",
+ "test_avi.avi",
+ ],
+)
+
+# To create a snapsho to compare
+cc_binary(
+ name = "create_snapshots",
+ srcs = ["auto_generated_test.c", "test.h"],
+ deps = ["//seobeo:seobeo_tcp_client"],
+ data = [
+ "//mrjunejune:mrjunejune_server",
+ "//mrjunejune:src_files",
+ ],
+ args = ["$(location //mrjunejune:mrjunejune_server)"],
+)
+
+# Tests
+cc_test(
+ name = "integration_test",
+ srcs = [
+ "integration_test.c",
+ "test.h"
+ ],
+ deps = ["//seobeo:seobeo_tcp_client"],
+ data = [
+ "//mrjunejune:mrjunejune_server",
+ "//mrjunejune:src_files",
+ ":test_snapshots",
+ ":test_files",
+ ],
+ size = "large",
+ timeout = "long",
+ args = ["$(location //mrjunejune:mrjunejune_server)"],
+)
diff -r 7eb79fd91c7e -r f7860f491a8c mrjunejune/test/auto_generated_test.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mrjunejune/test/auto_generated_test.c Thu Jan 08 19:21:22 2026 -0800
@@ -0,0 +1,45 @@
+// Auto-generated test file
+// Source: /Users/mrjunejune/zenbu/mrjunejune/main.c
+// DO NOT EDIT - Regenerate with: bazel run //seobeo:test_generator
+
+#include "mrjunejune/test/test.h"
+
+#define TEST_HOST "127.0.0.1"
+#define TEST_PORT "6969"
+
+int main(int argc, char *argv[])
+{
+ printf("=== Auto-generated Snapshot Creator ===\n\n");
+
+ const char *server_binary = "./server";
+ if (argc > 1) server_binary = argv[1];
+
+ pid_t server_pid = start_test_server(server_binary);
+ if (server_pid < 0) return 1;
+
+ SnapshotConfig configs[] = {
+ {"/", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ {"/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ {"/resume", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ {"/resume/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ {"/tools", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ {"/tools/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ {"/tools/markdown_to_html", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ {"/tools/markdown_to_html/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ {"/tools/file_converter", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ {"/tools/file_converter/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ // TODO: POST route - POST /api/convert/image-to-webp - requires request body
+ // TODO: POST route - POST /api/convert/video-to-mp4 - requires request body
+ // TODO: Dynamic route - GET /api/download/:filename - fill in actual path
+ {"/blog", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ // TODO: Dynamic route - GET /blog/:blog_id - fill in actual path
+ {"/talk", 200, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ {"/talk/index.html", 301, SNAPSHOT_DIR, TEST_HOST, TEST_PORT},
+ };
+
+ int count = sizeof(configs) / sizeof(configs[0]);
+ int result = Seobeo_Snapshots_Create_Batch(configs, count);
+
+ stop_test_server(server_pid);
+ return result;
+}
diff -r 7eb79fd91c7e -r f7860f491a8c mrjunejune/test/create_snapshots.c
--- a/mrjunejune/test/create_snapshots.c Thu Jan 08 19:20:56 2026 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-#include "seobeo/seobeo.h"
-#include "seobeo/snapshot_creator.h"
-#include
-#include
-#include
-#include
-#include
-
-#define TEST_PORT "6969"
-#define TEST_HOST "127.0.0.1"
-#define SNAPSHOT_DIR "mrjunejune/test/snapshots"
-
-// Start the server process
-static pid_t start_server(const char *server_binary)
-{
- pid_t server_pid = fork();
-
- if (server_pid < 0)
- {
- perror("fork");
- return -1;
- }
-
- if (server_pid == 0)
- {
- // Child process - run server
- printf("Starting server on port %s...\n", TEST_PORT);
- execl(server_binary, server_binary, NULL);
- perror("execl failed");
- exit(1);
- }
-
- // Parent - verify server started
- printf("Server started (PID: %d)\n", server_pid);
-
- usleep(100000);
- int status;
- pid_t result = waitpid(server_pid, &status, WNOHANG);
- if (result != 0)
- {
- if (WIFEXITED(status))
- {
- fprintf(stderr, "Server exited with code: %d\n", WEXITSTATUS(status));
- }
- else if (WIFSIGNALED(status))
- {
- fprintf(stderr, "Server killed by signal: %d\n", WTERMSIG(status));
- }
- return -1;
- }
-
- sleep(2);
- printf("Server ready\n\n");
-
- return server_pid;
-}
-
-// Stop the server process
-static void stop_server_test(pid_t server_pid)
-{
- if (server_pid > 0)
- {
- printf("\nStopping server (PID: %d)...\n", server_pid);
- kill(server_pid, SIGTERM);
- waitpid(server_pid, NULL, 0);
- printf("Server stopped\n");
- }
-}
-
-int main(int argc, char *argv[])
-{
- printf("=== Seobeo Snapshot Creator ===\n\n");
-
- // Get workspace directory (where the source files are)
- const char *workspace_dir = getenv("BUILD_WORKSPACE_DIRECTORY");
- if (!workspace_dir)
- {
- fprintf(stderr, "Error: BUILD_WORKSPACE_DIRECTORY not set\n");
- fprintf(stderr, "This binary must be run with 'bazel run'\n");
- return 1;
- }
-
- // Construct full path to snapshot directory
- char snapshot_path[1024];
- snprintf(snapshot_path, sizeof(snapshot_path), "%s/%s", workspace_dir, SNAPSHOT_DIR);
-
- // Get server binary path
- const char *server_binary = "./mrjunejune_server";
- if (argc > 1)
- {
- server_binary = argv[1];
- }
-
- printf("Workspace: %s\n", workspace_dir);
- printf("Server binary: %s\n", server_binary);
- printf("Snapshot directory: %s\n\n", snapshot_path);
-
- // Start server
- pid_t server_pid = start_server(server_binary);
- if (server_pid < 0)
- {
- fprintf(stderr, "Failed to start server\n");
- return 1;
- }
-
- // Define snapshots to create - paths that should succeed (200 OK)
- SnapshotConfig success_snapshots[] = {
- {"/", 200, snapshot_path, TEST_HOST, TEST_PORT},
- {"/resume", 200, snapshot_path, TEST_HOST, TEST_PORT},
- {"/tools", 200, snapshot_path, TEST_HOST, TEST_PORT},
- {"/tools/markdown_to_html", 200, snapshot_path, TEST_HOST, TEST_PORT},
- {"/tools/file_converter", 200, snapshot_path, TEST_HOST, TEST_PORT},
- };
- int num_success = sizeof(success_snapshots) / sizeof(success_snapshots[0]);
-
- // Define snapshots for redirect endpoints (301)
- SnapshotConfig redirect_snapshots[] = {
- {"/index.html", 301, snapshot_path, TEST_HOST, TEST_PORT},
- {"/resume/index.html", 301, snapshot_path, TEST_HOST, TEST_PORT},
- {"/tools/index.html", 301, snapshot_path, TEST_HOST, TEST_PORT},
- {"/tools/markdown_to_html/index.html", 301, snapshot_path, TEST_HOST, TEST_PORT},
- {"/tools/file_converter/index.html", 301, snapshot_path, TEST_HOST, TEST_PORT},
- };
- int num_redirects = sizeof(redirect_snapshots) / sizeof(redirect_snapshots[0]);
-
- SnapshotConfig error_snapshots[] = {
- {"/nonexistent", 404, snapshot_path, TEST_HOST, TEST_PORT},
- {"/does/not/exist", 404, snapshot_path, TEST_HOST, TEST_PORT},
- {"/missing.html", 404, snapshot_path, TEST_HOST, TEST_PORT},
- };
- int num_errors = sizeof(error_snapshots) / sizeof(error_snapshots[0]);
-
- int total_failed = 0;
- int total_passed = 0;
-
- // Create success snapshots
- printf("Creating snapshots for successful paths:\n\n");
- for (int i = 0; i < num_success; i++)
- {
- if (Seobeo_Snapshot_Create(&success_snapshots[i]) == 0)
- {
- total_passed++;
- }
- else
- {
- total_failed++;
- }
- }
-
- // Create redirect snapshots
- printf("\nCreating snapshots for redirect paths:\n\n");
- for (int i = 0; i < num_redirects; i++)
- {
- if (Seobeo_Snapshot_Create(&redirect_snapshots[i]) == 0)
- {
- total_passed++;
- }
- else
- {
- total_failed++;
- }
- }
-
- // Create error snapshots
- printf("\nCreating snapshots for error paths:\n\n");
- for (int i = 0; i < num_errors; i++)
- {
- if (Seobeo_Snapshot_Create(&error_snapshots[i]) == 0)
- {
- total_passed++;
- }
- else
- {
- total_failed++;
- }
- }
-
- // Stop server
- stop_server_test(server_pid);
-
- // Print summary
- printf("\n=== Summary ===\n");
- printf("Snapshots created: %d\n", total_passed);
- printf("Failed: %d\n", total_failed);
-
- if (total_failed == 0)
- {
- printf("\n✓ All snapshots created successfully!\n");
- printf("\nSnapshots saved to: %s/\n", snapshot_path);
- printf("\nRun tests to verify:\n");
- printf(" bazel test //mrjunejune:integration_test\n");
- return 0;
- }
- else
- {
- printf("\n✗ Some snapshots failed\n");
- return 1;
- }
-}
diff -r 7eb79fd91c7e -r f7860f491a8c mrjunejune/test/snapshots/blog.snapshot
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mrjunejune/test/snapshots/blog.snapshot Thu Jan 08 19:21:22 2026 -0800
@@ -0,0 +1,208 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+
+ Blogs
+
+
+
+ January 02 2026
+
+
+
+ Apr 12 2025
+
+
+
+ Dec 10 2024
+
+
+
+ Nov 23 2024
+
+
+
+ Nov 21 2024
+
+
+
+ Nov 17 2024
+
+
+
+ Nov 16 2024
+
+
+
+ Nov 13 2024
+
+
+
+
+
+ © 2026 June Park
+
+
+
+
diff -r 7eb79fd91c7e -r f7860f491a8c mrjunejune/test/snapshots/talk.snapshot
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mrjunejune/test/snapshots/talk.snapshot Thu Jan 08 19:21:22 2026 -0800
@@ -0,0 +1,223 @@
+
+
+
+
+ Talk!
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+ Talks
+
+
+
+
+
+
+
+
+ © 2026 June Park
+
+
+
+
+
diff -r 7eb79fd91c7e -r f7860f491a8c mrjunejune/test/test.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mrjunejune/test/test.h Thu Jan 08 19:21:22 2026 -0800
@@ -0,0 +1,74 @@
+#include "seobeo/seobeo.h"
+#include "seobeo/snapshot_creator.h"
+#include
+#include
+#include
+#include
+#include
+
+#define TEST_PORT "6969"
+#define TEST_HOST "127.0.0.1"
+#define TEST_URL "http://127.0.0.1:6969"
+#define MAX_RESPONSE_SIZE (1024 * 1024)
+#ifndef SNAPSHOT_DIR
+ #define SNAPSHOT_DIR "mrjunejune/test/snapshots"
+#endif
+
+pid_t start_test_server(const char *server_binary);
+void stop_test_server(pid_t server_pid);
+
+
+pid_t start_test_server(const char *server_binary)
+{
+ pid_t server_pid = fork();
+
+ if (server_pid < 0)
+ {
+ perror("fork");
+ return -1;
+ }
+
+ if (server_pid == 0)
+ {
+ printf("Starting server on port %s...\n", TEST_PORT);
+ execl(server_binary, server_binary, NULL);
+ perror("execl failed");
+ exit(1);
+ }
+
+ printf("Server started (PID: %d)\n", server_pid);
+
+ usleep(100000);
+ int status;
+ pid_t result = waitpid(server_pid, &status, WNOHANG);
+ if (result != 0)
+ {
+ if (WIFEXITED(status))
+ {
+ fprintf(stderr, "Server exited immediately with code: %d\n", WEXITSTATUS(status));
+ }
+ else if (WIFSIGNALED(status))
+ {
+ fprintf(stderr, "Server was killed by signal: %d\n", WTERMSIG(status));
+ }
+ return -1;
+ }
+
+ sleep(2);
+ printf("Server ready\n\n");
+
+ return server_pid;
+}
+
+void stop_test_server(pid_t server_pid)
+{
+ if (server_pid > 0)
+ {
+ printf("\nStopping server (PID: %d)...\n", server_pid);
+ kill(server_pid, SIGTERM);
+ waitpid(server_pid, NULL, 0);
+ printf("Server stopped\n");
+ }
+}
+
+