# Integration Tests This directory contains two integration test implementations that test the same core API workflow but serve different purposes. ## Test Files ### `text_extraction_integration_test.go` - Automated CI/CD Testing **Purpose**: Automated integration testing for CI/CD pipelines. **How it works**: - Self-contained using testcontainers (spins up PostgreSQL, S3 mock, and API server automatically) - Uses the generated Go API client for type-safe requests - Runs as part of `task test:functional` or `task fullsuite:ci` **When to use**: - Local development verification before committing - CI/CD pipeline testing - Automated regression testing **Run with**: ```bash go test -v ./test/... -run TestE2EDocWorkflow # Or via task task test:functional ``` --- ### `text_extraction_integration_test.sh` - Manual Testing **Purpose**: Manual end-to-end testing against a running API server. **How it works**: - Uses curl/jq to make REST API calls - Requires an external API server already running (auth bypass mode) - Creates comprehensive test data with realistic healthcare contract values - Demonstrates API usage for UI developers **When to use**: - Testing against local docker-compose stack - Testing against AWS dev/UAT deployments - Populating a development environment with sample data - Demonstrating API endpoints to UI developers **Run with**: ```bash # Against local stack ./test/text_extraction_integration_test.sh http://localhost:8080 # Against AWS deployment ./test/text_extraction_integration_test.sh http://your-alb-url.us-east-2.elb.amazonaws.com ``` **Requirements**: - bash 4.0+ - curl - jq - zip - Target API must be running in auth bypass mode --- ## Test Coverage Both tests exercise the same core workflow: 1. **Client Setup**: Create, verify, list, update client 2. **Document Upload**: Batch ZIP upload, single document upload 3. **Label Operations**: Apply labels, verify, query by label 4. **Folder Metrics**: List folders, get metrics per folder 5. **Field Extractions**: Create, version history, retrieve specific versions The Go test includes additional scenarios: - Deep folder hierarchy (12 levels) - Large array field extraction (100 items) - Label reapplication history - Cross-feature integration (folders + labels + field extractions)