End-to-End Functional Tests
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
End-to-End (E2E) functional tests in the FLEXT DB Oracle project are designed to validate complete user workflows and system integration scenarios. Unlike unit tests that use mocks, these tests utilize real components, including live Oracle database instances, to ensure the entire application—from the Command-Line Interface (CLI) to the database layer—functions correctly in production-like environments. Sources: tests/e2e/README.md:1-12, tests/README.md:38-42
The scope of these tests covers the full system integration, including the plugin system, observability components, and configuration management. They simulate real-world user journeys such as data pipeline execution, schema evolution, and bulk data operations. Sources: tests/e2e/README.md:16-24, tests/README.md:43-46
Test Architecture and Principles
The E2E testing layer represents the outermost tier of the project's layered testing strategy. It adheres to specific principles to ensure reliability:
- No Mocks or Stubs: Tests interact with real Oracle databases and actual application logic.
- Full Workflow Validation: Validates the flow from CLI commands through the API to database results.
- Environment Parity: Uses Docker-based Oracle environments (e.g., Oracle XE 21-slim) to mirror production setups.
Sources: tests/e2e/README.md:16-24, tests/README.md:83-93
The following diagram illustrates the position of E2E tests within the testing hierarchy and the data flow through the system:
The flow shows a complete synchronous request starting from the CLI and terminating in the database. Sources: tests/README.md:83-93, tests/e2e/README.md:38-46
Test Categories and Scenarios
CLI Workflow Tests
These tests simulate a user interacting with the flext-db-oracle tool. They verify connection establishment, query execution, and schema listing. Sources: tests/e2e/README.md:34-39
| Scenario | Description | Key Command |
|---|---|---|
| Connection | Validates database connectivity using environment variables. | connect-env |
| Query Execution | Executes standard SQL and verifies output format. | query --sql |
| Schema Inspection | Lists available schemas and tables within the database. | schemas, tables |
| Sources: tests/e2e/README.md:95-120 |
API Integration Tests
API tests focus on the FlextDbOracleApi class, validating programmatic access to database features, including plugin operations and observability. Sources: tests/e2e/README.md:41-46
The sequence shows the interaction between the API facade and external resources like plugins and the database. Sources: tests/e2e/README.md:122-155
Data Pipeline Tests
These scenarios cover complex, multi-step operations such as schema metadata extraction followed by bulk data insertion. Sources: tests/e2e/README.md:48-53
- Extraction: Retrieval of schema metadata using the
MetadataManager. - Transformation: Mapping Singer-compliant schemas to Oracle-specific types.
- Loading: Performing bulk inserts (e.g.,
bulk_insert) and verifying data integrity.
Sources: tests/e2e/README.md:157-195
Environment Configuration
E2E tests require specific environment variables to target the correct database instance and enable extended features. Sources: tests/e2e/README.md:73-82
| Variable | Description | Example Value |
|---|---|---|
ORACLE_E2E_TESTS | Flag to enable E2E suite execution. | 1 |
FLEXT_TARGET_ORACLE_HOST | Hostname of the Oracle database. | localhost |
FLEXT_TARGET_ORACLE_PORT | Listener port. | 1521 |
FLEXT_TARGET_ORACLE_SERVICE_NAME | Database service name. | XEPDB1 |
FLEXT_OBSERVABILITY_ENABLED | Enables metrics collection during tests. | 1 |
| Sources: tests/e2e/README.md:73-82, tests/README.md:131-139 |
Execution and Infrastructure
The tests are typically executed using pytest and can be run as part of a Docker Compose workflow. Sources: tests/e2e/README.md:86-93
# Running E2E tests via command line
pytest tests/e2e/
# Running specific scenarios with performance profiling
pytest tests/e2e/test_oracle_e2e.py::test_complete_cli_workflow --profile-svg
Sources: tests/e2e/README.md:86-93
Docker Integration
The project uses docker-compose.e2e.yml to orchestrate an Oracle XE container and the application environment. This ensures that the database is in a healthy state before tests commence via healthcheck protocols. Sources: tests/e2e/README.md:218-243
Conclusion
End-to-End Functional Tests provide the final gate for production readiness in the FLEXT DB Oracle library. By validating real-world data flows and system interactions without the use of mocks, they ensure that the CLI, API, and Oracle database work together as a cohesive system. Sources: tests/e2e/README.md:255-259, tests/README.md:175-179