From d5d50c23c6299e83b31659911463502bd876c79a Mon Sep 17 00:00:00 2001 From: Micah Jerome Ellison Date: Sun, 24 May 2020 13:27:33 -0700 Subject: [PATCH] Remove skip_win directives, cause them to fail, and add tracers to see where it hangs in the Travis build log --- features/core.feature | 4 ++-- features/steps/core.py | 4 ++++ jrnl/cli.py | 7 +++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/features/core.feature b/features/core.feature index 057db399..44defe94 100644 --- a/features/core.feature +++ b/features/core.feature @@ -33,13 +33,12 @@ Feature: Basic reading and writing to a journal When we run "jrnl -n 1" Then the output should contain "2013-07-23 09:00 A cold and stormy day." - @skip_win Scenario: Writing an empty entry from the editor Given we use the config "editor.yaml" When we open the editor and enter nothing Then we should see the message "[Nothing saved to file]" + Then we should see the message "This test was hanging on Travis" - @skip_win Scenario: Sending an argument with spaces to the editor should work Given we use the config "editor-args.yaml" When we open the editor and enter "lorem ipsum" @@ -48,6 +47,7 @@ Feature: Basic reading and writing to a journal And one editor argument should be "-f" And one editor argument should be "-c" And one editor argument should match "'?setf markdown'?" + Then we should see the message "This test was hanging on Travis" Scenario: Writing an empty entry from the command line Given we use the config "basic.yaml" diff --git a/features/steps/core.py b/features/steps/core.py index 99ac9859..3086017f 100644 --- a/features/steps/core.py +++ b/features/steps/core.py @@ -94,6 +94,7 @@ def open_editor_and_enter(context, text=""): return tmpfile with patch("subprocess.call", side_effect=_mock_editor_function): + print("About to run execute_steps", file=sys.stderr) context.execute_steps('when we run "jrnl"') @@ -140,6 +141,8 @@ def _mock_input(inputs): @when('we run "{command}" and enter nothing') @when('we run "{command}" and enter "{inputs}"') def run_with_input(context, command, inputs=""): + print("run_with_input", file=sys.stderr) + # create an iterator through all inputs. These inputs will be fed one by one # to the mocked calls for 'input()', 'util.getpass()' and 'sys.stdin.read()' if context.text: @@ -156,6 +159,7 @@ def run_with_input(context, command, inputs=""): patch("sys.stdin.read", side_effect=text) as mock_read: try: + print(f"cli.run {args}", file=sys.stderr) cli.run(args or []) context.exit_status = 0 except SystemExit as e: diff --git a/jrnl/cli.py b/jrnl/cli.py index 513d9735..570ac12d 100644 --- a/jrnl/cli.py +++ b/jrnl/cli.py @@ -303,6 +303,8 @@ def configure_logger(debug=False): def run(manual_args=None): + print("run", file=sys.stderr) + if manual_args is None: manual_args = sys.argv[1:] @@ -345,6 +347,9 @@ def run(manual_args=None): mode_compose, mode_export, mode_import = guess_mode(args, config) + print(f"mode_compose: {mode_compose}, mode_export: {mode_export}, mode_import: {mode_import}", file=sys.stderr) + + # How to quit writing? if "win32" in sys.platform: _exit_multiline_code = "on a blank line, press Ctrl+Z and then Enter" @@ -358,6 +363,8 @@ def run(manual_args=None): print("[Interrupted while opening journal]", file=sys.stderr) sys.exit(1) + print("journal is open", file=sys.stderr) + if mode_compose and not args.text: if not sys.stdin.isatty(): # Piping data into jrnl