-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow unicode character output for json and yaml in TUI (#944)
* Allow unicode for json and yaml in TUI * Revise tests * Add changelog
- Loading branch information
Showing
34 changed files
with
935 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fixed presentation of unicode characters while using mode interactive. -- by {user}`cidrblock` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
- name: Simple unicode output test | ||
hosts: localhost | ||
connection: local | ||
gather_facts: false | ||
tasks: | ||
- name: Raw with unicode arg and output | ||
raw: echo 航海家 | ||
register: output | ||
- name: Debug the output | ||
debug: | ||
var: output |
15 changes: 15 additions & 0 deletions
15
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_ee.py/test/0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "test[0-ansible-navigator run /tests/fixtures/integration/actions/run_unicode/site.yaml -i /tests/fixtures/integration/actions/run_unicode/inventory --ee True --ll debug --mode interactive-ansible-navigator run playbook]", | ||
"index": 0, | ||
"comment": "ansible-navigator run playbook", | ||
"additional_information": { | ||
"present": [], | ||
"absent": [], | ||
"compared_fixture": true | ||
}, | ||
"output": [ | ||
" PLAY NAME OK CHANGED UNREACHABLE FAILED SKIPPED IGNORED IN PROGRESS TASK COUNT PROGRESS", | ||
"0│Simple unicode output test 2 1 0 0 0 0 0 2 COMPLETE", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help SUCCESSFUL" | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_ee.py/test/1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "test[1-:0-play-1 details]", | ||
"index": 1, | ||
"comment": "play-1 details", | ||
"additional_information": { | ||
"present": [], | ||
"absent": [], | ||
"compared_fixture": true | ||
}, | ||
"output": [ | ||
" RESULT HOST NUMBER CHANGED TASK TASK ACTION DURATION", | ||
"0│OK localhost 0 True Raw with unicode arg and output raw 0s", | ||
"1│OK localhost 1 False Debug the output debug 0s", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help SUCCESSFUL" | ||
] | ||
} |
42 changes: 42 additions & 0 deletions
42
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_ee.py/test/2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"name": "test[2-:0-task-1 yaml]", | ||
"index": 2, | ||
"comment": "task-1 yaml", | ||
"additional_information": { | ||
"present": [ | ||
"航海家" | ||
], | ||
"absent": [], | ||
"compared_fixture": false | ||
}, | ||
"output": [ | ||
"PLAY [Simple unicode output test:0] ********************************************************************************************************************************************************************", | ||
"TASK [Raw with unicode arg and output] *****************************************************************************************************************************************************************", | ||
"CHANGED: [localhost]", | ||
" 0│---", | ||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
" 3│event_loop: null", | ||
" 4│host: localhost", | ||
" 5│play: Simple unicode output test", | ||
" 6│play_pattern: localhost", | ||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
" 8│remote_addr: localhost", | ||
" 9│res:", | ||
"10│ _ansible_no_log: false", | ||
"11│ changed: true", | ||
"12│ rc: 0", | ||
"13│ stderr: ''", | ||
"14│ stderr_lines: []", | ||
"15│ stdout: |-", | ||
"16│ 航海家", | ||
"17│ stdout_lines:", | ||
"18│ - 航海家", | ||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
"20│task: Raw with unicode arg and output", | ||
"21│task_action: raw", | ||
"22│task_args: ''", | ||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back - previous + next [0-9] goto :help help SUCCESSFUL" | ||
] | ||
} |
44 changes: 44 additions & 0 deletions
44
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_ee.py/test/3.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"name": "test[3-:json-task-1 json]", | ||
"index": 3, | ||
"comment": "task-1 json", | ||
"additional_information": { | ||
"present": [ | ||
"航海家" | ||
], | ||
"absent": [], | ||
"compared_fixture": false | ||
}, | ||
"output": [ | ||
"PLAY [Simple unicode output test:0] ********************************************************************************************************************************************************************", | ||
"TASK [Raw with unicode arg and output] *****************************************************************************************************************************************************************", | ||
"CHANGED: [localhost]", | ||
" 0│{", | ||
" 1│ \"duration\": 0.057188,", | ||
" 2│ \"end\": \"2022-02-13T18:28:45.394242\",", | ||
" 3│ \"event_loop\": null,", | ||
" 4│ \"host\": \"localhost\",", | ||
" 5│ \"play\": \"Simple unicode output test\",", | ||
" 6│ \"play_pattern\": \"localhost\",", | ||
" 7│ \"playbook\": \"/home/user/github/ansible-navigator/tests/fixtures/integration/actions/run_unicode/site.yaml\",", | ||
" 8│ \"remote_addr\": \"localhost\",", | ||
" 9│ \"res\": {", | ||
"10│ \"_ansible_no_log\": false,", | ||
"11│ \"changed\": true,", | ||
"12│ \"rc\": 0,", | ||
"13│ \"stderr\": \"\",", | ||
"14│ \"stderr_lines\": [],", | ||
"15│ \"stdout\": \"航海家,n\"", | ||
"16│ \"stdout_lines\": [", | ||
"17│ \"航海家\"", | ||
"18│ ]", | ||
"19│ },", | ||
"20│ \"start\": \"2022-02-13T18:28:45.337054\",", | ||
"21│ \"task\": \"Raw with unicode arg and output\",", | ||
"22│ \"task_action\": \"raw\",", | ||
"23│ \"task_args\": \"\",", | ||
"24│ \"task_path\": \"/home/user/github/ansible-navigator/tests/fixtures/integration/actions/run_unicode/site.yaml:6\"", | ||
"25│}", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back - previous + next [0-9] goto :help help SUCCESSFUL" | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_ee.py/test/4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "test[4-:back-play-1 details]", | ||
"index": 4, | ||
"comment": "play-1 details", | ||
"additional_information": { | ||
"present": [], | ||
"absent": [], | ||
"compared_fixture": true | ||
}, | ||
"output": [ | ||
" RESULT HOST NUMBER CHANGED TASK TASK ACTION DURATION", | ||
"0│OK localhost 0 True Raw with unicode arg and output raw 0s", | ||
"1│OK localhost 1 False Debug the output debug 0s", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help SUCCESSFUL" | ||
] | ||
} |
49 changes: 49 additions & 0 deletions
49
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_ee.py/test/5.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "test[5-:1-task-2 json]", | ||
"index": 5, | ||
"comment": "task-2 json", | ||
"additional_information": { | ||
"present": [ | ||
"航海家" | ||
], | ||
"absent": [], | ||
"compared_fixture": false | ||
}, | ||
"output": [ | ||
"PLAY [Simple unicode output test:1] ********************************************************************************************************************************************************************", | ||
"TASK [Debug the output] ********************************************************************************************************************************************************************************", | ||
"OK: [localhost]", | ||
" 0│{", | ||
" 1│ \"duration\": 0.109558,", | ||
" 2│ \"end\": \"2022-02-13T18:28:45.525577\",", | ||
" 3│ \"event_loop\": null,", | ||
" 4│ \"host\": \"localhost\",", | ||
" 5│ \"play\": \"Simple unicode output test\",", | ||
" 6│ \"play_pattern\": \"localhost\",", | ||
" 7│ \"playbook\": \"/home/user/github/ansible-navigator/tests/fixtures/integration/actions/run_unicode/site.yaml\",", | ||
" 8│ \"remote_addr\": \"localhost\",", | ||
" 9│ \"res\": {", | ||
"10│ \"_ansible_no_log\": false,", | ||
"11│ \"_ansible_verbose_always\": true,", | ||
"12│ \"changed\": false,", | ||
"13│ \"output\": {", | ||
"14│ \"changed\": true,", | ||
"15│ \"failed\": false,", | ||
"16│ \"rc\": 0,", | ||
"17│ \"stderr\": \"\",", | ||
"18│ \"stderr_lines\": [],", | ||
"19│ \"stdout\": \"航海家,n\"", | ||
"20│ \"stdout_lines\": [", | ||
"21│ \"航海家\"", | ||
"22│ ]", | ||
"23│ }", | ||
"24│ },", | ||
"25│ \"start\": \"2022-02-13T18:28:45.416019\",", | ||
"26│ \"task\": \"Debug the output\",", | ||
"27│ \"task_action\": \"debug\",", | ||
"28│ \"task_args\": \"\",", | ||
"29│ \"task_path\": \"/home/user/github/ansible-navigator/tests/fixtures/integration/actions/run_unicode/site.yaml:9\"", | ||
"30│}", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back - previous + next [0-9] goto :help help SUCCESSFUL" | ||
] | ||
} |
46 changes: 46 additions & 0 deletions
46
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_ee.py/test/6.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "test[6-:yaml-task-2 yaml]", | ||
"index": 6, | ||
"comment": "task-2 yaml", | ||
"additional_information": { | ||
"present": [ | ||
"航海家" | ||
], | ||
"absent": [], | ||
"compared_fixture": false | ||
}, | ||
"output": [ | ||
"PLAY [Simple unicode output test:1] ********************************************************************************************************************************************************************", | ||
"TASK [Debug the output] ********************************************************************************************************************************************************************************", | ||
"OK: [localhost]", | ||
" 0│---", | ||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
" 3│event_loop: null", | ||
" 4│host: localhost", | ||
" 5│play: Simple unicode output test", | ||
" 6│play_pattern: localhost", | ||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
" 8│remote_addr: localhost", | ||
" 9│res:", | ||
"10│ _ansible_no_log: false", | ||
"11│ _ansible_verbose_always: true", | ||
"12│ changed: false", | ||
"13│ output:", | ||
"14│ changed: true", | ||
"15│ failed: false", | ||
"16│ rc: 0", | ||
"17│ stderr: ''", | ||
"18│ stderr_lines: []", | ||
"19│ stdout: |-", | ||
"20│ 航海家", | ||
"21│ stdout_lines:", | ||
"22│ - 航海家", | ||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
"24│task: Debug the output", | ||
"25│task_action: debug", | ||
"26│task_args: ''", | ||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back - previous + next [0-9] goto :help help SUCCESSFUL" | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_ee.py/test/7.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "test[7-:back-play-1 details]", | ||
"index": 7, | ||
"comment": "play-1 details", | ||
"additional_information": { | ||
"present": [], | ||
"absent": [], | ||
"compared_fixture": true | ||
}, | ||
"output": [ | ||
" RESULT HOST NUMBER CHANGED TASK TASK ACTION DURATION", | ||
"0│OK localhost 0 True Raw with unicode arg and output raw 0s", | ||
"1│OK localhost 1 False Debug the output debug 0s", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help SUCCESSFUL" | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_ee.py/test/8.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "test[8-:back-all play details]", | ||
"index": 8, | ||
"comment": "all play details", | ||
"additional_information": { | ||
"present": [], | ||
"absent": [], | ||
"compared_fixture": true | ||
}, | ||
"output": [ | ||
" PLAY NAME OK CHANGED UNREACHABLE FAILED SKIPPED IGNORED IN PROGRESS TASK COUNT PROGRESS", | ||
"0│Simple unicode output test 2 1 0 0 0 0 0 2 COMPLETE", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help SUCCESSFUL" | ||
] | ||
} |
36 changes: 36 additions & 0 deletions
36
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_ee.py/test/9.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"name": "test[9-:st-display stream]", | ||
"index": 9, | ||
"comment": "display stream", | ||
"additional_information": { | ||
"present": [], | ||
"absent": [], | ||
"compared_fixture": true | ||
}, | ||
"output": [ | ||
" 0│", | ||
" 1│PLAY [Simple unicode output test] **********************************************", | ||
" 2│", | ||
" 3│TASK [Raw with unicode arg and output] *****************************************", | ||
" 4│changed: [localhost]", | ||
" 5│", | ||
" 6│TASK [Debug the output] ********************************************************", | ||
" 7│ok: [localhost] => {", | ||
" 8│ \"output\": {", | ||
" 9│ \"changed\": true,", | ||
"10│ \"failed\": false,", | ||
"11│ \"rc\": 0,", | ||
"12│ \"stderr\": \"\",", | ||
"13│ \"stderr_lines\": [],", | ||
"14│ \"stdout\": \"航海家\\n\",", | ||
"15│ \"stdout_lines\": [", | ||
"16│ \"航海家\"", | ||
"17│ ]", | ||
"18│ }", | ||
"19│}", | ||
"20│", | ||
"21│PLAY RECAP *********************************************************************", | ||
"22│localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back :help help SUCCESSFUL" | ||
] | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_noee.py/test/0.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "test[0-ansible-navigator run /tests/fixtures/integration/actions/run_unicode/site.yaml -i /tests/fixtures/integration/actions/run_unicode/inventory --ee False --ll debug --mode interactive-ansible-navigator run playbook]", | ||
"index": 0, | ||
"comment": "ansible-navigator run playbook", | ||
"additional_information": { | ||
"present": [], | ||
"absent": [], | ||
"compared_fixture": true | ||
}, | ||
"output": [ | ||
" PLAY NAME OK CHANGED UNREACHABLE FAILED SKIPPED IGNORED IN PROGRESS TASK COUNT PROGRESS", | ||
"0│Simple unicode output test 2 1 0 0 0 0 0 2 COMPLETE", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help SUCCESSFUL" | ||
] | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/fixtures/integration/actions/run_unicode/test_direct_interactive_noee.py/test/1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "test[1-:0-play-1 details]", | ||
"index": 1, | ||
"comment": "play-1 details", | ||
"additional_information": { | ||
"present": [], | ||
"absent": [], | ||
"compared_fixture": true | ||
}, | ||
"output": [ | ||
" RESULT HOST NUMBER CHANGED TASK TASK ACTION DURATION", | ||
"0│OK localhost 0 True Raw with unicode arg and output raw 0s", | ||
"1│OK localhost 1 False Debug the output debug 0s", | ||
"^f/PgUp page up ^b/PgDn page down ↑↓ scroll esc back [0-9] goto :help help SUCCESSFUL" | ||
] | ||
} |
Oops, something went wrong.