Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Fixed
with items task. (bug fix) #4523
* Fix orquesta workflow bug where context variables are being overwritten on task join.
(bug fix) StackStorm/orquesta#112
* Fix `config_context` renders against incorrect pack
(bug fix) StackStorm/st2#4570
* Fix rendering of config_context in orquesta task that references action in different pack
(bug fix) #4570

2.10.3 - March 06, 2019
-----------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ version: 1.0
description: Testing config context render".
tasks:
task1:
action: tests.render
action: tests.render_config_context
output:
- context_value: <% task(task1).result.result.context_value %>
2 changes: 1 addition & 1 deletion st2common/tests/unit/services/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def test_request_action_execution_render(self):
'spec': task_spec,
'ctx': task_ctx,
'actions': [
{'action': 'dummy_pack_7.render', 'input': None}
{'action': 'dummy_pack_7.render_config_context', 'input': None}
]
}
workflow_service.request_task_execution(wf_ex_db, st2_ctx, task_ex_req)
Expand Down
2 changes: 1 addition & 1 deletion st2tests/integration/orquesta/test_wiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def test_output_on_error(self):
self.assertDictEqual(ex.result, expected_result)

def test_config_context_renders(self):
config_value = "testing"
config_value = "Testing"
wf_name = 'examples.render_config_context'

expected_output = {'context_value': config_value}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
name: render
name: render_config_context
runner_type: python-script
description: Action that uses config context
enabled: true
entry_point: render.py
entry_point: render_config_context.py
parameters:
value1:
description: Input for action1. Defaults to config_context value.
description: Input for render_config_context. Defaults to config_context value.
required: false
type: "string"
default: "{{ config_context.config_item_one }}"
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ version: 1.0
description: Testing config context render".
tasks:
task1:
action: dummy_pack_7.render
action: dummy_pack_7.render_config_context
output:
- context_value: <% task(task1).result.result.context_value %>
7 changes: 0 additions & 7 deletions st2tests/tests/actions/render.py

This file was deleted.

12 changes: 0 additions & 12 deletions st2tests/tests/actions/render.yaml

This file was deleted.

5 changes: 0 additions & 5 deletions st2tests/tests/config.schema.yaml

This file was deleted.

2 changes: 0 additions & 2 deletions st2tests/tests/configs/tests.yaml.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions st2tests/tests/pack.yaml

This file was deleted.

31 changes: 23 additions & 8 deletions tools/launchdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runner_count=1
scheduler_count=1
workflow_engine_count=1
use_gunicorn=true
copy_examples=false
copy_test_packs=false
load_content=true
use_ipv6=false
include_mistral=false
Expand All @@ -29,7 +29,7 @@ while getopts ":r:s:w:gxcu6m" o; do
use_gunicorn=false
;;
x)
copy_examples=true
copy_test_packs=true
;;
c)
load_content=false
Expand Down Expand Up @@ -209,11 +209,10 @@ function st2start(){
cp -Rp ./contrib/core/ $PACKS_BASE_DIR
cp -Rp ./contrib/packs/ $PACKS_BASE_DIR

if [ "$copy_examples" = true ]; then
echo "Copying examples from ./contrib/examples to $PACKS_BASE_DIR"
if [ "$copy_test_packs" = true ]; then
echo "Copying test packs examples and tests to $PACKS_BASE_DIR"
cp -Rp ./contrib/examples $PACKS_BASE_DIR
cp -Rp ./st2tests/tests $PACKS_BASE_DIR
cp -p ./st2tests/tests/configs/tests.yaml $CONFIG_BASE_DIR
cp -Rp ./st2tests/packs/tests $PACKS_BASE_DIR
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let me know if this is the right path ./st2tests/packs/tests

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests pack is in a completely different repo https://github.com/StackStorm/st2tests/. You have to git clone https://github.com/StackStorm/st2tests.git to a temporary location and then copy the directory ./st2tests/packs/tests/ from the temporary location to /opt/stackstorm/packs.

fi

# activate virtualenv to set PYTHONPATH
Expand Down Expand Up @@ -415,8 +414,24 @@ function st2start(){
--config-file $ST2_CONF --register-all
fi

if [ "$copy_examples" = true ]; then
st2 run packs.setup_virtualenv packs=tests
if [ "$copy_test_packs" = true ]; then
# Check if authentication is enabled
while read -r line; do
if [ "$line" == "[auth]" ]; then
found_auth=true
fi

if [ "$found_auth" = true ]; then
typeset -l line
if [ "$line" = "enable = true" ]; then
echo "Warning: Please setup virtualenv for pack \"tests\" before run integration test"
break
elif [ "$line" = "enable = false" ]; then
st2 run packs.setup_virtualenv packs=tests
break
fi
fi
done < "$ST2_CONF"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this while loop, can we just run st2 run packs.setup_virtualenv packs=tests and if it returns ERROR: 401 Client Error: Unauthorized, you echo the warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought just run st2 run packs.setup_virtualenv packs=tests and if it returns ERROR: 401 Client Error: Unauthorized is easy way but not graceful way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok with me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you going to change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you going to change this?

I am not going to change, but if this is too much, i can change it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I prefer simplicity here. If it returns an auth error, then warn users. This is a dev launch script, don't need to go thru the hassle to parse for the auth lines in the config file.

fi

# List screen sessions
Expand Down