Skip to content
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

Formalize test plan schema #21

Open
sharonxiaohanli opened this issue Apr 4, 2024 · 1 comment
Open

Formalize test plan schema #21

sharonxiaohanli opened this issue Apr 4, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@sharonxiaohanli
Copy link
Contributor

sharonxiaohanli commented Apr 4, 2024

Currently test plan is defined as yaml file, for example for the target field

target:
  type: bedrock-agent
  bedrock_agent_id: <>
  bedrock_agent_alias_id: <>

If converting the current yaml to json schema it would be like:

"target": {
      "type": "object", 
      "properties": {
        "type": {"type": "string"},
        "bedrock_agent_id": {"type": "string"},
        "bedrock_agent_alias_id": {"type": "string"} 
      },
      "required": ["type", "bedrock_agent_id", "bedrock_agent_alias_id"]
    }

which doesn't work with other target type making it hard to validate the test plan without actually running the test. Proposing to have a json schema defined for the test plan file like:

"target": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": ["bedrock-agent", "q-business"] 
        },
        "attributes": {
          "oneOf": [
            {
              "properties": {
                "bedrock_agent_id": {"type": "string"},
                "bedrock_agent_alias_id": {"type": "string"}
              },
              "required": ["bedrock_agent_id", "bedrock_agent_alias_id"],
              "if": {"properties": {"type": {"const": "bedrock-agent"}}}
            },
            {
              "properties": {
                "q_business_application_id": {"type": "string"}, 
                "q_business_user_id": {"type": "string"}
              },
              "required": ["q_business_application_id", "q_business_user_id"],
              "if": {"properties": {"type": {"const": "q-business"}}}
            }
          ]
        }
      },
      "required": ["type", "attributes"]
    }

so that:

  1. yaml and json test plan can be interchangeable
  2. test plan file can be validated on the format

Acceptance criteria:

  1. json format for the test plan file in-place
  2. when triggering the runner, validate the test plan format and throw clear errors if malformatted
  3. add unit test
@sharonxiaohanli sharonxiaohanli added enhancement New feature or request good first issue Good for newcomers labels Apr 4, 2024
@tonykchen
Copy link
Contributor

Hey @sharonxiaohanli, this is a great idea! Lets tackle this post 0.1.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants