From 686ccaae3b7d58198b4522a5d0b8faaba6d73961 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Tue, 10 Dec 2019 22:05:38 -0800 Subject: [PATCH 1/8] [#766] Skip the broken test on windows for now --- features/core.feature | 1 + features/environment.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/features/core.feature b/features/core.feature index 36601fde..34539efb 100644 --- a/features/core.feature +++ b/features/core.feature @@ -20,6 +20,7 @@ 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 "" diff --git a/features/environment.py b/features/environment.py index 8ba781ac..ebda16b6 100644 --- a/features/environment.py +++ b/features/environment.py @@ -1,5 +1,6 @@ import shutil import os +import sys def before_feature(context, feature): @@ -9,6 +10,9 @@ def before_feature(context, feature): feature.skip("Marked with @skip") return + if "skip_win" in feature.tags and "win32" in sys.platform: + feature.skip("Skipping on Windows") + return def before_scenario(context, scenario): """Before each scenario, backup all config and journal test data.""" @@ -36,6 +40,9 @@ def before_scenario(context, scenario): scenario.skip("Marked with @skip") return + if "skip_win" in scenario.effective_tags and "win32" in sys.platform: + scenario.skip("Skipping on Windows") + return def after_scenario(context, scenario): """After each scenario, restore all test data and remove working_dirs.""" From 5434d476debe37ea15d9db3f689d4b9d98861635 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Tue, 10 Dec 2019 22:51:56 -0800 Subject: [PATCH 2/8] [#766] Skip another broken windows test --- features/core.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/features/core.feature b/features/core.feature index 34539efb..d061d094 100644 --- a/features/core.feature +++ b/features/core.feature @@ -41,6 +41,7 @@ Feature: Basic reading and writing to a journal When we run "jrnl -on 'june 6 2013' --short" Then the output should be "2013-06-10 15:40 Life is good." + @skip_win Scenario: Emoji support Given we use the config "basic.yaml" When we run "jrnl 23 july 2013: 🌞 sunny day. Saw an 🐘" From 2d92201157841ac010b6da583e8afb6e02c8b991 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 4 Jan 2020 13:02:15 -0800 Subject: [PATCH 3/8] remove broken test (windows can't handle emoji) --- features/core.feature | 9 --------- 1 file changed, 9 deletions(-) diff --git a/features/core.feature b/features/core.feature index d061d094..c023cd4c 100644 --- a/features/core.feature +++ b/features/core.feature @@ -41,15 +41,6 @@ Feature: Basic reading and writing to a journal When we run "jrnl -on 'june 6 2013' --short" Then the output should be "2013-06-10 15:40 Life is good." - @skip_win - Scenario: Emoji support - Given we use the config "basic.yaml" - When we run "jrnl 23 july 2013: 🌞 sunny day. Saw an 🐘" - Then we should see the message "Entry added" - When we run "jrnl -n 1" - Then the output should contain "🌞" - and the output should contain "🐘" - Scenario: Writing an entry at the prompt Given we use the config "basic.yaml" When we run "jrnl" and enter "25 jul 2013: I saw Elvis. He's alive." From efa21831ed5bd4fdceb64ab56a31fae2b1b9d0e1 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 4 Jan 2020 13:23:57 -0800 Subject: [PATCH 4/8] skip another windows test --- features/dayone_regressions.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/features/dayone_regressions.feature b/features/dayone_regressions.feature index c3b700b9..cbbc4086 100644 --- a/features/dayone_regressions.feature +++ b/features/dayone_regressions.feature @@ -24,6 +24,7 @@ Feature: Zapped Dayone bugs stay dead! | I'm feeling sore because I forgot to stretch. """ + @skip_win Scenario: Opening an folder that's not a DayOne folder gives a nice error message Given we use the config "empty_folder.yaml" When we run "jrnl Herro" From 3f8133cda5a5aabb51e8ee0e6d04bcfcc7d0be8c Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 4 Jan 2020 13:24:07 -0800 Subject: [PATCH 5/8] whitespace changes --- features/dayone_regressions.feature | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/features/dayone_regressions.feature b/features/dayone_regressions.feature index cbbc4086..f6098ba6 100644 --- a/features/dayone_regressions.feature +++ b/features/dayone_regressions.feature @@ -13,16 +13,16 @@ Feature: Zapped Dayone bugs stay dead! # fails when system time is UTC (as on Travis-CI) @skip - Scenario: Title with an embedded period on DayOne journal - Given we use the config "dayone.yaml" - When we run "jrnl 04-24-2014: "Ran 6.2 miles today in 1:02:03. I'm feeling sore because I forgot to stretch."" - Then we should see the message "Entry added" - When we run "jrnl -1" - Then the output should be - """ - 2014-04-24 09:00 Ran 6.2 miles today in 1:02:03. - | I'm feeling sore because I forgot to stretch. - """ + Scenario: Title with an embedded period on DayOne journal + Given we use the config "dayone.yaml" + When we run "jrnl 04-24-2014: "Ran 6.2 miles today in 1:02:03. I'm feeling sore because I forgot to stretch."" + Then we should see the message "Entry added" + When we run "jrnl -1" + Then the output should be + """ + 2014-04-24 09:00 Ran 6.2 miles today in 1:02:03. + | I'm feeling sore because I forgot to stretch. + """ @skip_win Scenario: Opening an folder that's not a DayOne folder gives a nice error message From 549d7719565bc7dde4e986dc8f66d2549e568f1d Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 4 Jan 2020 13:37:50 -0800 Subject: [PATCH 6/8] skip another windows test --- features/encryption.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/features/encryption.feature b/features/encryption.feature index 787fa850..e5bcd8e6 100644 --- a/features/encryption.feature +++ b/features/encryption.feature @@ -43,6 +43,7 @@ Then the output should contain "Password" And the output should contain "2013-06-10 15:40 Life is good" + @skip_win Scenario: Storing a password in Keychain Given we use the config "multiple.yaml" When we run "jrnl simple --encrypt" and enter From a3e24bcc9fd7eaeea047becc9ef5e0d363971a1a Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 4 Jan 2020 13:42:25 -0800 Subject: [PATCH 7/8] run black --- features/environment.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/environment.py b/features/environment.py index ebda16b6..02f2747e 100644 --- a/features/environment.py +++ b/features/environment.py @@ -14,6 +14,7 @@ def before_feature(context, feature): feature.skip("Skipping on Windows") return + def before_scenario(context, scenario): """Before each scenario, backup all config and journal test data.""" # Clean up in case something went wrong @@ -44,6 +45,7 @@ def before_scenario(context, scenario): scenario.skip("Skipping on Windows") return + def after_scenario(context, scenario): """After each scenario, restore all test data and remove working_dirs.""" for folder in ("configs", "journals"): From 6fc1313b47458b3ef989ce69b475f96045dfc7d6 Mon Sep 17 00:00:00 2001 From: Jonathan Wren Date: Sat, 4 Jan 2020 13:49:05 -0800 Subject: [PATCH 8/8] skip more windows tests --- features/encryption.feature | 2 ++ features/upgrade.feature | 3 +++ 2 files changed, 5 insertions(+) diff --git a/features/encryption.feature b/features/encryption.feature index e5bcd8e6..081a208f 100644 --- a/features/encryption.feature +++ b/features/encryption.feature @@ -12,6 +12,7 @@ Then we should see the message "Journal decrypted" And the journal should have 2 entries + @skip_win Scenario: Encrypting a journal Given we use the config "basic.yaml" When we run "jrnl --encrypt" and enter @@ -26,6 +27,7 @@ Then the output should contain "Password" And the output should contain "2013-06-10 15:40 Life is good" + @skip_win Scenario: Mistyping your password Given we use the config "basic.yaml" When we run "jrnl --encrypt" and enter diff --git a/features/upgrade.feature b/features/upgrade.feature index ef597d4f..b2c569c7 100644 --- a/features/upgrade.feature +++ b/features/upgrade.feature @@ -1,5 +1,6 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x + @skip_win Scenario: Upgrade and parse journals with square brackets Given we use the config "upgrade_from_195.json" When we run "jrnl -9" and enter "Y" @@ -11,6 +12,7 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x """ Then the journal should have 2 entries + @skip_win Scenario: Upgrading a journal encrypted with jrnl 1.x Given we use the config "encrypted_old.json" When we run "jrnl -n 1" and enter @@ -22,6 +24,7 @@ Feature: Upgrading Journals from 1.x.x to 2.x.x Then the output should contain "Password" and the output should contain "2013-06-10 15:40 Life is good" + @skip_win Scenario: Upgrade and parse journals with little endian date format Given we use the config "upgrade_from_195_little_endian_dates.json" When we run "jrnl -9" and enter "Y"