fd6d41b371
CI / lint (pull_request) Successful in 14s
CI / typecheck (pull_request) Successful in 26s
CI / security (pull_request) Successful in 21s
CI / quality (pull_request) Successful in 16s
CI / integration_tests (pull_request) Successful in 4m15s
CI / build (pull_request) Successful in 16s
CI / unit_tests (pull_request) Successful in 7m41s
CI / docker (pull_request) Successful in 39s
CI / lint (push) Successful in 13s
CI / coverage (pull_request) Successful in 5m38s
CI / typecheck (push) Successful in 26s
CI / security (push) Successful in 22s
CI / quality (push) Successful in 15s
CI / integration_tests (push) Successful in 4m10s
CI / build (push) Successful in 15s
CI / unit_tests (push) Successful in 8m17s
CI / docker (push) Successful in 41s
CI / coverage (push) Successful in 5m30s
111 lines
5.2 KiB
Gherkin
111 lines
5.2 KiB
Gherkin
Feature: Action Model Branch Coverage
|
|
As a developer
|
|
I want to exercise the remaining untested branches in action.py
|
|
So that the model has comprehensive test coverage
|
|
|
|
# Validate arguments - happy paths for non-string types
|
|
|
|
Scenario: Validate arguments - valid float value passes validation
|
|
Given I have an action with a float argument named "ratio"
|
|
When I validate the action arguments with "ratio" as float 3.14
|
|
Then the action argument validation should pass with no errors
|
|
|
|
Scenario: Validate arguments - valid integer value for float argument passes
|
|
Given I have an action with a float argument named "score"
|
|
When I validate the action arguments with "score" as integer 42
|
|
Then the action argument validation should pass with no errors
|
|
|
|
Scenario: Validate arguments - valid boolean true passes validation
|
|
Given I have an action with a boolean argument named "verbose"
|
|
When I validate the action arguments with "verbose" as boolean true
|
|
Then the action argument validation should pass with no errors
|
|
|
|
Scenario: Validate arguments - valid boolean false passes validation
|
|
Given I have an action with a boolean argument named "dry_run"
|
|
When I validate the action arguments with "dry_run" as boolean false
|
|
Then the action argument validation should pass with no errors
|
|
|
|
Scenario: Validate arguments - valid list passes validation
|
|
Given I have an action with a list argument named "targets"
|
|
When I validate the action arguments with "targets" as list "api,cli,web"
|
|
Then the action argument validation should pass with no errors
|
|
|
|
Scenario: Validate arguments - empty list passes validation
|
|
Given I have an action with a list argument named "items"
|
|
When I validate the action arguments with "items" as an empty list
|
|
Then the action argument validation should pass with no errors
|
|
|
|
# Float type with min/max - the code currently does NOT check min/max for float,
|
|
# so a float with min/max set should still pass (only int has min/max enforcement)
|
|
|
|
Scenario: Validate arguments - float with min max bounds still passes
|
|
Given I have an action with a bounded float argument "temperature" min 0.0 max 1.0
|
|
When I validate the action arguments with "temperature" as float 0.5
|
|
Then the action argument validation should pass with no errors
|
|
|
|
# Multiple argument types in one action
|
|
|
|
Scenario: Validate arguments - mixed types all valid
|
|
Given I have an action with mixed argument types
|
|
| name | type | requirement |
|
|
| label | str | required |
|
|
| count | int | required |
|
|
| ratio | float | required |
|
|
| enabled | bool | required |
|
|
| tags | list | optional |
|
|
When I validate the action with all mixed arguments provided correctly
|
|
Then the action argument validation should pass with no errors
|
|
|
|
# ActionArgument.parse for float and list types
|
|
|
|
Scenario: Parse a float type action argument
|
|
When I parse an action argument definition "ratio:float:required:Ratio value"
|
|
Then the parsed argument name should be "ratio"
|
|
And the parsed argument type should be "float"
|
|
And the parsed argument should be required
|
|
And the parsed argument description should be "Ratio value"
|
|
|
|
Scenario: Parse a list type action argument
|
|
When I parse an action argument definition "items:list:optional:List of items"
|
|
Then the parsed argument name should be "items"
|
|
And the parsed argument type should be "list"
|
|
And the parsed argument should be optional
|
|
And the parsed argument description should be "List of items"
|
|
|
|
# Action metadata fields
|
|
|
|
Scenario: Action with tags and created_by metadata
|
|
When I create an action with tags "ci,testing,coverage" and created_by "user-123"
|
|
Then the action should have 3 tags
|
|
And the action created_by should be "user-123"
|
|
|
|
Scenario: Action with description and long description
|
|
When I create an action with description "Quick summary" and long description "This is a detailed description of the action and what it does."
|
|
Then the action description should be "Quick summary"
|
|
And the action long description should contain "detailed description"
|
|
|
|
Scenario: Action with apply actor set
|
|
When I create an action with apply_actor "local/merge-bot"
|
|
Then the action apply_actor should be "local/merge-bot"
|
|
|
|
# Validate assignment on ActionArgument model config
|
|
|
|
Scenario: ActionArgument validates assignment on field change
|
|
Given I have a parsed action argument from "count:int:required:A counter"
|
|
When I change the action argument description to "Updated counter"
|
|
Then the action argument description should now be "Updated counter"
|
|
|
|
# Validate assignment on Action model config
|
|
|
|
Scenario: Action validates assignment when state is changed
|
|
Given I have a newly created action in available state
|
|
When I change the action state to "archived"
|
|
Then the action current state should be "archived"
|
|
|
|
# String type passes through without type check (default/no-op path)
|
|
|
|
Scenario: Validate arguments - string value needs no type enforcement
|
|
Given I have an action with a string argument named "label"
|
|
When I validate the action arguments with "label" as string "hello"
|
|
Then the action argument validation should pass with no errors
|