Skip to content

Conversation

@michaelboulton
Copy link
Member

No description provided.

- Added test case to verify failure when a non-existent file is touched and validated (`some_other_file.txt`).
- Added test case to validate failure for an invalid `touch_file` schema with a nonexistent field.
- Added test case to validate failure for an invalid `file_exists` response schema with a nonexistent field.

This enhances validation coverage for the custom backend by introducing negative test scenarios.
…tavern_plugin

- Moved `example/custom_backend` to `example/custom_backend/my_tavern_plugin` for clearer structure.
- Renamed `custom_backend` to `my_tavern_plugin` across all files, including `pyproject.toml`, test files, and paths.
- Updated `tox-integration.ini` to reflect the new plugin path.
- Adjusted `run_tests.sh` to use the updated plugin and test file paths.
- Renamed and relocated `jsonschema.yaml` to match the new plugin directory.

These changes improve project organization and better align naming conventions with intended functionality.
- Created `README.md` in `example/custom_backend` to provide an overview of the custom backend plugin.
- Documented the implementation details, including `Request`, `Response`, `Session` classes, and supporting functions.
- Added instructions for configuring the plugin in `pyproject.toml` and `pytest.ini`.
- Included an example test case showcasing usage of `touch_file` and `file_exists` stages.

This README serves as a guide for creating and using a custom backend plugin with Tavern.
…nation

- Added details about why Tavern needs the `tavern-extra-backends` flag for custom backends.
- Explained how Tavern defaults to loading only "grpc", "http", and "mqtt" backends and how the flag helps register a custom backend with Tavern.
- Included a reference to `stevedore` for plugin loading for better clarity.
… pyproject.toml

- Updated the `description` field in `pyproject.toml` to include more details about the custom generic plugin's functionality.
- Adjusted the `requires-python` version from `>=3.14` to `>=3.12` for compatibility.
- Added a docstring to `Session` class to describe its purpose and context manager protocol implementation.
- Added a docstring to `Request` class to explain its functionality, specifically touching a file during a request operation.
- Updated the example README to show the new `tavern-extra-backends` syntax, allowing a backend name without an explicit implementation and documenting entry‑point naming rules.
- Enhanced the example `run_tests.sh` script with three test runs: using the default backend, specifying a custom implementation, and exercising the error case when a non‑existent implementation is requested.
- Refactored plugin discovery in `tavern/_core/plugins.py`:
  - Added handling for backends with no explicit implementation (treated as default).
  - Tracked discovered plugins per backend and raise a `PluginLoadError` if multiple plugins are enabled for the same backend.
  - Updated the stevedore check function to use the new logic.
- Modified extra backend parsing in `tavern/_core/pytest/util.py`:
  - Now accepts both `name` (default backend) and `name=value` forms.
  - Stores `None` for default backends and provides clearer error messages for malformed input.
- Minor formatting improvements in configuration docs.
- Added a detailed docstring to the `is_plugin_backend_enabled` function in `tavern/_core/plugins.py`.
- Clarified the purpose of the function, its arguments, and its return value.
- Enhanced readability by documenting the function's role in checking backend enablement based on configuration.
- Introduced the `stevedore.extension.Extension` type hint for better type clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Support for Third-Party Plugin Block Names in Core Schema

2 participants