diff --git a/packs/tests/actions/render_config_context.py b/packs/fixtures/actions/render_config_context.py similarity index 100% rename from packs/tests/actions/render_config_context.py rename to packs/fixtures/actions/render_config_context.py diff --git a/packs/tests/actions/render_config_context.yaml b/packs/fixtures/actions/render_config_context.yaml similarity index 100% rename from packs/tests/actions/render_config_context.yaml rename to packs/fixtures/actions/render_config_context.yaml diff --git a/packs/fixtures/config.schema.yaml b/packs/fixtures/config.schema.yaml index eaa2404..23ca88a 100644 --- a/packs/fixtures/config.schema.yaml +++ b/packs/fixtures/config.schema.yaml @@ -7,3 +7,8 @@ type: "integer" default: 19009 required: false + config_item_one: + description: "Item use to test config context." + type: "string" + required: true + default: "Testing" diff --git a/packs/tests/actions/chains/test_render_config_context.yaml b/packs/tests/actions/chains/test_render_config_context.yaml new file mode 100644 index 0000000..27d75db --- /dev/null +++ b/packs/tests/actions/chains/test_render_config_context.yaml @@ -0,0 +1,28 @@ +--- + +# Workflow for testing config context rendering + +chain: + +# Executing inquiry workflow via CLI instead of directly via ref so this workflow doesn't get paused +- name: "run_render_config_context_action" + ref: "fixtures.render_config_context" + on-success: "assert_action_output" + on-failure: "fail" + +########### +# ASSERTS # +########### + +- name: "assert_action_output" + ref: "asserts.object_equals" + params: + object: "{{ run_render_config_context_action.result }}" + expected: + context_value: Testing + on-failure: "fail" + +- name: "fail" + ref: core.local + params: + cmd: exit 1 diff --git a/packs/tests/actions/test_render_config_context.yaml b/packs/tests/actions/test_render_config_context.yaml new file mode 100644 index 0000000..72dcb08 --- /dev/null +++ b/packs/tests/actions/test_render_config_context.yaml @@ -0,0 +1,20 @@ +--- +# Action definition metadata +name: "test_render_config_context" +description: "Workflow which tests render_config_context functionality" +runner_type: "action-chain" +enabled: true +entry_point: "chains/test_render_config_context.yaml" +parameters: + token: + type: "string" + description: "st2 auth token" + default: "" + protocol: + type: "string" + description: "http/https" + default: "http" + hostname: + type: "string" + description: "St2 host to run tests against" + default: "127.0.0.1" diff --git a/packs/tests/config.schema.yaml b/packs/tests/config.schema.yaml deleted file mode 100644 index 2e98ce6..0000000 --- a/packs/tests/config.schema.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -config_item_one: - description: "Item use to test config context." - type: "string" - required: true - default: "Testing"