-
Notifications
You must be signed in to change notification settings - Fork 0
Implement New Features and add E2E Tests #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9de3fa0
a8c0df6
c2a09b4
693a671
82cf8cf
2e752fa
826eb61
1650457
e8d7285
4f518af
7697279
ceb9036
1767a79
d262d42
ff9f314
df39ea0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| name: E2E Tests | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| branches: ["main"] | ||
| paths: | ||
| - 'src/version.py' | ||
| - 'src/lzl/version.py' | ||
| pull_request: | ||
| branches: ["main"] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: | ||
| - "3.10" | ||
| - "3.11" | ||
| - "3.12" | ||
| fail-fast: false | ||
|
|
||
| services: | ||
| redis: | ||
| image: redis:alpine | ||
| ports: | ||
| - 6379:6379 | ||
| options: >- | ||
| --health-cmd "redis-cli ping" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
|
|
||
| minio: | ||
| # image: minio/minio:RELEASE.2024-12-18T13-15-44Z | ||
| image: minio/minio:edge-cicd | ||
| ports: | ||
| - 9000:9000 | ||
| # - 9001:9001 | ||
| env: | ||
| MINIO_ROOT_USER: minioadmin | ||
| MINIO_ROOT_PASSWORD: minioadmin | ||
| options: >- | ||
| --health-cmd "curl --silent --fail http://localhost:9000/minio/health/live" | ||
| --health-interval 30s | ||
| --health-timeout 10s | ||
| --health-retries 5 | ||
| volumes: | ||
| - /tmp/minio_data:/data | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: MinIO services missing required server commandBoth Additional Locations (1) |
||
|
|
||
| minio2: | ||
| # image: minio/minio:RELEASE.2024-12-18T13-15-44Z | ||
| image: minio/minio:edge-cicd | ||
| ports: | ||
| - "9001:9000" | ||
|
cursor[bot] marked this conversation as resolved.
|
||
| # - "9091:9090" | ||
| env: | ||
| MINIO_ROOT_USER: minioadmin | ||
| MINIO_ROOT_PASSWORD: minioadmin | ||
| options: >- | ||
| --health-cmd "curl --silent --fail http://localhost:9000/minio/health/live" | ||
| --health-interval 30s | ||
| --health-timeout 10s | ||
|
Comment on lines
+49
to
+64
|
||
| --health-retries 5 | ||
| volumes: | ||
| - /tmp/minio_data2:/data | ||
|
|
||
| steps: | ||
| # Proceeding with file creation. | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@v6 | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| uv sync --extra e2e | ||
|
|
||
| - name: Run E2E Tests | ||
| env: | ||
| MINIO_ENDPOINT: http://localhost:9000 | ||
| MINIO_ACCESS_KEY: minioadmin | ||
| MINIO_SECRET_KEY: minioadmin | ||
| MINIO2_ENDPOINT: http://localhost:9001 | ||
| MINIO2_ACCESS_KEY: minioadmin | ||
| MINIO2_SECRET_KEY: minioadmin | ||
| MINIO2_REGION: us-east-1 | ||
| REDIS_URL: redis://localhost:6379/0 | ||
| run: | | ||
| uv run pytest tests/e2e -v -s | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| # LazyOps (lazyops) | ||
|
|
||
| ## Project Overview | ||
|
|
||
| **LazyOps** is a Python library designed to provide a collection of utility modules and object registry patterns for building robust applications. It is currently under active refactoring to migrate core functionality into two distinct namespaces: | ||
|
|
||
| * **`lzl` (Lazy Libraries/Utilities):** Foundational utilities, async helpers, API clients, I/O operations, logging, and type definitions. | ||
| * **`lzo` (Lazy Objects/Registry):** Object registry patterns, state management, and configuration settings. | ||
|
|
||
| **Key Technologies:** Python 3.10+, Pydantic v2, AnyIO, Loguru, Typer. | ||
|
|
||
| ## Architecture | ||
|
|
||
| The codebase is organized into a `src` layout: | ||
|
|
||
| * `src/lzl/`: Contains the utility modules (e.g., `io`, `logging`, `pool`, `proxied`, `require`). | ||
| * `src/lzo/`: Contains the object registry and pattern modules (e.g., `registry`, `types`, `utils`). | ||
| * `tests/`: Comprehensive test suite using `pytest`, mirrored to the source structure. | ||
|
|
||
| ## Development Workflow | ||
|
|
||
| ### Installation | ||
|
|
||
| To install the package in editable mode with all dependencies: | ||
|
|
||
| ```bash | ||
| pip install -e ".[dev,docs,file,kops,fastapi]" | ||
| ``` | ||
|
|
||
| ### Build & Run | ||
|
|
||
| The project uses `setuptools` configured via `pyproject.toml`. | ||
|
|
||
| * **CLI:** The project exposes a CLI entry point `lzl` (mapped to `lzl.cmd:main`). | ||
|
|
||
| ### Testing | ||
|
|
||
| The project relies heavily on `pytest` and a `Makefile` to manage test execution. | ||
|
|
||
| **Common Test Commands:** | ||
|
|
||
| * `make test`: Run the entire test suite. | ||
| * `make test-lzl`: Run all documentation-focused submodule tests for `lzl`. | ||
| * Specific modules: `make test-lzl-io`, `make test-lzl-logging`, `make test-lzl-pool`, etc. | ||
| * `make test-lzo`: Run all `lzo` suite tests. | ||
| * Specific modules: `make test-lzo-registry`, `make test-lzo-types`. | ||
|
|
||
| ### Documentation | ||
|
|
||
| Documentation is built using **MkDocs** with the Material theme and **Mintlify**. | ||
|
|
||
| * `make mkdocs-serve`: Serve documentation locally at `http://127.0.0.1:8000/`. | ||
| * `make mkdocs-build`: Build static documentation. | ||
| * `make docs-preview`: Preview via Mintlify. | ||
|
|
||
| ## Key Files & Configuration | ||
|
|
||
| * **`pyproject.toml`**: Defines project metadata, dependencies (including optional groups like `kops`, `fastapi`), and build system. | ||
| * **`Makefile`**: The central entry point for running tests and documentation tasks. | ||
| * **`src/lzl/` & `src/lzo/`**: Core source code directories. | ||
| * **`README.md`**: Project overview and basic usage examples. | ||
|
|
||
| ## Conventions | ||
|
|
||
| * **Namespaces:** strictly adhere to `lzl` for utilities and `lzo` for registry/objects. | ||
| * **Async First:** The library leans heavily on `anyio` and async patterns. | ||
| * **Pydantic:** Extensive use of Pydantic models and settings (`BaseSettings`, `BaseModel`) for configuration and validation. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,3 +92,18 @@ mkdocs-build: | |
| ## mkdocs-deploy: Deploy MkDocs documentation to GitHub Pages | ||
| mkdocs-deploy: | ||
| $(MKDOCS) gh-deploy --force | ||
|
|
||
| # Spin up e2e environment | ||
| run-e2e-local: ## Run e2e tests locally | ||
| docker compose -f tests/docker-compose.e2e.yml up -d | ||
| uv sync --extra e2e | ||
| export MINIO_ENDPOINT=http://localhost:9000; \ | ||
| export MINIO_ACCESS_KEY=minioadmin; \ | ||
| export MINIO_SECRET_KEY=minioadmin; \ | ||
| export MINIO2_ENDPOINT=http://localhost:9001; \ | ||
| export MINIO2_ACCESS_KEY=minioadmin; \ | ||
| export MINIO2_SECRET_KEY=minioadmin; \ | ||
| export MINIO2_REGION=us-east-1; \ | ||
| export REDIS_URL=redis://localhost:6389/0; \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Incorrect Redis port in local e2e MakefileThe Makefile |
||
| uv run pytest tests/e2e -v -s | ||
| docker compose -f tests/docker-compose.e2e.yml down | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing command for MinIO services. The GitHub Actions MinIO services don't specify the server command in the
optionsfield. MinIO requires an explicit command likeserver /datato start properly. While this is specified in the docker-compose files, it's missing from the GitHub Actions service definition.