* refactor: Simplify flow execution validation by removing unnecessary asyncio.wait_for calls Updated the validate_flow_execution function to directly use the client.post and client.get methods with a timeout parameter, improving code readability and maintainability. This change eliminates redundant timeout handling while ensuring consistent timeout values across API calls. * refactor: Enhance template tests for improved structure and validation Refactored the template tests in `test_starter_projects.py` to utilize parameterization for better readability and maintainability. Introduced helper functions to retrieve template files and disabled tracing for all tests. Updated individual test methods to validate JSON structure, flow execution, and endpoint validation, ensuring comprehensive coverage of template functionality. This change streamlines the testing process and enhances the robustness of the test suite. * refactor: Update project metadata and import paths in starter project JSON files Modified the metadata section in multiple starter project JSON files to reflect updated code hashes and module paths, transitioning from 'lfx' to 'langflow' components. This change enhances consistency across the codebase and ensures that the correct modules are referenced for improved maintainability and clarity. * chore: Update template test commands to utilize parallel execution Modified the commands in the Makefile and CI workflows to include the `-n auto` option for pytest, enabling parallel test execution for the starter project template tests. This change enhances test performance and efficiency across the codebase. * chore: Remove news-aggregated.json file Deleted the news-aggregated.json file * Update test_template_validation.py * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
40 lines
No EOL
929 B
YAML
40 lines
No EOL
929 B
YAML
name: Template Tests
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'src/backend/base/langflow/initial_setup/starter_projects/**'
|
|
- 'src/backend/tests/unit/template/test_starter_projects.py'
|
|
- 'src/backend/base/langflow/utils/template_validation.py'
|
|
- '.github/workflows/template-tests.yml'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
jobs:
|
|
test-starter-projects:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python 3.12
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: 3.12
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v3
|
|
with:
|
|
version: "latest"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
uv sync --dev
|
|
|
|
- name: Test all starter project templates
|
|
run: |
|
|
uv run pytest src/backend/tests/unit/template/test_starter_projects.py -v -n auto |