diff --git a/cli/test_execution_tail.bats b/cli/test_execution_tail.bats index 787812d..e5af474 100644 --- a/cli/test_execution_tail.bats +++ b/cli/test_execution_tail.bats @@ -39,23 +39,6 @@ load '../test_helpers/bats-assert/load' assert_output --regexp "Execution [0-9a-f]{24} has completed \\(status=succeeded\\)." } -@test "st2 execution tail command works correctly for Mistral workflows" { - run st2 runner get mistral-v2 > /dev/null - if [[ "$status" -ne 0 ]]; then - skip "Mistral not available, skipping tests" - fi - - # Run the run + execution tail command - this may take awhile - run eval "st2 run examples.mistral-streaming-demo count=2 sleep_delay=0.2 --tail" - - assert_success - assert_output --regexp "Child execution \\(task=task3\\) [0-9a-f]{24} has started\..*" - assert_output --regexp "Child execution \\(task=task3\\) [0-9a-f]{24} has finished \\(status=succeeded\\)\." - assert_output --regexp "Child execution \\(task=task10\\) [0-9a-f]{24} has started\..*" - assert_output --regexp "Child execution \\(task=task10\\) [0-9a-f]{24} has finished \\(status=succeeded\\)\." - assert_output --regexp "Execution [0-9a-f]{24} has completed \\(status=succeeded\\)." -} - @test "st2 execution tail command works correctly for Orquesta workflows" { run st2 runner get orquesta > /dev/null if [[ "$status" -ne 0 ]]; then diff --git a/packs/tests/actions/chains/test_inquiry_mistral.yaml b/packs/tests/actions/chains/test_inquiry_mistral.yaml deleted file mode 100644 index 5d7dd5b..0000000 --- a/packs/tests/actions/chains/test_inquiry_mistral.yaml +++ /dev/null @@ -1,240 +0,0 @@ ---- - -# Workflow for testing Inquiry functionality with a Mistral workflow - -chain: - -# Executing inquiry workflow via CLI instead of directly via ref so this workflow doesn't get paused -- name: "execute_inquiry_workflow" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: "st2 run examples.mistral-ask-basic" - on-success: "get_inquiry_trigger" - -- name: "get_inquiry_trigger" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: "st2 trigger-instance list -j --trigger=core.st2.generic.inquiry" - on-success: "get_inquiry_id" - -- name: "get_inquiry_id" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: 'echo $(st2 inquiry list | grep -o "[0-9a-f]\{24\}" | tail -1)' - on-success: "get_workflow_id" - -- name: "get_workflow_id" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: 'echo $(st2 execution list -a id --action=examples.mistral-ask-basic | grep -o "[0-9a-f]\{24\}" | tail -1)' - on-success: "assert_workflow_paused_prep" - -- name: "assert_workflow_paused_prep" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: "st2 execution get -dj {{ get_workflow_id.stdout }} | python -c \"import sys, json; output=json.load(sys.stdin); print(output.get('status', None))\"" - on-success: "assert_workflow_paused" - -- name: "assert_workflow_paused" - ref: "asserts.object_equals" - params: - object: - status: "{{ assert_workflow_paused_prep.stdout }}" - expected: - status: "paused" - on-success: "invalid_response_expect_failure" - -- name: "invalid_response_expect_failure" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: "st2 inquiry respond -r '{\"secondfactor\": 123}' {{ get_inquiry_id.stdout }}" - on-failure: "pause_after_invalid_response" - on-success: "fail" - -- name: "pause_after_invalid_response" - ref: "core.pause" - params: - max_pause: 5 - on-success: "assert_workflow_still_paused_prep" - -- name: "assert_workflow_still_paused_prep" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: "st2 execution get -dj {{ get_workflow_id.stdout }} | python -c \"import sys, json; output=json.load(sys.stdin); print(output.get('status', None))\"" - on-success: "assert_workflow_still_paused" - -- name: "assert_workflow_still_paused" - ref: "asserts.object_equals" - params: - object: - status: "{{ assert_workflow_still_paused_prep.stdout }}" - expected: - status: "paused" - on-success: "post_valid_response" - -- name: "post_valid_response" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: "st2 inquiry respond -r '{\"secondfactor\": \"bar\"}' {{ get_inquiry_id.stdout }}" - on-success: "pause_after_valid_response" - -- name: "pause_after_valid_response" - ref: "core.pause" - params: - max_pause: 5 - on-success: "assert_workflow_succeeded_prep" - -- name: "assert_workflow_succeeded_prep" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: "st2 execution get -dj {{ get_workflow_id.stdout }} | python -c \"import sys, json; output=json.load(sys.stdin); print(output.get('status', None))\"" - on-success: "assert_inquiry_task_succeeded_prep" - -- name: "assert_inquiry_task_succeeded_prep" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: "st2 execution get -dj {{ get_workflow_id.stdout }} | python -c \"import sys, json; output=json.load(sys.stdin); tasks = list(filter(lambda x: x.get('name', None) == 'task1', output['result']['tasks'])); print(tasks[0].get('state', None))\"" - on-success: "assert_inquiry_task_succeeded" - on-failure: "resume_workflow_manually" - -- name: "assert_inquiry_task_succeeded" - ref: "asserts.object_equals" - params: - object: - status: "{{ assert_inquiry_task_succeeded_prep.stdout }}" - expected: - status: "SUCCESS" - on-success: "assert_workflow_succeeded" - on-failure: "assert_inquiry_task_running" - -- name: "assert_workflow_succeeded" - ref: "asserts.object_equals" - params: - object: - status: "{{ assert_workflow_succeeded_prep.stdout }}" - expected: - status: "succeeded" - on-success: "assert_workflow_expected_output_prep" - on-failure: "assert_workflow_stuck_in_paused" - -- name: "assert_workflow_expected_output_prep" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: "st2 execution get -dj {{ get_workflow_id.stdout }} | python -c \"import sys, json; output=json.load(sys.stdin); tasks = list(filter(lambda x: x.get('name', None) == 'task2', output['result']['tasks'])); print(tasks[0].get('result', {}).get('stdout', None))\"" - on-success: "assert_workflow_expected_output" - -- name: "assert_workflow_expected_output" - ref: "asserts.object_equals" - params: - object: - stdout: "{{ assert_workflow_expected_output_prep.stdout }}" - expected: - stdout: "We can now authenticate to 'foo' service with bar" - on-success: "duplicate_response_expect_failure" - -- name: "duplicate_response_expect_failure" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: "st2 inquiry respond -r '{\"secondfactor\": \"bar\"}' {{ get_inquiry_id.stdout }}" - on-success: "fail" - on-failure: assert_triggers - -- name: "assert_triggers" - ref: "asserts.object_key_string_equals" - params: - object: "{{ get_inquiry_trigger.stdout[0] }}" - key: status - value: processed - -- name: "assert_inquiry_task_running" - ref: "asserts.object_equals" - params: - object: - status: "{{ assert_inquiry_task_succeeded_prep.stdout }}" - expected: - status: "RUNNING" - on-success: "assert_workflow_stuck_in_paused" - -- name: "assert_workflow_stuck_in_paused" - ref: "asserts.object_equals" - params: - object: - status: "{{ assert_workflow_succeeded_prep.stdout }}" - expected: - status: "paused" - on-success: "resume_workflow_manually" - -- name: "resume_workflow_manually" - ref: "core.local" - params: - env: - ST2_BASE_URL: "{{protocol}}://{{hostname}}" - ST2_AUTH_URL: "{{protocol}}://{{hostname}}:9100" - ST2_API_URL: "{{protocol}}://{{hostname}}:9101" - ST2_AUTH_TOKEN: "{{token}}" - cmd: "st2 execution resume {{ get_workflow_id.stdout }}" - on-success: "pause_after_valid_response" - -- name: "fail" - ref: core.local - cmd: exit 1 diff --git a/packs/tests/actions/test_inquiry_mistral.meta.yaml b/packs/tests/actions/test_inquiry_mistral.meta.yaml deleted file mode 100644 index 5d3bb91..0000000 --- a/packs/tests/actions/test_inquiry_mistral.meta.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -# Action definition metadata -name: "test_inquiry_mistral" -description: "Workflow tests Inquiries" -runner_type: "action-chain" -enabled: true -entry_point: "chains/test_inquiry_mistral.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/spec/vagrant/core_spec.rb b/spec/vagrant/core_spec.rb index 67c674e..e92a6d0 100644 --- a/spec/vagrant/core_spec.rb +++ b/spec/vagrant/core_spec.rb @@ -152,69 +152,6 @@ it { should be_directory } end -# mistral -MISTRAL_DEBIAN_PACKAGES = %w(mysql-server) -MISTRAL_REDHAT_PACKAGES = %w(mariadb mariadb-libs mariadb-devel mariadb-server) - -MISTRAL_DEBIAN_PACKAGES.each do |package| - describe package(package), :if => os[:family] == 'ubuntu' do - it { should be_installed } - end -end - -MISTRAL_REDHAT_PACKAGES.each do |package| - describe package(package), :if => os[:family] == 'redhat' do - it { should be_installed } - end -end - -# describe connection string in config -# ensure mysql is setup with mistral - -describe file('/opt/openstack/mistral') do - it { should be_directory } -end - -describe file('/opt/openstack/mistral/.git') do - it { should be_directory } -end - -describe file('/opt/openstack/mistral/.venv') do - it { should be_directory } -end - -describe file('/etc/mistral/mistral.conf') do - it { should be_file } - it { should contain 'connection = mysql://mistral:StackStorm@localhost/mistral' } - it { should contain 'max_pool_size = 100' } - it { should contain 'auth_enable = false' } -end - -MISTRAL_INIT_COMMAND="/opt/openstack/mistral/.venv/bin/python /opt/openstack/mistral/mistral/cmd/launch.py --config-file /etc/mistral/mistral.conf --log-file /var/log/mistral.log --log-config-append /etc/mistral/wf_trace_logging.conf" - -describe file('/etc/mistral/wf_trace_logging.conf') do - it { should be_file } - it { should contain 'args=("/var/log/mistral_wf_trace.log",)' } -end - -describe file('/etc/init/mistral.conf'), :if => os[:family] == 'ubuntu' do - it { should be_file } - it { should contain MISTRAL_INIT_COMMAND } -end - -describe file('/etc/systemd/system/mistral.service'), :if => os[:family] == 'redhat' do - it { should be_file } - it { should contain MISTRAL_INIT_COMMAND } -end - -describe file('/etc/mistral/actions/st2mistral') do - it { should be_directory } -end - -describe file('/etc/mistral/actions/st2mistral/.git') do - it { should be_directory } -end - describe port(8989) do it { should be_listening } end